We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 959f92c commit 1f08155Copy full SHA for 1f08155
1 file changed
.git-hooks/pre-push
@@ -168,10 +168,10 @@ while read local_ref local_sha remote_ref remote_sha; do
168
ERRORS=$((ERRORS + 1))
169
fi
170
171
- # AWS keys.
172
- if echo "$file_text" | grep -iqE '(aws_access_key|aws_secret|AKIA[0-9A-Z]{16})'; then
+ # AWS keys (word-boundary match to avoid false positives in base64 data).
+ if echo "$file_text" | grep -iqE '(aws_access_key|aws_secret|\bAKIA[0-9A-Z]{16}\b)'; then
173
printf "${RED}✗ BLOCKED: Potential AWS credentials found in: %s${NC}\n" "$file"
174
- echo "$file_text" | grep -niE '(aws_access_key|aws_secret|AKIA[0-9A-Z]{16})' | head -3
+ echo "$file_text" | grep -niE '(aws_access_key|aws_secret|\bAKIA[0-9A-Z]{16}\b)' | head -3
175
176
177
0 commit comments