|
|
@@ -24,3 +24,22 @@ func Heroku() *config.Rule {
|
|
|
)
|
|
|
return utils.Validate(r, tps, nil)
|
|
|
}
|
|
|
+
|
|
|
+func HerokuV2() *config.Rule {
|
|
|
+ // define rule
|
|
|
+ r := config.Rule{
|
|
|
+ Description: "Detected a Heroku API Key, potentially compromising cloud application deployments and operational security.",
|
|
|
+ RuleID: "heroku-api-key-v2",
|
|
|
+ Regex: utils.GenerateUniqueTokenRegex(`(HRKU-AA[0-9a-zA-Z_-]{58})`, false),
|
|
|
+ Entropy: 4,
|
|
|
+ Keywords: []string{"HRKU-AA"},
|
|
|
+ }
|
|
|
+
|
|
|
+ // validate
|
|
|
+ tps := utils.GenerateSampleSecrets("heroku", secrets.NewSecret(`\b(HRKU-AA[0-9a-zA-Z_-]{58})\b`))
|
|
|
+ tps = append(tps,
|
|
|
+ `const KEY = "HRKU-AAlQ1aVoHDujJ9QsDHdHlHO0hbzhoERRSO45ZQusSYHg_____w4_hLrAym_u""`,
|
|
|
+ `API_Key = "HRKU-AAy9Ppr_HD2pPuTyIiTYInO0hbzhoERRSO93ZQusSYHgaD7_WQ07FnF7L9FX"`,
|
|
|
+ )
|
|
|
+ return utils.Validate(r, tps, nil)
|
|
|
+}
|