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 <admiralawkbar@github.com>
This commit is contained in:
Tibo Delor 2021-09-10 04:03:41 +10:00 committed by GitHub
parent 658557447c
commit a3ad489783
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -203,7 +203,8 @@ DetectAWSStatesFIle() {
############################### ###############################
# check if file has resources # # 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 # Found it
return 0 return 0
fi fi