Skip to content

Instantly share code, notes, and snippets.

@coingraham
Created February 5, 2020 19:51
Show Gist options
  • Save coingraham/b8ff7ea0a43041750254d11eba2e9d76 to your computer and use it in GitHub Desktop.
Save coingraham/b8ff7ea0a43041750254d11eba2e9d76 to your computer and use it in GitHub Desktop.
guard duty cloud custodian
policies:
- name: ec2-guard-remediate
resource: ec2
mode:
role: arn:aws:iam::{account_id}:role/CustodianPolicyExecution
type: guard-duty
filters:
# Filter for medium and high severity events
- type: event
key: detail.severity
op: gte
value: 4.5
actions:
- stop
- name: iam-guard-remediate
resource: iam-user
mode:
role: arn:aws:iam::{account_id}:role/CustodianPolicyExecution
type: guard-duty
filters:
# Only a particular type of event, go ahead and remove keys
- type: event
key: detail.type
value: "UnauthorizedAccess:IAMUser/TorIPCaller"
actions:
- remove-keys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment