Package org.apache.hadoop.fs.s3a.auth
Class RolePolicies
java.lang.Object
org.apache.hadoop.fs.s3a.auth.RolePolicies
Operations, statements and policies covering the operations
needed to work with S3.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringEverything: "*".static final StringArn for all KMS keys: "*".static final StringAll KMS operations: "kms:*".static final StringDecrypt data encrypted with SSE-KMS: "kms:Decrypt".static final StringKMS encryption.static final StringThis is used by S3 to generate a per-object encryption key and the encrypted value of this, the latter being what it tags the object with for later decryption: "kms:GenerateDataKey".static final StringAbort multipart upload is needed for the S3A Commit protocols.static final StringAll S3 buckets: "arn:aws:s3:::*".static final StringAll s3:Delete* operations.static final StringAll s3:Get* operations.static final StringAll S3 operations: "s3:*".static final StringS3 Put*.static final StringAll bucket list operations, includingS3_BUCKET_LIST_BUCKETandS3_BUCKET_LIST_MULTIPART_UPLOADS.static final StringList the contents of a bucket.static final StringThis is used by the abort operation in S3A commit work.static final String[]Policies which can be applied to bucket resources for read operations.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringList multipart upload is needed for the S3A Commit protocols.Actions needed to write data to an S3A Path.Actions needed to write data to an S3A Path.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringActions needed for R/W IO from the root of a bucket.static final StringAll S3Express buckets: "arn:aws:s3express:*:*:bucket/*--*--x-s3".static final StringS3 Express All operations: "s3express:*".static final StringS3Express session permission; required unless sessions are disabled: "s3express:CreateSession".static final RoleModel.StatementAllow all S3 Operations.static final RoleModel.StatementThe s3:GetBucketLocation permission is for all buckets, not for any named bucket, which complicates permissions.static final RoleModel.StatementStatement to allow KMS R/W access access, so full use of SSE-KMS.static final RoleModel.StatementStatement to allow read access to KMS keys, so the ability to read SSE-KMS data,, but not decrypt it.static final RoleModel.StatementS3 Express operations required for operation. -
Method Summary
Modifier and TypeMethodDescriptionstatic List<RoleModel.Statement>allowS3Operations(String bucket, boolean write) From an S3 bucket name, build an ARN to refer to it.static StringbucketObjectsToArn(String bucket) From an S3 bucket name, build an ARN to refer to all objects in it.static StringbucketToArn(String bucket) From an S3 bucket name, build an ARN to refer to it.
-
Field Details
-
KMS_ALL_OPERATIONS
All KMS operations: "kms:*".- See Also:
-
KMS_ENCRYPT
KMS encryption. This is Not used by SSE-KMS: "kms:Encrypt".- See Also:
-
KMS_DECRYPT
Decrypt data encrypted with SSE-KMS: "kms:Decrypt".- See Also:
-
KMS_ALL_KEYS
Arn for all KMS keys: "*".- See Also:
-
KMS_GENERATE_DATA_KEY
This is used by S3 to generate a per-object encryption key and the encrypted value of this, the latter being what it tags the object with for later decryption: "kms:GenerateDataKey".- See Also:
-
STATEMENT_ALLOW_KMS_RW
Statement to allow KMS R/W access access, so full use of SSE-KMS. -
STATEMENT_ALLOW_SSE_KMS_READ
Statement to allow read access to KMS keys, so the ability to read SSE-KMS data,, but not decrypt it. -
S3_ALL_OPERATIONS
All S3 operations: "s3:*".- See Also:
-
S3_ALL_BUCKETS
All S3 buckets: "arn:aws:s3:::*".- See Also:
-
S3_BUCKET_ALL_LIST
All bucket list operations, includingS3_BUCKET_LIST_BUCKETandS3_BUCKET_LIST_MULTIPART_UPLOADS.- See Also:
-
S3_BUCKET_LIST_BUCKET
List the contents of a bucket. It applies to a bucket, not to a path in a bucket.- See Also:
-
S3_BUCKET_LIST_MULTIPART_UPLOADS
This is used by the abort operation in S3A commit work. It applies to a bucket, not to a path in a bucket.- See Also:
-
S3_LIST_MULTIPART_UPLOAD_PARTS
List multipart upload is needed for the S3A Commit protocols. It applies to a path in a bucket.- See Also:
-
S3_ABORT_MULTIPART_UPLOAD
Abort multipart upload is needed for the S3A Commit protocols. It applies to a path in a bucket.- See Also:
-
S3_ALL_DELETE
All s3:Delete* operations.- See Also:
-
S3_DELETE_OBJECT
- See Also:
-
S3_DELETE_OBJECT_TAGGING
- See Also:
-
S3_DELETE_OBJECT_VERSION
- See Also:
-
S3_DELETE_OBJECT_VERSION_TAGGING
- See Also:
-
S3_ALL_GET
All s3:Get* operations.- See Also:
-
S3_GET_OBJECT
- See Also:
-
S3_GET_OBJECT_ACL
- See Also:
-
S3_GET_OBJECT_TAGGING
- See Also:
-
S3_GET_OBJECT_TORRENT
- See Also:
-
S3_GET_OBJECT_VERSION
- See Also:
-
S3_GET_BUCKET_LOCATION
- See Also:
-
S3_GET_OBJECT_VERSION_ACL
- See Also:
-
S3_GET_OBJECT_VERSION_TAGGING
- See Also:
-
S3_GET_OBJECT_VERSION_TORRENT
- See Also:
-
S3_ALL_PUT
S3 Put*. This covers single an multipart uploads, but not list/abort of the latter.- See Also:
-
S3_PUT_OBJECT
- See Also:
-
S3_PUT_OBJECT_ACL
- See Also:
-
S3_PUT_OBJECT_TAGGING
- See Also:
-
S3_PUT_OBJECT_VERSION_ACL
- See Also:
-
S3_PUT_OBJECT_VERSION_TAGGING
- See Also:
-
S3_RESTORE_OBJECT
- See Also:
-
EVERYTHING_ARN
Everything: "*".- See Also:
-
S3EXPRESS_ALL_BUCKETS
All S3Express buckets: "arn:aws:s3express:*:*:bucket/*--*--x-s3". S3Express adds another "domain" for permissions: S3 express ARNs and S3 Express operations, of which createSession is one key operation. See https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security.html Note: this wildcard patten came from AWS Q; if it is wrong blame GenerativeAI.- See Also:
-
S3EXPRESS_CREATE_SESSION_POLICY
S3Express session permission; required unless sessions are disabled: "s3express:CreateSession". See https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html- See Also:
-
S3EXPRESS_ALL_OPERATIONS
S3 Express All operations: "s3express:*".- See Also:
-
S3_ROOT_READ_OPERATIONS_LIST
-
S3_BUCKET_READ_OPERATIONS
Policies which can be applied to bucket resources for read operations.- SSE-KMS key operations
-
S3_PATH_RW_OPERATIONS
Actions needed to write data to an S3A Path. This includes the appropriate read operations, but not SSE-KMS support. -
S3_PATH_WRITE_OPERATIONS
Actions needed to write data to an S3A Path. This is purely the extra operations needed for writing atop of the read operation set. Deny these and a path is still readable, but not writeable. Excludes: bucket-ARN and SSE-KMS permissions. -
S3_ROOT_RW_OPERATIONS
Actions needed for R/W IO from the root of a bucket. Excludes: bucket-ARN and SSE-KMS permissions. -
STATEMENT_ALL_S3
Allow all S3 Operations. This does not cover S3-KMS -
STATEMENT_S3EXPRESS
S3 Express operations required for operation. -
STATEMENT_ALL_S3_GET_BUCKET_LOCATION
The s3:GetBucketLocation permission is for all buckets, not for any named bucket, which complicates permissions.
-
-
Method Details
-
allowS3Operations
From an S3 bucket name, build an ARN to refer to it.- Parameters:
bucket- bucket name.write- are write permissions required- Returns:
- return statement granting access.
-
bucketObjectsToArn
From an S3 bucket name, build an ARN to refer to all objects in it.- Parameters:
bucket- bucket name.- Returns:
- return the ARN to use in statements.
-
bucketToArn
From an S3 bucket name, build an ARN to refer to it.- Parameters:
bucket- bucket name.- Returns:
- return the ARN to use in statements.
-