forked from davidclin/cloudcustodian-policies
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathunused-sgroup-audit.yml
36 lines (36 loc) · 1.12 KB
/
unused-sgroup-audit.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
policies:
- name: unused-sgroups-audit
resource: security-group
description: |
Cloud Custodian Unused Security Group Audit
comments: |
Retrieve unused security groups using regex and delete.
Notify using Simple Email Service (SES).
To get a complete list, use value of .*
To get a subset, use a regex pattern.
mode:
type: periodic
role: arn:aws:iam::1234567890:role/CloudCustodian
schedule: "rate(1 day)"
filters:
- unused
- type: value
key: GroupName
op: regex
value: ".*wizard"
actions:
- delete
- type: notify
template: unused-sgroup-audit.html
slack_template: slack-unused-sgroup-audit
template_format: 'html'
priority_header: '5'
subject: 'Security Audit: Unused Security Groups'
to:
- <your-aws-verified-email-address>
- slack://#<your-channel-name>
owner_absent_contact:
- <your-aws-verified-email-address>
transport:
type: sqs
queue: https://sqs.us-east-1.amazonaws.com/1234567890/cloud-cloudcustodian