Skip to content

Instantly share code, notes, and snippets.

@jtroberts83
Created April 5, 2018 18:35
Show Gist options
  • Save jtroberts83/aaf395c634cc1e5c023c569f3a84d77e to your computer and use it in GitHub Desktop.
Save jtroberts83/aaf395c634cc1e5c023c569f3a84d77e to your computer and use it in GitHub Desktop.
policies:
- name: sg-auto-tag-user
resource: security-group
description: |
Creates a Tag called CreatorName with a value of the user who created the Security Group
mode:
type: cloudtrail
events:
- source: ec2.amazonaws.com
event: AuthorizeSecurityGroupIngress
ids: "requestParameters.groupId"
- source: ec2.amazonaws.com
event: AuthorizeSecurityGroupEgress
ids: "requestParameters.groupId"
- source: ec2.amazonaws.com
event: RevokeSecurityGroupEgress
ids: "requestParameters.groupId"
- source: ec2.amazonaws.com
event: RevokeSecurityGroupIngress
ids: "requestParameters.groupId"
actions:
- type: auto-tag-user
tag: CreatorName
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment