feat(rules): Add 1Password secret key detection (#1834)

* Add `1password-secret-key` detection

* Document key details

* Update cmd/generate/config/rules/1password.go

Co-authored-by: Richard Gomez <32133502+rgmz@users.noreply.github.com>

* Generate new `.toml`

* Use `GenerateSampleSecrets` to test more scenarios

* Comment lowercase `fps`

* Decrease entropy

---------

Co-authored-by: Richard Gomez <32133502+rgmz@users.noreply.github.com>
This commit is contained in:
Jordan BradfordandRichard Gomez authored and GitHub committed 2025-04-30 09:30:58 -05:00
1 parent d1c77598da
commit 23cb69fba4
5 files changed
+77 -1

No files matched your search

+23
View File
@@ -68,6 +68,29 @@ func TestDetect(t *testing.T) {
}{
// General
"valid allow comment (1)": {
cfgName: "simple",
fragment: Fragment{
Raw: `Key: A3-ASWWYB-798JRY-LJVD4-23DC2-86TVM-H43EB`,
FilePath: "tmp.go",
},
expectedFindings: []report.Finding{
{
Description: "1Password Secret Key",
Secret: "A3-ASWWYB-798JRY-LJVD4-23DC2-86TVM-H43EB",
Match: "A3-ASWWYB-798JRY-LJVD4-23DC2-86TVM-H43EB",
Line: "Key: A3-ASWWYB-798JRY-LJVD4-23DC2-86TVM-H43EB",
File: "tmp.go",
RuleID: "1password-secret-key",
Tags: []string{"1Password"},
StartLine: 0,
EndLine: 0,
StartColumn: 6,
EndColumn: 45,
Entropy: 4.3153114,
},
},
},
{
cfgName: "simple",
fragment: Fragment{
Raw: `awsToken := \"AKIALALEMEL33243OKIA\ // gitleaks:allow"`,