Merge branch 'master' of github.com:gitleaks/gitleaks into archive-handling

This commit is contained in:
Zach committed 2025-05-13 20:34:56 -05:00
commit 56e409d9f1
85 files changed
+2603 -1239

No files matched your search

@@ -70,7 +70,7 @@
# goes outside the bounds of the encoded value
id = 'overlapping'
description = 'Overlapping'
regex = '''secret=(decoded-secret-value)'''
regex = '''secret=(decoded-secret-value\w*)'''
tags = ['overlapping']
secretGroup = 1
+2 -2
View File
@@ -1,10 +1,10 @@
title = "gitleaks config"
[[rules]]
description = "Generic API Key"
id = "generic-api-key"
description = "Generic API Key"
regex = '''(?i)(?:key|api|token|secret|client|passwd|password|auth|access)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([0-9a-z\-_.=]{10,150})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
entropy = 3.5
keywords = [
"key","api","token","secret","client","passwd","password","auth","access",
]
]
+8 -9
View File
@@ -1,15 +1,20 @@
title = "gitleaks config"
[[rules]]
description = "Generic API Key"
id = "generic-api-key"
regex = '''(?i)((key|api|token|secret|password)[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([0-9a-zA-Z\-_=]{8,64})['\"]'''
description = "Generic API Key"
path = '''.py'''
entropy = 3.7
regex = '''(?i)((key|api|token|secret|password)[a-z0-9_ .\-,]{0,25})(=|>|:=|\|\|:|<=|=>|:).{0,5}['\"]([0-9a-zA-Z\-_=]{8,64})['\"]'''
secretGroup = 4
entropy = 3.7
[allowlist]
description = "global allow lists"
paths = [
'''gitleaks.toml''',
'''(.*?)(jpg|gif|doc|pdf|bin|svg|socket)$''',
'''(go.mod|go.sum)$'''
]
regexes = [
'''219-09-9999''',
'''078-05-1120''',
@@ -27,10 +32,4 @@ regexes = [
'''api\_key''',
'''apikey''',
'''api\-key''',
]
paths = [
'''gitleaks.toml''',
'''(.*?)(jpg|gif|doc|pdf|bin|svg|socket)$''',
'''(go.mod|go.sum)$'''
]
+2
View File
@@ -0,0 +1,2 @@
[[allowlists]]
@@ -0,0 +1,4 @@
[allowlist]
regexes = ['''123''']
[[allowlists]]
regexes = ['''456''']
@@ -0,0 +1,3 @@
[[allowlists]]
regexTarget = "mtach"
regexes = ['''456''']
@@ -0,0 +1,7 @@
[[rules]]
id = "github-app-token"
regex = '''(?:ghu|ghs)_[0-9a-zA-Z]{36}'''
[[allowlists]]
targetRules = ["github-app-token", "github-pat"]
regexes = ['''.*fake.*''']
@@ -1,5 +1,3 @@
title = "simple config with allowlist for aws"
[[rules]]
id = "example"
regex = '''example\d+'''
@@ -1,5 +1,3 @@
title = "simple config with allowlist for aws"
[[rules]]
id = "example"
regex = '''example\d+'''
@@ -1,5 +1,3 @@
title = "simple config with allowlist for aws"
[[rules]]
id = "example"
regex = '''example\d+'''
@@ -1,8 +1,10 @@
title = "gitleaks extended 1"
[extend]
path="../testdata/config/invalid/does_not_exist.toml"
[[rules]]
description = "AWS Access Key"
id = "aws-access-key"
regex = '''(?:A3T[A-Z0-9]|AKIA|ASIA|ABIA|ACCA)[A-Z0-9]{16}'''
tags = ["key", "AWS"]
[allowlist]
regexes = ['''AKIALALEMEL33243OLIA''']
File renamed without changes.
File renamed without changes.
File renamed without changes.
+6
View File
@@ -1,6 +1,12 @@
title = "gitleaks config"
# https://learnxinyminutes.com/docs/toml/ for toml reference
[[rules]]
description = "1Password Secret Key"
id = "1password-secret-key"
regex = '''A3-[A-Z0-9]{6}-(?:(?:[A-Z0-9]{11})|(?:[A-Z0-9]{6}-[A-Z0-9]{5}))-[A-Z0-9]{5}-[A-Z0-9]{5}-[A-Z0-9]{5}'''
tags = ["1Password"]
[[rules]]
description = "AWS Access Key"
id = "aws-access-key"
+10
View File
@@ -0,0 +1,10 @@
[[rules]]
id = "test"
regex = '''token = "(.+)"'''
[[allowlists]]
regexes = ["^changeit$"]
[[allowlists]]
condition = "AND"
paths = ["^node_modules/.*"]
stopwords = ["mock"]
@@ -0,0 +1,2 @@
[allowlist]
stopwords = ["0989c462-69c9-49fa-b7d2-30dc5c576a97"]
+2
View File
@@ -0,0 +1,2 @@
[allowlist]
regexes = ['''AKIALALEM.L33243OLIA''']
@@ -0,0 +1,20 @@
[[rules]]
id = "github-app-token"
regex = '''(?:ghu|ghs)_[0-9a-zA-Z]{36}'''
[[rules]]
id = "github-oauth"
regex = '''gho_[0-9a-zA-Z]{36}'''
[[rules]]
id = "github-pat"
regex = '''ghp_[0-9a-zA-Z]{36}'''
[[allowlists]]
regexes = ['''.*fake.*''']
[[allowlists]]
targetRules = ["github-app-token", "github-pat"]
paths = [
'''(?:^|/)@octokit/auth-token/README\.md$''',
]
File renamed without changes.
@@ -0,0 +1,11 @@
# https://github.com/gitleaks/gitleaks/issues/1844
[extend]
useDefault = true
[[rules]]
id = "generic-api-key"
[[rules.allowlists]]
description = "Exclude a specific file from generic-api-key rule"
paths = [
'''^path/to/your/problematic/file\.js$'''
]
@@ -1,5 +1,3 @@
title = "simple config with allowlist for aws"
[[rules]]
id = "example"
regex = '''example\d+'''
File renamed without changes.
File renamed without changes.
@@ -1,7 +1,5 @@
title = "gitleaks config"
[extend]
path="../testdata/config/extend_1.toml"
path="../testdata/config/valid/extend_base_1.toml"
[[rules]]
description = "AWS Secret Key"
@@ -1,7 +1,7 @@
title = "gitleaks extended 1"
[extend]
path="../testdata/config/extend_2.toml"
path="../testdata/config/valid/extend_base_2.toml"
[[rules]]
description = "AWS Access Key"
File renamed without changes.
File renamed without changes.
@@ -1,7 +1,7 @@
title = "gitleaks extended 3"
[extend]
path="../testdata/config/extend_rule_keywords_base.toml"
path="../testdata/config/valid/extend_rule_keywords_base.toml"
[[rules]]
id = "aws-secret-key-again-again"
@@ -1,7 +1,7 @@
title = "gitleaks extend disable"
[extend]
path = "../testdata/config/extend_disabled_base.toml"
path = "../testdata/config/valid/extend_disabled_base.toml"
disabledRules = [
'custom-rule1'
]
File renamed without changes.
@@ -1,7 +1,7 @@
title = "gitleaks extended 3"
[extend]
path="../testdata/config/extend_rule_allowlist_base.toml"
path="../testdata/config/valid/extend_rule_allowlist_base.toml"
[[rules]]
id = "aws-secret-key-again-again"
@@ -1,7 +1,7 @@
title = "gitleaks extended 3"
[extend]
path="../testdata/config/extend_rule_allowlist_base.toml"
path="../testdata/config/valid/extend_rule_allowlist_base.toml"
[[rules]]
id = "aws-secret-key-again-again"
@@ -1,7 +1,7 @@
title = "gitleaks extended 3"
[extend]
path="../testdata/config/extend_rule_keywords_base.toml"
path="../testdata/config/valid/extend_rule_keywords_base.toml"
[[rules]]
id = "aws-rule-that-is-not-in-base"
@@ -1,5 +1,5 @@
[extend]
path="../testdata/config/extend_3.toml"
path="../testdata/config/valid/extend_base_3.toml"
[[rules]]
id = "aws-secret-key-again-again"
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,5 +1,3 @@
title = "gitleaks config"
[[rules]]
id = "discord-api-key"
description = "Discord API key"
@@ -1,5 +1,3 @@
title = "gitleaks config"
[[rules]]
description = "Python Files"
id = "python-files-only"
@@ -1,8 +1,5 @@
title = "gitleaks config"
# https://learnxinyminutes.com/docs/toml/ for toml reference
[[rules]]
id = "pypi-upload-token"
description = "PyPI upload token"
regex = '''pypi-AgEIcHlwaS5vcmc[A-Za-z0-9\-_]{50,1000}'''
tags = ["key", "pypi"]
tags = ["key", "pypi"]