Last active
November 10, 2020 12:13
-
-
Save felipekiko/b3d107c67249af3043c89631aaa54bc2 to your computer and use it in GitHub Desktop.
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
policies: | |
- name: s3-check-with-public-access | |
resource: aws.s3 | |
comment: Checks if has some S3 bucket with public access | |
filters: | |
- or: | |
- type: global-grants | |
- type: cross-account | |
everyone_only: true | |
actions: | |
- type: tag | |
key: Cloud-Custodian-S3-With-Public-Access | |
value: true | |
- name: s3-tag-when-create-with-public-access | |
resource: aws.s3 | |
comment: Checks if has some S3 bucket with public access | |
mode: | |
type: cloudtrail | |
events: | |
- CreateBucket | |
- source: 's3.amazonaws.com' | |
event: PutBucketPolicy | |
ids: 'requestParameters.bucketName' | |
role: arn:aws:iam::{account_id}:role/YOUR-CUSTODIAN-ROLE | |
timeout: 200 | |
filters: | |
- or: | |
- type: global-grants | |
- type: cross-account | |
everyone_only: true | |
actions: | |
- type: tag | |
key: Cloud-Custodian-S3-With-Public-Access | |
value: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment