octopusdeploy.go 1.2 KB

1234567891011121314151617181920212223242526272829303132
  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 OctopusDeployApiKey() *config.Rule {
  8. // define rule
  9. r := config.Rule{
  10. RuleID: "octopus-deploy-api-key",
  11. Description: "Discovered a potential Octopus Deploy API key, risking application deployments and operational security.",
  12. Regex: utils.GenerateUniqueTokenRegex(`API-[A-Z0-9]{26}`, false),
  13. Entropy: 3,
  14. Keywords: []string{"api-"},
  15. }
  16. // validate
  17. tps := []string{
  18. utils.GenerateSampleSecret("octopus", secrets.NewSecret(`API-[A-Z0-9]{26}`)),
  19. `set apikey="API-ZNRMR7SL6L3ATMOIK7GKJDKLPY"`, // gitleaks:allow
  20. }
  21. fps := []string{
  22. // Invalid start
  23. `msgstr "GSSAPI-VIRHEKAPSELOINTIMERKKIJONO."`,
  24. `https://sonarcloud.io/api/project_badges/measure?project=Garden-Coin_API-CalculadoraDeInvestimentos&metric=alert_status`,
  25. `https://fog-ringer-f42.notion.site/API-BD80F56CDC1441E6BF6011AB6D852875`, // Invalid end
  26. `<iframe src="./archive/gifs/api-c99e353f761d318322c853c03e.gif"> </iframe>`, // Wrong case
  27. }
  28. return utils.Validate(r, tps, fps)
  29. }