Skip to content

Instantly share code, notes, and snippets.

@colemanja91
Last active June 14, 2018 03:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save colemanja91/ec178edc4b21034a5a9f078381971648 to your computer and use it in GitHub Desktop.
Save colemanja91/ec178edc4b21034a5a9f078381971648 to your computer and use it in GitHub Desktop.
Sample Athena Results S3 Policy for Restricted Data
{
"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