From f00f95a6896f68deea5ab1059affaeeeb459bfb2 Mon Sep 17 00:00:00 2001 From: DarkFeather Date: Sun, 14 Dec 2025 11:42:22 -0600 Subject: [PATCH] Update to use `grep -F` to find secrets -- it prevents special characters in secrets being interpreted. --- precommit-hooks/find-passwords-in-files | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/precommit-hooks/find-passwords-in-files b/precommit-hooks/find-passwords-in-files index a2e8dd2..197397d 100644 --- a/precommit-hooks/find-passwords-in-files +++ b/precommit-hooks/find-passwords-in-files @@ -31,7 +31,7 @@ fi 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 - grep -rl "${i}" . 2>/dev/null + grep -rlF "${i}" . if [ $? -ne 1 ]; then echo "A secret starting with $(echo "$i" | cut -c 1-7) was found in the files above." exit 1;