mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-27 19:54:24 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
05c165deb2 |
No files matched your search
@@ -28,6 +28,8 @@ func main() {
|
||||
configRules = append(configRules, rules.AWS())
|
||||
configRules = append(configRules, rules.BitBucketClientID())
|
||||
configRules = append(configRules, rules.BitBucketClientSecret())
|
||||
configRules = append(configRules, rules.BittrexAccessKey())
|
||||
configRules = append(configRules, rules.BittrexSecretKey())
|
||||
configRules = append(configRules, rules.Beamer())
|
||||
configRules = append(configRules, rules.CoinbaseAccessToken())
|
||||
configRules = append(configRules, rules.Clojars())
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
func BittrexAccessKey() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Bittrex Access Key",
|
||||
RuleID: "bittrex-access-key",
|
||||
Regex: generateSemiGenericRegex([]string{"bittrex"}, alphaNumeric("32")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{"bittrex"},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("bittrex", secrets.NewSecret(alphaNumeric("32"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
|
||||
func BittrexSecretKey() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
Description: "Bittrex Secret Key",
|
||||
RuleID: "bittrex-secret-key",
|
||||
Regex: generateSemiGenericRegex([]string{"bittrex"}, alphaNumeric("32")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{"bittrex"},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("bittrex", secrets.NewSecret(alphaNumeric("32"))),
|
||||
}
|
||||
return validate(r, tps, nil)
|
||||
}
|
||||
@@ -8,8 +8,8 @@ import (
|
||||
func DatadogtokenAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "datadogtoken-access-token",
|
||||
Description: "Datadogtoken Access Token",
|
||||
RuleID: "datadog-access-token",
|
||||
Description: "Datadog Access Token",
|
||||
Regex: generateSemiGenericRegex([]string{"datadog"},
|
||||
alphaNumeric("40")),
|
||||
SecretGroup: 1,
|
||||
|
||||
@@ -8,8 +8,8 @@ import (
|
||||
func MattermostAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "mattermostpersonaltoken-access-token",
|
||||
Description: "Mattermostpersonaltoken Access Token",
|
||||
RuleID: "mattermost-access-token",
|
||||
Description: "Mattermost Access Token",
|
||||
Regex: generateSemiGenericRegex([]string{"mattermost"}, alphaNumeric("26")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
|
||||
@@ -9,7 +9,7 @@ func PlaidAccessID() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "plaid-client-id",
|
||||
Description: "Plaidkey Client ID",
|
||||
Description: "Plaid Client ID",
|
||||
Regex: generateSemiGenericRegex([]string{"plaid"}, alphaNumeric("24")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
|
||||
@@ -68,7 +68,6 @@ func validate(r config.Rule, truePositives []string, falsePositives []string) *c
|
||||
})
|
||||
for _, tp := range truePositives {
|
||||
if len(d.DetectString(tp)) != 1 {
|
||||
fmt.Println(r.Regex.String())
|
||||
log.Fatal().Msgf("Failed to validate (tp) %s %s", r.RuleID, tp)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,8 +8,8 @@ import (
|
||||
func SentryAccessToken() *config.Rule {
|
||||
// define rule
|
||||
r := config.Rule{
|
||||
RuleID: "sentrytoken-access-token",
|
||||
Description: "Sentrytoken Access Token",
|
||||
RuleID: "sentry-access-token",
|
||||
Description: "Sentry Access Token",
|
||||
Regex: generateSemiGenericRegex([]string{"sentry"}, hex("64")),
|
||||
SecretGroup: 1,
|
||||
Keywords: []string{
|
||||
|
||||
+25
-7
@@ -123,6 +123,24 @@ keywords = [
|
||||
"bitbucket",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Bittrex Access Key"
|
||||
id = "bittrex-access-key"
|
||||
regex = '''(?i)(?:bittrex)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{32})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"bittrex",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Bittrex Secret Key"
|
||||
id = "bittrex-secret-key"
|
||||
regex = '''(?i)(?:bittrex)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{32})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
"bittrex",
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Beamer API token"
|
||||
id = "beamer-api-token"
|
||||
@@ -185,8 +203,8 @@ keywords = [
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Datadogtoken Access Token"
|
||||
id = "datadogtoken-access-token"
|
||||
description = "Datadog Access Token"
|
||||
id = "datadog-access-token"
|
||||
regex = '''(?i)(?:datadog)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{40})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
@@ -635,8 +653,8 @@ keywords = [
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Mattermostpersonaltoken Access Token"
|
||||
id = "mattermostpersonaltoken-access-token"
|
||||
description = "Mattermost Access Token"
|
||||
id = "mattermost-access-token"
|
||||
regex = '''(?i)(?:mattermost)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{26})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
@@ -716,7 +734,7 @@ keywords = [
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Plaidkey Client ID"
|
||||
description = "Plaid Client ID"
|
||||
id = "plaid-client-id"
|
||||
regex = '''(?i)(?:plaid)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{24})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
@@ -849,8 +867,8 @@ keywords = [
|
||||
]
|
||||
|
||||
[[rules]]
|
||||
description = "Sentrytoken Access Token"
|
||||
id = "sentrytoken-access-token"
|
||||
description = "Sentry Access Token"
|
||||
id = "sentry-access-token"
|
||||
regex = '''(?i)(?:sentry)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-f0-9]{64})(?:['|\"|\n|\r|\s|\x60]|$)'''
|
||||
secretGroup = 1
|
||||
keywords = [
|
||||
|
||||
Reference in new issue
Block a user