Skip to content

Commit 66708c2

Browse files
committed
chore(ci): filter false positives in secret scanner and refine rust token regex
1 parent e6d8ce7 commit 66708c2

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

.github/workflows/secret-scanner.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@ jobs:
4949
5050
findings =
5151
tracked_files
52+
|> Enum.reject(fn rel_path ->
53+
# Known safe test files/docs containing mock credentials
54+
rel_path in [
55+
"emergency-room/src/zig/capture_test.zig",
56+
"czech-file-knife/docs/DISTRIBUTED_FILESYSTEMS.md",
57+
"hybrid-automation-router/test/attestation/a2ml_test.exs",
58+
"hybrid-automation-router/test/data_plane/transformers/kubernetes_test.exs",
59+
"hybrid-automation-router/docs/HAR_SECURITY.md"
60+
]
61+
end)
5262
|> Enum.flat_map(fn rel_path ->
5363
abs_path = Path.join(repo, rel_path)
5464
@@ -277,7 +287,7 @@ jobs:
277287
PATTERNS=(
278288
'const.*SECRET.*=.*"'
279289
'const.*KEY.*=.*"[a-zA-Z0-9]{16,}"'
280-
'const.*TOKEN.*=.*"'
290+
'const.*TOKEN.*=.*"[a-zA-Z0-9\-_]{16,}"'
281291
'let.*api_key.*=.*"'
282292
'HMAC.*"[a-fA-F0-9]{32,}"'
283293
'password.*=.*"[^"]+"'

0 commit comments

Comments
 (0)