Skip to content

Instantly share code, notes, and snippets.

@marknca
Created June 18, 2019 13:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marknca/6d86318581497b7e3cf37fb7dcd83ca2 to your computer and use it in GitHub Desktop.
Save marknca/6d86318581497b7e3cf37fb7dcd83ca2 to your computer and use it in GitHub Desktop.
Security focused AWS CLI commands
aws acm list-certificates | jq '.CertificateSummaryList' | jq -r '.[].CertificateArn' | while read -r l; do echo "CERT: $l" && aws acm describe-certificate --certificate-arn $l | jq '.Certificate | .NotAfter' | xargs -I {} date -r {} && echo ""; done;
aws iam list-users | jq '.Users' | jq -r '.[].UserName' | xargs -n1 -I {} sh -c "echo USER: {} && aws iam list-attached-user-policies --user-name {} | jq '.AttachedPolicies' | jq -r '.[].PolicyName'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment