Skip to content

Instantly share code, notes, and snippets.

View ChrisVo's full-sized avatar

Chris ChrisVo

  • Orange County, CA
View GitHub Profile
@ChrisVo
ChrisVo / aws.sg.unused
Created July 18, 2019 21:01 — forked from thibautsacreste/aws.sg.unused
Bash: list unused AWS security groups
#!/usr/bin/env bash
# lists all unused AWS security groups.
# a group is considered unused if it's not attached to any network interface.
# requires aws-cli and jq.
# all groups
aws ec2 describe-security-groups \
| jq --raw-output '.SecurityGroups[] | [.GroupName, .GroupId] | @tsv' \
| sort > /tmp/sg.all