Skip to content

Instantly share code, notes, and snippets.

@yannhowe
Last active January 26, 2023 08:17
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 yannhowe/6c3de48ccbbad8a0f8219e422f9a19db to your computer and use it in GitHub Desktop.
Save yannhowe/6c3de48ccbbad8a0f8219e422f9a19db to your computer and use it in GitHub Desktop.
Find out patch status of ECS tasks
#!/bin/bash
# 'Checking for string "/tmp/CrowdStrike/rootfs/entrypoint-ecs.sh" in entrypoint'
echo "taskDefinitionArn, patchStatus"
aws ecs list-task-definitions | jq --raw-output 'map(.[])| .[]' | while read -r i; do
echo -n "$i, "
if aws ecs describe-task-definition --task-definition "$i" | grep -q "/tmp/CrowdStrike/rootfs/entrypoint-ecs.sh"
then
echo patched
else
echo not patched
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment