mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 05:04:22 +01:00
1 parent
d8cd93cabe
commit
3474c58c9e
58 files changed
+264
-337
No files matched your search
@@ -1,8 +1,7 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
|
||||
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
|
||||
"github.com/zricethezav/gitleaks/v8/config"
|
||||
)
|
||||
|
||||
@@ -11,13 +10,13 @@ func Databricks() *config.Rule {
|
||||
r := config.Rule{
|
||||
Description: "Databricks API token",
|
||||
RuleID: "databricks-api-token",
|
||||
Regex: regexp.MustCompile(`dapi[a-h0-9]{32}`),
|
||||
Regex: generateUniqueTokenRegex(`dapi[a-h0-9]{32}`),
|
||||
Keywords: []string{"dapi"},
|
||||
}
|
||||
|
||||
// validate
|
||||
tps := []string{
|
||||
generateSampleSecret("databricks", "dapi"+sampleHex32Token),
|
||||
generateSampleSecret("databricks", "dapi"+secrets.NewSecret(hex("32"))),
|
||||
}
|
||||
return validate(r, tps)
|
||||
}
|
||||
Reference in new issue
Block a user