Skip to content

Instantly share code, notes, and snippets.

@mtheoryx
Last active October 9, 2026 18:28
Show Gist options
  • Select an option

  • Save mtheoryx/59c3b9b5bf25fb306ff339e1069a33a3 to your computer and use it in GitHub Desktop.

Select an option

Save mtheoryx/59c3b9b5bf25fb306ff339e1069a33a3 to your computer and use it in GitHub Desktop.
Bucket Policy
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowMacieGetBucketLocation",
"Effect": "Allow",
"Principal": { "Service": "macie.amazonaws.com" },
"Action": "s3:GetBucketLocation",
"Resource": "arn:aws:s3:::ncaa-macie-results-411294620421",
"Condition": {
"StringEquals": { "aws:SourceAccount": "411294620421" },
"ArnLike": {
"aws:SourceArn": [
"arn:aws:macie2:*:411294620421:export-configuration:*",
"arn:aws:macie2:*:411294620421:classification-job/*"
]
}
}
},
{
"Sid": "AllowMacieToWriteResults",
"Effect": "Allow",
"Principal": { "Service": "macie.amazonaws.com" },
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::ncaa-macie-results-411294620421/*",
"Condition": {
"StringEquals": { "aws:SourceAccount": "411294620421" },
"ArnLike": {
"aws:SourceArn": [
"arn:aws:macie2:*:411294620421:export-configuration:*",
"arn:aws:macie2:*:411294620421:classification-job/*"
]
}
}
},
{
"Sid": "DenyUnencryptedUploads",
"Effect": "Deny",
"Principal": { "Service": "macie.amazonaws.com" },
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::ncaa-macie-results-411294620421/*",
"Condition": { "StringNotEquals": { "s3:x-amz-server-side-encryption": "aws:kms" } }
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment