Skip to content

Commit 8ac4278

Browse files
committed
feat(gitleaks): adapt custom config
1 parent 6eb6eba commit 8ac4278

File tree

1 file changed

+1
-59
lines changed

1 file changed

+1
-59
lines changed

.gitleaks.toml

Lines changed: 1 addition & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,6 @@ title = "Custom Gitleaks Config for GC Secrets"
44
[extend]
55
useDefault = true
66

7-
# Rule for gc_client_id - catches any non-empty value
8-
[[rules]]
9-
id = "gc-client-id"
10-
description = "GC Client ID - any non-empty value"
11-
regex = '''gc_client_id['"]?\s*[:=]\s*['"]([^'"\s]+)['"]'''
12-
keywords = ["gc_client_id"]
13-
tags = ["gc", "client", "id"]
14-
15-
# Rule for gc_client_secret - catches any non-empty value
16-
[[rules]]
17-
id = "gc-client-secret"
18-
description = "GC Client Secret - any non-empty value"
19-
regex = '''gc_client_secret['"]?\s*[:=]\s*['"]([^'"\s]+)['"]'''
20-
keywords = ["gc_client_secret"]
21-
tags = ["gc", "client", "secret"]
22-
23-
# Alternative broader rules that catch various formatting styles
24-
25-
# Catches gc_client_id with various quote styles and spacing
26-
[[rules]]
27-
id = "gc-client-id-broad"
28-
description = "GC Client ID with flexible formatting"
29-
regex = '''gc_client_id\s*[=:]\s*["'`]?([^"'`\s,;}]+)["'`]?'''
30-
keywords = ["gc_client_id"]
31-
tags = ["gc", "client", "id"]
32-
33-
# Catches gc_client_secret with various quote styles and spacing
34-
[[rules]]
35-
id = "gc-client-secret-broad"
36-
description = "GC Client Secret with flexible formatting"
37-
regex = '''gc_client_secret\s*[=:]\s*["'`]?([^"'`\s,;}]+)["'`]?'''
38-
keywords = ["gc_client_secret"]
39-
tags = ["gc", "client", "secret"]
40-
41-
# Super aggressive rules that catch ANY line containing these keys with values
42-
437
# Any line with gc_client_id and a value
448
[[rules]]
459
id = "gc-client-id-any"
@@ -54,26 +18,4 @@ id = "gc-client-secret-any"
5418
description = "Any line with gc_client_secret and a value"
5519
regex = '''(?i)gc_client_secret.*[:=].*\S+'''
5620
keywords = ["gc_client_secret"]
57-
tags = ["gc", "client", "secret"]
58-
59-
# Allowlist section - you can add patterns to ignore false positives
60-
[allowlist]
61-
# Example: Ignore if the value is explicitly empty or a placeholder
62-
paths = [
63-
'''test/.*''', # Ignore test directories
64-
'''.*\.test\..*''', # Ignore test files
65-
]
66-
67-
# You can also allowlist specific commit patterns
68-
commits = [
69-
'''(?i)(test|testing|example)''', # Ignore commits with "test" in the message
70-
]
71-
72-
# Uncomment below to allowlist specific patterns (be careful with this!)
73-
# [[allowlist.regexes]]
74-
# regex = '''gc_client_id:\s*["']?["']?''' # Would ignore empty values
75-
# description = "Ignore empty gc_client_id"
76-
77-
# [[allowlist.regexes]]
78-
# regex = '''gc_client_secret:\s*["']?["']?''' # Would ignore empty values
79-
# description = "Ignore empty gc_client_secret"
21+
tags = ["gc", "client", "secret"]

0 commit comments

Comments
 (0)