Skip to content

Instantly share code, notes, and snippets.

@antonioned
Created November 20, 2019 09:45
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 antonioned/36b77b9d8c2ae5282b45a86645dc34ab to your computer and use it in GitHub Desktop.
Save antonioned/36b77b9d8c2ae5282b45a86645dc34ab to your computer and use it in GitHub Desktop.
Script that scans ECS task definitions for a compromised AWS key. In order to run, it needs a definitions.txt file with ARNs of the task definitions that need scanning.
#!/bin/bash
while read d;
do
printf "\n\nName of task-definition: $d\n\n" >> ./task-definitions-results.txt
aws ecs describe-task-definition --task-definition $d --region us-west-2 | grep "AWS_KEY" >> ./task-definitions-results.txt
printf "\n\n------------------------------------------------\n\n" >> ./task-definitions-results.txt
done < definitions.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment