Skip to content

Commit 551ad8f

Browse files
stranmaclaude
andcommitted
fix: add -- to grep in output-secrets-scanner private key check
The pattern '-----BEGIN ...' starts with dashes, which grep interprets as option flags. Adding '--' before the pattern signals end of options. Co-Authored-By: Claude Opus 4.6 <[email protected]>
1 parent 04b6fee commit 551ad8f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

.claude/hooks/output-secrets-scanner.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ if echo "$OUTPUT" | grep -qE 'eyJ[a-zA-Z0-9_-]*\.eyJ[a-zA-Z0-9_-]*\.[a-zA-Z0-9_-
6363
fi
6464

6565
# Private Key markers
66-
if echo "$OUTPUT" | grep -qE '-----BEGIN (RSA |EC |DSA |OPENSSH )?PRIVATE KEY-----'; then
66+
if echo "$OUTPUT" | grep -qE -- '-----BEGIN (RSA |EC |DSA |OPENSSH )?PRIVATE KEY-----'; then
6767
WARNINGS="${WARNINGS}[!] Private key material detected in output.\n"
6868
fi
6969

0 commit comments

Comments
 (0)