Skip to content

Commit abc2f37

Browse files
author
Wajid Zahoor
committed
Added gitleaks pre-commit and YAML-only sealed-secrets allowlist; comment 'paths' line in .gitleaks.toml to extend to all files
1 parent 9d544a5 commit abc2f37

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

.gitleaks.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[extend]
2+
useDefault = true
3+
4+
[[rules]]
5+
id = "generic-api-key"
6+
7+
# Pattern-only allowlist for long Ag… tokens in YAML
8+
[[rules.allowlists]]
9+
condition = "AND"
10+
regexes = [
11+
# Boundary-safe Ag… token without lookarounds (RE2-safe)
12+
'''(?:^|[^A-Za-z0-9+/=])(Ag[A-Za-z0-9+/]{500,}={0,2})(?:[^A-Za-z0-9+/=]|$)'''
13+
]
14+
# Limit to YAML only for now. Comment this out if you want it to apply everywhere.
15+
paths = ['''(?i).*\.ya?ml$''']

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,9 @@ repos:
2222
entry: ruff format --force-exclude
2323
types: [python]
2424
require_serial: true
25+
26+
27+
- repo: https://github.com/gitleaks/gitleaks
28+
rev: v8.28.0
29+
hooks:
30+
- id: gitleaks

0 commit comments

Comments
 (0)