Generate comprehensive secret samples (#1484)

* feat(config): comprehensive samples

* refactor(config): use new generate func

* chore(config): comment unsupported cases

* feat(config): enable '?=' case

* feat(config): enable '+=' case

* feat(config): enable escaped json case

* feat(config): enable '<' (xml) case

* feat(config): enable multiline yaml case

* chore(config): add comment case

* feat(config): add php cases

* feat(config): add java case

* chore(config): address review comments

* fix(config): prevent matching '=='

* feat(config): add URL cases

* chore(config): revert regex changes
To be tackled in separate PRs.
This commit is contained in:
Richard Gomez authored and GitHub committed 2024-10-30 09:34:21 -05:00
1 parent d1d9054ef0
commit c11adc91ad
110 files changed
+436 -621

No files matched your search

+3 -12
View File
@@ -19,10 +19,7 @@ func YandexAWSAccessToken() *config.Rule {
}
// validate
tps := []string{
utils.GenerateSampleSecret("yandex",
secrets.NewSecret(`YC[a-zA-Z0-9_\-]{38}`)),
}
tps := utils.GenerateSampleSecrets("yandex", secrets.NewSecret(`YC[a-zA-Z0-9_\-]{38}`))
return utils.Validate(r, tps, nil)
}
@@ -40,10 +37,7 @@ func YandexAPIKey() *config.Rule {
}
// validate
tps := []string{
utils.GenerateSampleSecret("yandex",
secrets.NewSecret(`AQVN[A-Za-z0-9_\-]{35,38}`)),
}
tps := utils.GenerateSampleSecrets("yandex", secrets.NewSecret(`AQVN[A-Za-z0-9_\-]{35,38}`))
return utils.Validate(r, tps, nil)
}
@@ -61,9 +55,6 @@ func YandexAccessToken() *config.Rule {
}
// validate
tps := []string{
utils.GenerateSampleSecret("yandex",
secrets.NewSecret(`t1\.[A-Z0-9a-z_-]+[=]{0,2}\.[A-Z0-9a-z_-]{86}[=]{0,2}`)),
}
tps := utils.GenerateSampleSecrets("yandex", secrets.NewSecret(`t1\.[A-Z0-9a-z_-]+[=]{0,2}\.[A-Z0-9a-z_-]{86}[=]{0,2}`))
return utils.Validate(r, tps, nil)
}