Skip to content

Instantly share code, notes, and snippets.

@mgla
Last active November 23, 2016 12:53
Show Gist options
  • Save mgla/661a5d419319f6b183414efd23078c8d to your computer and use it in GitHub Desktop.
Save mgla/661a5d419319f6b183414efd23078c8d to your computer and use it in GitHub Desktop.
Find AWS SNS subscription that can be cancelled without authentication.
AWS_PROFILE=aws-profile; for id in `aws --profile $AWS_PROFILE sns list-subscriptions | jq -r '.Subscriptions |.[] | .SubscriptionArn '`; do aws --profile $AWS_PROFILE sns get-subscription-attributes --subscription-arn $id | jq '.Attributes | select(.ConfirmationWasAuthenticated == "false") | { Endpoint: .Endpoint, ConfirmationWasAuthenticated: .ConfirmationWasAuthenticated, Protocol: .Protocol}'; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment