mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-28 12:14:22 +01:00
* Enhance secret descriptions in gitleaks.toml * adjust the rule configuration descriptions * missing spaces in gitleaks.toml
50 lines
1.5 KiB
Go
50 lines
1.5 KiB
Go
package rules
|
|
|
|
import (
|
|
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
|
"github.com/zricethezav/gitleaks/v8/config"
|
|
)
|
|
|
|
func DropBoxAPISecret() *config.Rule {
|
|
// define rule
|
|
r := config.Rule{
|
|
Description: "Identified a Dropbox API secret, which could lead to unauthorized file access and data breaches in Dropbox storage.",
|
|
RuleID: "dropbox-api-token",
|
|
Regex: generateSemiGenericRegex([]string{"dropbox"}, alphaNumeric("15"), true),
|
|
|
|
Keywords: []string{"dropbox"},
|
|
}
|
|
|
|
// validate
|
|
tps := []string{
|
|
generateSampleSecret("dropbox", secrets.NewSecret(alphaNumeric("15"))),
|
|
}
|
|
return validate(r, tps, nil)
|
|
}
|
|
|
|
func DropBoxShortLivedAPIToken() *config.Rule {
|
|
// define rule
|
|
r := config.Rule{
|
|
RuleID: "dropbox-short-lived-api-token",
|
|
Description: "Discovered a Dropbox short-lived API token, posing a risk of temporary but potentially harmful data access and manipulation.",
|
|
Regex: generateSemiGenericRegex([]string{"dropbox"}, `sl\.[a-z0-9\-=_]{135}`, true),
|
|
Keywords: []string{"dropbox"},
|
|
}
|
|
|
|
// validate TODO
|
|
return &r
|
|
}
|
|
|
|
func DropBoxLongLivedAPIToken() *config.Rule {
|
|
// define rule
|
|
r := config.Rule{
|
|
RuleID: "dropbox-long-lived-api-token",
|
|
Description: "Found a Dropbox long-lived API token, risking prolonged unauthorized access to cloud storage and sensitive data.",
|
|
Regex: generateSemiGenericRegex([]string{"dropbox"}, `[a-z0-9]{11}(AAAAAAAAAA)[a-z0-9\-_=]{43}`, true),
|
|
Keywords: []string{"dropbox"},
|
|
}
|
|
|
|
// validate TODO
|
|
return &r
|
|
}
|