Forked from colemanja91/s3_athena_restricted_policy.json
Created
June 14, 2018 03:20
-
-
Save felipe1982/20a634ebbae0cd840f705213eca430bf to your computer and use it in GitHub Desktop.
Sample Athena Results S3 Policy for Restricted Data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Id": "Policy1523289797898", | |
"Statement": [ | |
{ | |
"Sid": "DenyRestrictedResultsAccess", | |
"Effect": "Deny", | |
"NotPrincipal": { | |
"AWS": [ | |
"arn:aws:iam::{{ aws_account_id }}:user/{{ aws_user_name }}" | |
] | |
}, | |
"Action": "s3:GetObject", | |
"Resource": "arn:aws:s3:::aws-athena-query-results-{{ aws_account_id }}-us-east-1/*", | |
"Condition": { | |
"StringEquals": { | |
"s3:ExistingObjectTag/restriced_data": "True" | |
} | |
} | |
}, | |
{ | |
"Sid": "DenyPolicyUpdates", | |
"Effect": "Deny", | |
"NotPrincipal": { | |
"AWS": [ | |
"arn:aws:iam::{{ aws_account_id }}:user/{{ aws_user_name }}" | |
] | |
}, | |
"Action": "s3:PutBucketPolicy", | |
"Resource": "arn:aws:s3:::aws-athena-query-results-{{ aws_account_id }}-us-east-1" | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment