Fix Plaid, add Plaid access token (#903)

* adding airtable and adafruit

* Fix plaid, add plaid-access-token
This commit is contained in:
Zachary Rice authored and GitHub committed 2022-06-27 18:49:32 -05:00
1 parent 9cc19ec0f8
commit e78a22e19c
3 files changed
+37 -5

No files matched your search

+1
View File
@@ -103,6 +103,7 @@ func main() {
configRules = append(configRules, rules.NPM()) configRules = append(configRules, rules.NPM())
configRules = append(configRules, rules.NytimesAccessToken()) configRules = append(configRules, rules.NytimesAccessToken())
configRules = append(configRules, rules.PlaidAccessID()) configRules = append(configRules, rules.PlaidAccessID())
configRules = append(configRules, rules.PlaidSecretKey())
configRules = append(configRules, rules.PlaidAccessToken()) configRules = append(configRules, rules.PlaidAccessToken())
configRules = append(configRules, rules.PlanetScalePassword()) configRules = append(configRules, rules.PlanetScalePassword())
configRules = append(configRules, rules.PlanetScaleAPIToken()) configRules = append(configRules, rules.PlanetScaleAPIToken())
+25 -3
View File
@@ -1,6 +1,8 @@
package rules package rules
import ( import (
"fmt"
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets" "github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config" "github.com/zricethezav/gitleaks/v8/config"
) )
@@ -24,11 +26,11 @@ func PlaidAccessID() *config.Rule {
return validate(r, tps, nil) return validate(r, tps, nil)
} }
func PlaidAccessToken() *config.Rule { func PlaidSecretKey() *config.Rule {
// define rule // define rule
r := config.Rule{ r := config.Rule{
RuleID: "plaid-api-secret", RuleID: "plaid-secret-key",
Description: "Plaid API Secret", Description: "Plaid Secret key",
Regex: generateSemiGenericRegex([]string{"plaid"}, alphaNumeric("30")), Regex: generateSemiGenericRegex([]string{"plaid"}, alphaNumeric("30")),
SecretGroup: 1, SecretGroup: 1,
Keywords: []string{ Keywords: []string{
@@ -42,3 +44,23 @@ func PlaidAccessToken() *config.Rule {
} }
return validate(r, tps, nil) return validate(r, tps, nil)
} }
func PlaidAccessToken() *config.Rule {
// define rule
r := config.Rule{
RuleID: "plaid-api-token",
Description: "Plaid API Token",
Regex: generateSemiGenericRegex([]string{"plaid"},
fmt.Sprintf("access-(?:sandbox|development|production)-%s", hex8_4_4_4_12())),
SecretGroup: 1,
Keywords: []string{
"plaid",
},
}
// validate
tps := []string{
generateSampleSecret("plaid", secrets.NewSecret(fmt.Sprintf("access-(?:sandbox|development|production)-%s", hex8_4_4_4_12()))),
}
return validate(r, tps, nil)
}
+11 -2
View File
@@ -761,14 +761,23 @@ keywords = [
] ]
[[rules]] [[rules]]
description = "Plaid API Secret" description = "Plaid Secret key"
id = "plaid-api-secret" id = "plaid-secret-key"
regex = '''(?i)(?:plaid)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{30})(?:['|\"|\n|\r|\s|\x60]|$)''' regex = '''(?i)(?:plaid)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{30})(?:['|\"|\n|\r|\s|\x60]|$)'''
secretGroup = 1 secretGroup = 1
keywords = [ keywords = [
"plaid", "plaid",
] ]
[[rules]]
description = "Plaid API Token"
id = "plaid-api-token"
regex = '''(?i)(?:plaid)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}(access-(?:sandbox|development|production)-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:['|\"|\n|\r|\s|\x60]|$)'''
secretGroup = 1
keywords = [
"plaid",
]
[[rules]] [[rules]]
description = "PlanetScale password" description = "PlanetScale password"
id = "planetscale-password" id = "planetscale-password"