mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-29 12:44:22 +01:00
Generate comprehensive secret samples (#1484)
* feat(config): comprehensive samples * refactor(config): use new generate func * chore(config): comment unsupported cases * feat(config): enable '?=' case * feat(config): enable '+=' case * feat(config): enable escaped json case * feat(config): enable '<' (xml) case * feat(config): enable multiline yaml case * chore(config): add comment case * feat(config): add php cases * feat(config): add java case * chore(config): address review comments * fix(config): prevent matching '==' * feat(config): add URL cases * chore(config): revert regex changes To be tackled in separate PRs.
This commit is contained in:
1 parent
d1d9054ef0
commit
c11adc91ad
110 files changed
+436
-621
No files matched your search
+7
-13
@@ -2248,14 +2248,14 @@ keywords = ["hubspot"]
|
||||
[[rules]]
|
||||
id = "huggingface-access-token"
|
||||
description = "Discovered a Hugging Face Access token, which could lead to unauthorized access to AI models and sensitive data."
|
||||
regex = '''(?:^|[\\'"` >=:])(hf_[a-zA-Z]{34})(?:$|[\\'"` <])'''
|
||||
regex = '''\b(hf_(?i:[a-z]{34}))(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||
entropy = 2
|
||||
keywords = ["hf_"]
|
||||
|
||||
[[rules]]
|
||||
id = "huggingface-organization-api-token"
|
||||
description = "Uncovered a Hugging Face Organization API token, potentially compromising AI organization accounts and associated data."
|
||||
regex = '''(?:^|[\\'"` >=:\(,)])(api_org_[a-zA-Z]{34})(?:$|[\\'"` <\),])'''
|
||||
regex = '''\b(api_org_(?i:[a-z]{34}))(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||
entropy = 2
|
||||
keywords = ["api_org_"]
|
||||
|
||||
@@ -2449,7 +2449,7 @@ keywords = ["mattermost"]
|
||||
[[rules]]
|
||||
id = "messagebird-api-token"
|
||||
description = "Found a MessageBird API token, risking unauthorized access to communication platforms and message data."
|
||||
regex = '''(?i)[\w.-]{0,50}?(?:messagebird|message-bird|message_bird)(?:[ \t\w.-]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{25})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||
regex = '''(?i)[\w.-]{0,50}?(?:message[_-]?bird)(?:[ \t\w.-]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{25})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||
keywords = [
|
||||
"messagebird",
|
||||
"message-bird",
|
||||
@@ -2459,7 +2459,7 @@ keywords = [
|
||||
[[rules]]
|
||||
id = "messagebird-client-id"
|
||||
description = "Discovered a MessageBird client ID, potentially compromising API integrations and sensitive communication data."
|
||||
regex = '''(?i)[\w.-]{0,50}?(?:messagebird|message-bird|message_bird)(?:[ \t\w.-]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||
regex = '''(?i)[\w.-]{0,50}?(?:message[_-]?bird)(?:[ \t\w.-]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||
keywords = [
|
||||
"messagebird",
|
||||
"message-bird",
|
||||
@@ -2845,14 +2845,8 @@ keywords = ["hooks.slack.com"]
|
||||
[[rules]]
|
||||
id = "snyk-api-token"
|
||||
description = "Uncovered a Snyk API token, potentially compromising software vulnerability scanning and code security."
|
||||
regex = '''(?i)[\w.-]{0,50}?(?:snyk_token|snyk_key|snyk_api_token|snyk_api_key|snyk_oauth_token)(?:[ \t\w.-]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||
keywords = [
|
||||
"snyk_token",
|
||||
"snyk_key",
|
||||
"snyk_api_token",
|
||||
"snyk_api_key",
|
||||
"snyk_oauth_token",
|
||||
]
|
||||
regex = '''(?i)[\w.-]{0,50}?(?:snyk[_.-]?(?:(?:api|oauth)[_.-]?)?(?:key|token))(?:[ \t\w.-]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||
keywords = ["snyk"]
|
||||
|
||||
[[rules]]
|
||||
id = "square-access-token"
|
||||
@@ -2901,7 +2895,7 @@ keywords = ["sumo"]
|
||||
[[rules]]
|
||||
id = "telegram-bot-api-token"
|
||||
description = "Detected a Telegram Bot API Token, risking unauthorized bot operations and message interception on Telegram."
|
||||
regex = '''(?i:telegr(?:[0-9a-z\(-_\t .\\]{0,40})(?:[\s|']|[\s|"]){0,3})(?:=|\|\|:|<=|=>|:|\?=|\()(?:'|\"|\s|=|\x60){0,5}([0-9]{5,16}:A[a-z0-9_\-]{34})(?:['|\"|\n|\r|\s|\x60|;|\\]|$)'''
|
||||
regex = '''(?i)[\w.-]{0,50}?(?:telegr)(?:[ \t\w.-]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}([0-9]{5,16}:(?-i:A)[a-z0-9_\-]{34})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||
keywords = ["telegr"]
|
||||
|
||||
[[rules]]
|
||||
|
||||
Reference in new issue
Block a user