Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- public=0
- for snapshot in $(aws ec2 describe-snapshots --owner-ids 089941056973 | jq -r ".Snapshots[].SnapshotId")
- do
- permissions=$(aws ec2 describe-snapshot-attribute --attribute createVolumePermission --snapshot-id ${snapshot} | jq -r ".CreateVolumePermissions")
- if [[ "${permissions}" = "[]" ]]; then
- echo "\033[32m${snapshot} is private"
- else
- echo "\033[31m${snapshot} is NOT private\!"
- ((public++))
- fi
- echo
- echo "\033[31m${public} snapshots are not completely private and should have their permissions verified.\033[0m"
- done
- exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement