Skip to content

Commit

Permalink
adding travis ci
Browse files Browse the repository at this point in the history
  • Loading branch information
zricethezav committed Jun 28, 2022
1 parent efdc774 commit 1297b41
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/generate/config/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ func main() {
configRules = append(configRules, rules.SquareSpaceAccessToken())
configRules = append(configRules, rules.SumoLogicAccessID())
configRules = append(configRules, rules.SumoLogicAccessToken())
configRules = append(configRules, rules.TravisCIAccessToken())
configRules = append(configRules, rules.Twilio())
configRules = append(configRules, rules.TwitchAPIToken())
configRules = append(configRules, rules.TwitterAPIKey())
Expand Down
25 changes: 25 additions & 0 deletions cmd/generate/config/rules/travisci.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package rules

import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)

func TravisCIAccessToken() *config.Rule {
// define rule
r := config.Rule{
RuleID: "travisci-access-token",
Description: "Travis CI Access Token",
Regex: generateSemiGenericRegex([]string{"travis"}, alphaNumeric("22")),
SecretGroup: 1,
Keywords: []string{
"travis",
},
}

// validate
tps := []string{
generateSampleSecret("travis", secrets.NewSecret(alphaNumeric("22"))),
}
return validate(r, tps, nil)
}
9 changes: 9 additions & 0 deletions config/gitleaks.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,15 @@ keywords = [
"sumo",
]

[[rules]]
description = "Travis CI Access Token"
id = "travisci-access-token"
regex = '''(?i)(?:travis)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:=|\|\|:|<=|=>|:)(?:'|\"|\s|=|\x60){0,5}([a-z0-9]{22})(?:['|\"|\n|\r|\s|\x60]|$)'''
secretGroup = 1
keywords = [
"travis",
]

[[rules]]
description = "Twilio API Key"
id = "twilio-api-key"
Expand Down

0 comments on commit 1297b41

Please sign in to comment.