Skip to content

Commit 4454985

Browse files
committed
Improve gitleaks go h1 hashes detection (#66)
Improve gitleaks go h1 hashes detection --------- Signed-off-by: Maksim Khimchenko <maksim.khimchenko@flant.com> (cherry picked from commit 149c6c0)
1 parent f05c72f commit 4454985

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

gitleaks/config/gitleaks.base.toml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Centralized Gitleaks configuration for all Deckhouse repositories
22
# This file is distributed via modules-actions/gitleaks action
3-
#
3+
#
44
# Repositories can extend this config by creating local .gitleaks.toml:
55
# [extend]
66
# useDefault = false
@@ -13,14 +13,16 @@ useDefault = true
1313
# Global allowlists
1414
[allowlist]
1515

16+
regexTarget = "line"
17+
1618
# === Safe files/directories ===
1719
# NOTE: Use exact paths, NOT glob patterns like **/go.mod
1820

1921
paths = [
2022
# Go dependencies - public hashes
2123
"go.mod",
2224
"go.sum",
23-
25+
2426
# Specific files with known false positives
2527
# "modules/101-cert-manager/docs/USAGE.md",
2628
# "modules/101-cert-manager/docs/USAGE_RU.md",
@@ -29,11 +31,8 @@ paths = [
2931
# === Safe patterns ===
3032
regexes = [
3133
# Go module checksums - always public
32-
'''h1:[A-Za-z0-9+/=]{40,}''',
33-
34-
# Public certificates (only ca.crt, NOT private keys!)
35-
'''data:\s*\n\s*ca\.crt:\s*[A-Za-z0-9+/=\s]+''',
36-
34+
'''h1:[A-Za-z0-9+/=]{12,}''',
35+
3736
# AWS Example values from official documentation - exact match
3837
'''AKIAIOSFODNN7EXAMPLE''',
3938
'''wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY''',

0 commit comments

Comments
 (0)