mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-29 12:44:22 +01:00
Add NewRelic insert key detection (#1417)
This commit is contained in:
1 parent
bb4424d454
commit
fe94ef9ca3
3 files changed
+32
No files matched your search
@@ -133,6 +133,7 @@ func main() {
|
|||||||
rules.NewRelicUserID(),
|
rules.NewRelicUserID(),
|
||||||
rules.NewRelicUserKey(),
|
rules.NewRelicUserKey(),
|
||||||
rules.NewRelicBrowserAPIKey(),
|
rules.NewRelicBrowserAPIKey(),
|
||||||
|
rules.NewRelicInsertKey(),
|
||||||
rules.NPM(),
|
rules.NPM(),
|
||||||
rules.NytimesAccessToken(),
|
rules.NytimesAccessToken(),
|
||||||
rules.OktaAccessToken(),
|
rules.OktaAccessToken(),
|
||||||
|
|||||||
@@ -75,3 +75,26 @@ func NewRelicBrowserAPIKey() *config.Rule {
|
|||||||
}
|
}
|
||||||
return validate(r, tps, nil)
|
return validate(r, tps, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewRelicInsertKey() *config.Rule {
|
||||||
|
// define rule
|
||||||
|
r := config.Rule{
|
||||||
|
RuleID: "new-relic-insert-key",
|
||||||
|
Description: "Discovered a New Relic insight insert key, compromising data injection into the platform.",
|
||||||
|
Regex: generateSemiGenericRegex([]string{
|
||||||
|
"new-relic",
|
||||||
|
"newrelic",
|
||||||
|
"new_relic",
|
||||||
|
}, `NRII-[a-z0-9-]{32}`, true),
|
||||||
|
|
||||||
|
Keywords: []string{
|
||||||
|
"NRII-",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate
|
||||||
|
tps := []string{
|
||||||
|
generateSampleSecret("new-relic", "NRII-"+secrets.NewSecret(hex("32"))),
|
||||||
|
}
|
||||||
|
return validate(r, tps, nil)
|
||||||
|
}
|
||||||
@@ -2367,6 +2367,14 @@ keywords = [
|
|||||||
"nrjs-",
|
"nrjs-",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[rules]]
|
||||||
|
id = "new-relic-insert-key"
|
||||||
|
description = "Discovered a New Relic insight insert key, compromising data injection into the platform."
|
||||||
|
regex = '''(?i)(?:new-relic|newrelic|new_relic)(?:[0-9a-z\-_\t .]{0,20})(?:[\s|']|[\s|"]){0,3}(?:=|>|:{1,3}=|\|\|:|<=|=>|:|\?=)(?:'|\"|\s|=|\x60){0,5}(NRII-[a-z0-9-]{32})(?:['|\"|\n|\r|\s|\x60|;]|$)'''
|
||||||
|
keywords = [
|
||||||
|
"nrii-",
|
||||||
|
]
|
||||||
|
|
||||||
[[rules]]
|
[[rules]]
|
||||||
id = "new-relic-user-api-id"
|
id = "new-relic-user-api-id"
|
||||||
description = "Found a New Relic user API ID, posing a risk to application monitoring services and data integrity."
|
description = "Found a New Relic user API ID, posing a risk to application monitoring services and data integrity."
|
||||||
|
|||||||
Reference in new issue
Block a user