From a3ad489783a32b7a8c1d3539cddefd2134834513 Mon Sep 17 00:00:00 2001 From: Tibo Delor Date: Fri, 10 Sep 2021 04:03:41 +1000 Subject: [PATCH] Match AWS States file using "States" JSON key (#1949) * Match AWS states file using "States" key Matching only on `"Resource": "arn` is too wide and will match also aws json policy files * Update detectFiles.sh * spacing Co-authored-by: Admiral Awkbar --- lib/functions/detectFiles.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/functions/detectFiles.sh b/lib/functions/detectFiles.sh index 7c97f173..813bfea1 100755 --- a/lib/functions/detectFiles.sh +++ b/lib/functions/detectFiles.sh @@ -203,7 +203,8 @@ DetectAWSStatesFIle() { ############################### # check if file has resources # ############################### - if grep -q '"Resource": *"arn"*' "${FILE}"; then + if grep -q '"Resource": *"arn' "${FILE}" && + grep -q '"States"' "${FILE}"; then # Found it return 0 fi