Update to use grep -F to find secrets -- it prevents special characters in secrets being interpreted.
This commit is contained in:
@@ -31,7 +31,7 @@ fi
|
|||||||
IFS="
|
IFS="
|
||||||
"
|
"
|
||||||
for i in `ansible-vault decrypt --output - ${ANSIBLE_VAULT_FILE} | sed 's/\s\?-\?\s\?[A-Za-z0-9_]\+://' | grep -vE '\||password|^\s\?$|#|https://' | sed "s/^ \+['\"]\?//" | sed "s/[\"']\s\?//" | sort | uniq`; do
|
for i in `ansible-vault decrypt --output - ${ANSIBLE_VAULT_FILE} | sed 's/\s\?-\?\s\?[A-Za-z0-9_]\+://' | grep -vE '\||password|^\s\?$|#|https://' | sed "s/^ \+['\"]\?//" | sed "s/[\"']\s\?//" | sort | uniq`; do
|
||||||
grep -rl "${i}" . 2>/dev/null
|
grep -rlF "${i}" .
|
||||||
if [ $? -ne 1 ]; then
|
if [ $? -ne 1 ]; then
|
||||||
echo "A secret starting with $(echo "$i" | cut -c 1-7) was found in the files above."
|
echo "A secret starting with $(echo "$i" | cut -c 1-7) was found in the files above."
|
||||||
exit 1;
|
exit 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user