databricks.go 704 B

1234567891011121314151617181920212223
  1. package rules
  2. import (
  3. "github.com/zricethezav/gitleaks/v8/cmd/generate/config/utils"
  4. "github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
  5. "github.com/zricethezav/gitleaks/v8/config"
  6. )
  7. func Databricks() *config.Rule {
  8. // define rule
  9. r := config.Rule{
  10. Description: "Uncovered a Databricks API token, which may compromise big data analytics platforms and sensitive data processing.",
  11. RuleID: "databricks-api-token",
  12. Regex: utils.GenerateUniqueTokenRegex(`dapi[a-h0-9]{32}`, true),
  13. Keywords: []string{"dapi"},
  14. }
  15. // validate
  16. tps := []string{
  17. utils.GenerateSampleSecret("databricks", "dapi"+secrets.NewSecret(utils.Hex("32"))),
  18. }
  19. return utils.Validate(r, tps, nil)
  20. }