IAM policy to use encryption with DataBrew
The AwsGlueDataBrewS3EncryptedPolicy
policy grants the permissions needed
to access S3 objects encrypted with Amazon Key Management Service (Amazon KMS) on behalf of nonadministrative users.
Customize the policy as follows:
-
Replace the Amazon S3 paths in the policy so that they point to the paths you want to use. In the sample text,
represents a specific object or file.BUCKET-NAME-1/SPECIFIC-OBJECT-NAME
represents all objects (BUCKET-NAME-2/
*
) whose path name starts withBUCKET-NAME-2/
. Update these to name the buckets you are using. -
(Optional) Use wildcards in the Amazon S3 paths to further restrict permissions. For more information, see IAM policy elements: Variables and tags.
As part of doing this, you might restrict permissions for the actions
s3:PutObject
ands3:PutBucketCORS
. These actions are required only for users who create DataBrew projects, because those users need to be able to send output files to S3.For more information and to see some examples of what you can add to an IAM policy for Amazon S3, see Bucket Policy Examples.
-
Find the following resource ARNs in the
ToUseKms
file."arn:aws:kms:
AWS-REGION-NAME
:AWS-ACCOUNT-ID-WITHOUT-DASHES
:key/KEY-IDS
", "arn:aws:kms:AWS-REGION-NAME
:AWS-ACCOUNT-ID-WITHOUT-DASHES
:key/KEY-IDS
" -
Change the example Amazon account to your Amazon account number (without hyphens).
-
Change the sample list to instead list the IAM roles you want to use. We recommend scoping your IAM policies to the smallest permissions set possible. However, you can allow your user to access all IAM roles, for example if you are using a personal learning account with sample data. To allow the list to access all IAM roles, change the sample list to one entry:
"arn:aws:iam::
.111122223333
:role/*"
The following table describes the permissions granted by this policy.
Action | Resource | Description |
---|---|---|
|
|
Allows you to preview your files. |
|
|
Allows listing of Amazon S3 buckets from projects, datasets, and jobs. |
|
|
Allows sending output files to S3. |
|
|
Allows deleting an object created by DataBrew. |
"kms:Decrypt" |
|
Allows decrypting for encrypted datasets. |
|
|
Allows encrypting of job output. |
To define the AwsGlueDataBrewS3EncryptedPolicy IAM policy for DataBrew (console)
-
Download the JSON for the
AwsGlueDataBrewS3EncryptedPolicy
IAM policy. -
Sign in to the Amazon Web Services Management Console and open the IAM console at https://console.amazonaws.cn/iam/
. -
In the navigation pane, choose Policies.
-
For each policy, choose Create Policy.
-
On the Create Policy screen, navigate to the JSON tab.
-
Paste in the policy JSON statement over the sample statement in the editor.
-
Verify that the policy is customized to your account, security requirements, and required Amazon resources. If you need to make changes, you can make them in the editor.
-
Choose Review policy.
To define the AwsGlueDataBrewS3EncryptedPolicy IAM policy for DataBrew (Amazon CLI)
-
Download the JSON for
AwsGlueDataBrewS3EncryptedPolicy
. -
Customize the policy as described in the first step of the previous procedure.
-
Run the following command to create the policy.
aws iam create-policy --policy-name AwsGlueDataBrewS3EncryptedPolicy --policy-document file://iam-policy-AwsGlueDataBrewS3EncryptedPolicy.json