Files
gitleaks/cmd/generate/config/rules/ansible.go
T
Dimitri VasdekisandJesse Houwing 7911ac60d7 Initial set of Azure secrets for #539 (#1079)
* Initial secret set

* Covered off all rule types in comments

* Finished Azure and Ansible rules

* About to run go run main.go

* Fixed some rules, but tests need work

* Initial secret set for Azure

Needs work - many tests fail

* Fix remaining Azure secrets - but couldn't get XML to work

* Update .gitignore

Co-authored-by: Jesse Houwing <jesse.houwing@gmail.com>

---------

Co-authored-by: Jesse Houwing <jesse.houwing@gmail.com>
2023-06-15 07:23:08 -05:00

25 lines
662 B
Go

package rules
import (
"github.com/zricethezav/gitleaks/v8/cmd/generate/secrets"
"github.com/zricethezav/gitleaks/v8/config"
)
func AnsibleVaultToken() *config.Rule {
// define rule
r := config.Rule{
Description: "CSCAN0270 - Found Azure Subscription Token Cache.",
RuleID: "ansible-vault-token",
SecretGroup: 1,
Regex: generateUniqueTokenRegex(`ANSIBLE_VAULT;[0-9]\.[0-9];AES256;[\r\n]+[0-9]+`),
Keywords: []string{"ANSIBLE_VAULT;", "AES256;"},
}
// validate
tps := []string{
generateSampleSecret("ansible-vault-token",
"ANSIBLE_VAULT;1.0;AES256;\n" + secrets.NewSecret(numeric("32"))),
}
return validate(r, tps, nil)
}