Skip to content

Commit 09242ce

Browse files
authored
Add new Looker client ID and client secret rules (gitleaks#1947)
1 parent c98e5e0 commit 09242ce

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed

cmd/generate/config/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ func main() {
153153
rules.LinkedinClientSecret(),
154154
rules.LobAPIToken(),
155155
rules.LobPubAPIToken(),
156+
rules.LookerClientID(),
157+
rules.LookerClientSecret(),
156158
rules.MailChimp(),
157159
rules.MailGunPubAPIToken(),
158160
rules.MailGunPrivateAPIToken(),
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package rules
2+
3+
import (
4+
"github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
5+
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
6+
"github.com/zricethezav/gitleaks/v8/config"
7+
)
8+
9+
func LookerClientID() *config.Rule {
10+
// define rule
11+
r := config.Rule{
12+
Description: "Found a Looker Client ID, risking unauthorized access to a Looker account and exposing sensitive data.",
13+
RuleID: "looker-client-id",
14+
Regex: utils.GenerateSemiGenericRegex([]string{"looker"}, utils.AlphaNumeric("20"), true),
15+
Keywords: []string{"looker"},
16+
}
17+
18+
// validate
19+
tps := utils.GenerateSampleSecrets("looker", secrets.NewSecret(utils.AlphaNumeric("20")))
20+
return utils.Validate(r, tps, nil)
21+
}
22+
23+
func LookerClientSecret() *config.Rule {
24+
// define rule
25+
r := config.Rule{
26+
Description: "Found a Looker Client Secret, risking unauthorized access to a Looker account and exposing sensitive data.",
27+
RuleID: "looker-client-secret",
28+
Regex: utils.GenerateSemiGenericRegex([]string{"looker"}, utils.AlphaNumeric("24"), true),
29+
Keywords: []string{"looker"},
30+
}
31+
32+
// validate
33+
tps := utils.GenerateSampleSecrets("looker", secrets.NewSecret(utils.AlphaNumeric("24")))
34+
return utils.Validate(r, tps, nil)
35+
}

config/gitleaks.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2529,6 +2529,18 @@ keywords = [
25292529
"_pub",
25302530
]
25312531

2532+
[[rules]]
2533+
id = "looker-client-id"
2534+
description = "Found a Looker Client ID, risking unauthorized access to a Looker account and exposing sensitive data."
2535+
regex = '''(?i)[\w.-]{0,50}?(?:looker)(?:[ \t\w.-]{0,20})[\s'"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'"\s=]{0,5}([a-z0-9]{20})(?:[\x60'"\s;]|\\[nr]|$)'''
2536+
keywords = ["looker"]
2537+
2538+
[[rules]]
2539+
id = "looker-client-secret"
2540+
description = "Found a Looker Client Secret, risking unauthorized access to a Looker account and exposing sensitive data."
2541+
regex = '''(?i)[\w.-]{0,50}?(?:looker)(?:[ \t\w.-]{0,20})[\s'"]{0,3}(?:=|>|:{1,3}=|\|\||:|=>|\?=|,)[\x60'"\s=]{0,5}([a-z0-9]{24})(?:[\x60'"\s;]|\\[nr]|$)'''
2542+
keywords = ["looker"]
2543+
25322544
[[rules]]
25332545
id = "mailchimp-api-key"
25342546
description = "Identified a Mailchimp API key, potentially compromising email marketing campaigns and subscriber data."

0 commit comments

Comments
 (0)