Skip to content

Commit b7d6658

Browse files
chore(pre-commit): add gitleaks hook and YAML-only sealed-secrets allowlist
1 parent 73c31e3 commit b7d6658

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-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: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,8 @@ repos:
3030
language: system
3131
entry: uv sync
3232
files: ^(uv\.lock|pyproject\.toml)$
33+
34+
- repo: https://github.com/gitleaks/gitleaks
35+
rev: v8.28.0
36+
hooks:
37+
- id: gitleaks

0 commit comments

Comments
 (0)