Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-24000

S3A: Create Table should fail on invalid AK/SK

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 2.3.0
    • Fix Version/s: None
    • Component/s: Spark Shell
    • Labels:
      None

      Description

      Currently, When we pass the invalid ak&&sk create table will be the success.

      when the S3AFileSystem is initialized, verifyBucketExists() is called, which will return True as the status code 403 (BUCKET_ACCESS_FORBIDDEN_STATUS_CODE)  from following as bucket exists.

      public boolean doesBucketExist(String bucketName)
               throws AmazonClientException, AmazonServiceException {
       
           try {
               headBucket(new HeadBucketRequest(bucketName));
               return true;
           } catch (AmazonServiceException ase) {
               // A redirect error or a forbidden error means the bucket exists. So
               // returning true.
               if ((ase.getStatusCode() == Constants.BUCKET_REDIRECT_STATUS_CODE)
                       || (ase.getStatusCode() == Constants.BUCKET_ACCESS_FORBIDDEN_STATUS_CODE)) {
                   return true;
               }
               if (ase.getStatusCode() == Constants.NO_SUCH_BUCKET_STATUS_CODE) {
                   return false;
               }
               throw ase;
       
           }
       }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                brahmareddy Brahma Reddy Battula
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: