From b7438011b4522b295660a6cd5b16af18a22787b6 Mon Sep 17 00:00:00 2001 From: Zachary Rice Date: Sat, 9 May 2020 11:21:17 -0400 Subject: [PATCH] Rm generic from default (#379) * fixing commit latest bug * remove generic rule from default to reduce false positives --- audit/audit_test.go | 2 + audit/util.go | 4 +- config/default.go | 5 - manager/manager.go | 2 +- options/options.go | 4 +- test_data/test_configs/generic.toml | 4 + test_data/test_local_owner_aws_leak.json | 279 +----------------- .../test_local_owner_aws_leak_depth_2.json | 182 ------------ .../test_local_repo_five_files_at_commit.json | 39 --- ...ocal_repo_five_files_at_latest_commit.json | 39 --- test_data/test_local_repo_one_aws_leak.json | 26 -- .../test_local_repo_one_aws_leak_commit.json | 26 -- ...t_local_repo_one_aws_leak_uncommitted.json | 13 - test_data/test_local_repo_two_leaks.json | 104 ------- ...test_local_repo_two_leaks_commit_from.json | 58 +--- ...est_local_repo_two_leaks_commit_range.json | 45 +-- .../test_local_repo_two_leaks_commit_to.json | 65 ---- 17 files changed, 20 insertions(+), 877 deletions(-) create mode 100644 test_data/test_configs/generic.toml diff --git a/audit/audit_test.go b/audit/audit_test.go index c6ba1a1e..00ab8c9c 100644 --- a/audit/audit_test.go +++ b/audit/audit_test.go @@ -270,6 +270,7 @@ func TestAudit(t *testing.T) { Report: "../test_data/test_local_repo_five_commit.json.got", Commit: "a4c9fb737d5552fd96fce5cc7eedb23353ba9ed0", ReportFormat: "json", + Config: "../test_data/test_configs/generic.toml", }, wantPath: "../test_data/test_local_repo_five_commit.json", }, @@ -280,6 +281,7 @@ func TestAudit(t *testing.T) { Report: "../test_data/test_local_repo_five_at_latest_commit.json.got", Commit: "latest", ReportFormat: "json", + Config: "../test_data/test_configs/generic.toml", }, wantPath: "../test_data/test_local_repo_five_at_latest_commit.json", }, diff --git a/audit/util.go b/audit/util.go index 43889afa..028ae49a 100644 --- a/audit/util.go +++ b/audit/util.go @@ -12,11 +12,11 @@ import ( "github.com/zricethezav/gitleaks/v4/config" "github.com/zricethezav/gitleaks/v4/manager" - log "github.com/sirupsen/logrus" "github.com/go-git/go-git/v5" "github.com/go-git/go-git/v5/plumbing" fdiff "github.com/go-git/go-git/v5/plumbing/format/diff" "github.com/go-git/go-git/v5/plumbing/object" + log "github.com/sirupsen/logrus" ) // Inspect patch accepts a patch, commit, and repo. If the patches contains files that are @@ -390,7 +390,7 @@ func isFilePathWhiteListed(filepath string, whitelist []config.Whitelist) bool { return false } -// RegexMatched matched an interface to a regular expression. The interface f can +// RegexMatched matched an interface to a regular expression. The interface f can // be a string type or go-git *object.File type. func RegexMatched(f interface{}, re *regexp.Regexp) bool { if re == nil { diff --git a/config/default.go b/config/default.go index a78ca260..fa9eec42 100644 --- a/config/default.go +++ b/config/default.go @@ -66,11 +66,6 @@ title = "gitleaks config" regex = '''-----BEGIN ((EC|PGP|DSA|RSA|OPENSSH) )?PRIVATE KEY( BLOCK)?-----''' tags = ["key", "AsymmetricPrivateKey"] -[[rules]] - description = "Generic Credential" - regex = '''(?i)(api_key|apikey|secret|password|pass|pw|key)(.{0,20})?[0-9a-zA-Z]{16,45}''' - tags = ["key", "API", "generic"] - [[rules]] description = "Google API key" regex = '''AIza[0-9A-Za-z\\-_]{35}''' diff --git a/manager/manager.go b/manager/manager.go index db4e093c..80001aa0 100644 --- a/manager/manager.go +++ b/manager/manager.go @@ -17,10 +17,10 @@ import ( "github.com/zricethezav/gitleaks/v4/config" "github.com/zricethezav/gitleaks/v4/options" + "github.com/go-git/go-git/v5" "github.com/hako/durafmt" "github.com/mattn/go-colorable" log "github.com/sirupsen/logrus" - "github.com/go-git/go-git/v5" ) const maxLineLen = 200 diff --git a/options/options.go b/options/options.go index 19223c2e..af5868c6 100644 --- a/options/options.go +++ b/options/options.go @@ -9,11 +9,11 @@ import ( "github.com/zricethezav/gitleaks/v4/version" - "github.com/jessevdk/go-flags" - log "github.com/sirupsen/logrus" "github.com/go-git/go-git/v5" "github.com/go-git/go-git/v5/plumbing/transport/http" "github.com/go-git/go-git/v5/plumbing/transport/ssh" + "github.com/jessevdk/go-flags" + log "github.com/sirupsen/logrus" ) // No leaks or early exit due to invalid options diff --git a/test_data/test_configs/generic.toml b/test_data/test_configs/generic.toml new file mode 100644 index 00000000..22884cd9 --- /dev/null +++ b/test_data/test_configs/generic.toml @@ -0,0 +1,4 @@ +[[rules]] + description = "Generic Credential" + regex = '''(?i)(api_key|apikey|secret|password|pass|pw|key)(.{0,20})?[0-9a-zA-Z]{16,45}''' + tags = ["key", "API", "generic"] \ No newline at end of file diff --git a/test_data/test_local_owner_aws_leak.json b/test_data/test_local_owner_aws_leak.json index fced2ace..69631205 100644 --- a/test_data/test_local_owner_aws_leak.json +++ b/test_data/test_local_owner_aws_leak.json @@ -12,32 +12,6 @@ "date": "2019-10-24T09:29:27-04:00", "tags": "key, AWS" }, - { - "line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',", - "offender": "key_id='AKIAIO5FODNN7EXAMPLE", - "commit": "6557c92612d3b35979bd426d429255b3bf9fab74", - "repo": "test_repo_1", - "rule": "Generic Credential", - "commitMessage": "commit 1 with secrets\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "server.test.py", - "date": "2019-10-24T09:29:27-04:00", - "tags": "key, API, generic" - }, - { - "line": " aws_secret_access_key='ABCDEF+c2L7yXeGvUyrPgYsDnWRRC1AYEXAMPLE'", - "offender": "secret_access_key='ABCDEF+c2L7yXeGvUyrPgYsDnWRRC1AYEXAMPLE", - "commit": "6557c92612d3b35979bd426d429255b3bf9fab74", - "repo": "test_repo_1", - "rule": "Generic Credential", - "commitMessage": "commit 1 with secrets\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "server.test.py", - "date": "2019-10-24T09:29:27-04:00", - "tags": "key, API, generic" - }, { "line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"", "offender": "AKIALALEMEL33243OLIB", @@ -51,32 +25,6 @@ "date": "2019-10-25T13:12:32-04:00", "tags": "key, AWS" }, - { - "line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"", - "offender": "KEY = \"AKIALALEMEL33243OLIBE", - "commit": "f61cd8587b7ac1d75a89a0c9af870a2f24c60263", - "repo": "test_repo_2", - "rule": "Generic Credential", - "commitMessage": "rm secrets again\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:12:32-04:00", - "tags": "key, API, generic" - }, - { - "line": " const AWSSECRET = \"99432bfewaf823ec3294e231\"", - "offender": "SECRET = \"99432bfewaf823ec3294e231", - "commit": "f61cd8587b7ac1d75a89a0c9af870a2f24c60263", - "repo": "test_repo_2", - "rule": "Generic Credential", - "commitMessage": "rm secrets again\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:12:32-04:00", - "tags": "key, API, generic" - }, { "line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"", "offender": "AKIALALEMEL33243OLIB", @@ -90,32 +38,6 @@ "date": "2019-10-25T13:12:08-04:00", "tags": "key, AWS" }, - { - "line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"", - "offender": "KEY = \"AKIALALEMEL33243OLIBE", - "commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba", - "repo": "test_repo_2", - "rule": "Generic Credential", - "commitMessage": "adding another one\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:12:08-04:00", - "tags": "key, API, generic" - }, - { - "line": " const AWSSECRET = \"99432bfewaf823ec3294e231\"", - "offender": "SECRET = \"99432bfewaf823ec3294e231", - "commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba", - "repo": "test_repo_2", - "rule": "Generic Credential", - "commitMessage": "adding another one\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:12:08-04:00", - "tags": "key, API, generic" - }, { "line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"", "offender": "AKIALALEMEL33243OLIA", @@ -131,45 +53,6 @@ }, { "line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"", - "offender": "secret: \"AKIALALEMEL33243OLIAE", - "commit": "996865bb912f3bc45898a370a13aadb315014b55", - "repo": "test_repo_2", - "rule": "Generic Credential", - "commitMessage": "committing pem\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:07:41-04:00", - "tags": "key, API, generic" - }, - { - "line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"", - "offender": "AKIALALEMEL33243OLIA", - "commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c", - "repo": "test_repo_2", - "rule": "AWS Manager ID", - "commitMessage": "wait this is actually adding an aws secret\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:01:27-04:00", - "tags": "key, AWS" - }, - { - "line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"", - "offender": "secret: \"AKIALALEMEL33243OLIAE", - "commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c", - "repo": "test_repo_2", - "rule": "Generic Credential", - "commitMessage": "wait this is actually adding an aws secret\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:01:27-04:00", - "tags": "key, API, generic" - }, - { - "line": "Here's an AWS secret: AKIALALEMEL33243OLIAE", "offender": "AKIALALEMEL33243OLIA", "commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c", "repo": "test_repo_2", @@ -183,16 +66,16 @@ }, { "line": "Here's an AWS secret: AKIALALEMEL33243OLIAE", - "offender": "secret: AKIALALEMEL33243OLIAE", + "offender": "AKIALALEMEL33243OLIA", "commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c", "repo": "test_repo_2", - "rule": "Generic Credential", + "rule": "AWS Manager ID", "commitMessage": "wait this is actually adding an aws secret\n", "author": "zach rice", "email": "zricer@protonmail.com", "file": "secrets.md", "date": "2019-10-25T13:01:27-04:00", - "tags": "key, API, generic" + "tags": "key, AWS" }, { "line": "\nHere's an AWS secret: AKIALALEMEL33243OLIAE", @@ -207,19 +90,6 @@ "date": "2019-10-25T12:58:39-04:00", "tags": "key, AWS" }, - { - "line": "\nHere's an AWS secret: AKIALALEMEL33243OLIAE", - "offender": "secret: AKIALALEMEL33243OLIAE", - "commit": "b10b3e2cb320a8c211fda94c4567299d37de7776", - "repo": "test_repo_2", - "rule": "Generic Credential", - "commitMessage": "adding aws key\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T12:58:39-04:00", - "tags": "key, API, generic" - }, { "line": "const AWSKEY = \"AKIALALEMEL33243OLIAE\"", "offender": "AKIALALEMEL33243OLIA", @@ -233,32 +103,6 @@ "date": "2019-10-25T13:54:26-04:00", "tags": "key, AWS" }, - { - "line": "const AWSKEY = \"AKIALALEMEL33243OLIAE\"", - "offender": "KEY = \"AKIALALEMEL33243OLIAE", - "commit": "cd5eb8bef855f73c46b97b4c088badffdc40ebe9", - "repo": "test_repo_3", - "rule": "Generic Credential", - "commitMessage": "rm secrets\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:54:26-04:00", - "tags": "key, API, generic" - }, - { - "line": "const AWSSECRET = \"99432bfewaf823ec3294e231\"", - "offender": "SECRET = \"99432bfewaf823ec3294e231", - "commit": "cd5eb8bef855f73c46b97b4c088badffdc40ebe9", - "repo": "test_repo_3", - "rule": "Generic Credential", - "commitMessage": "rm secrets\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:54:26-04:00", - "tags": "key, API, generic" - }, { "line": "const AWSKEY = \"AKIALALEMEL33243OLIAE\"", "offender": "AKIALALEMEL33243OLIA", @@ -272,32 +116,6 @@ "date": "2019-10-25T13:54:08-04:00", "tags": "key, AWS" }, - { - "line": "const AWSKEY = \"AKIALALEMEL33243OLIAE\"", - "offender": "KEY = \"AKIALALEMEL33243OLIAE", - "commit": "84ac4e80d4dbf2c968b64e9d4005f5079795bb81", - "repo": "test_repo_3", - "rule": "Generic Credential", - "commitMessage": "more secrets\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:54:08-04:00", - "tags": "key, API, generic" - }, - { - "line": "const AWSSECRET = \"99432bfewaf823ec3294e231\"", - "offender": "SECRET = \"99432bfewaf823ec3294e231", - "commit": "84ac4e80d4dbf2c968b64e9d4005f5079795bb81", - "repo": "test_repo_3", - "rule": "Generic Credential", - "commitMessage": "more secrets\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:54:08-04:00", - "tags": "key, API, generic" - }, { "line": "AWS secret: \"AKIALALEMEL33243OLIAE\"", "offender": "AKIALALEMEL33243OLIA", @@ -311,19 +129,6 @@ "date": "2019-10-25T13:36:22-04:00", "tags": "key, AWS" }, - { - "line": "AWS secret: \"AKIALALEMEL33243OLIAE\"", - "offender": "secret: \"AKIALALEMEL33243OLIAE", - "commit": "64cfcee9aad1c84581631636bfc54f2050718d1a", - "repo": "test_repo_3", - "rule": "Generic Credential", - "commitMessage": "rm secrets\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:36:22-04:00", - "tags": "key, API, generic" - }, { "line": "AWS secret: \"AKIALALEMEL33243OLIAE\"", "offender": "AKIALALEMEL33243OLIA", @@ -337,32 +142,6 @@ "date": "2019-10-25T13:35:03-04:00", "tags": "key, AWS" }, - { - "line": "AWS secret: \"AKIALALEMEL33243OLIAE\"", - "offender": "secret: \"AKIALALEMEL33243OLIAE", - "commit": "deea550dd6c7acaf0e59432600593533984a2125", - "repo": "test_repo_3", - "rule": "Generic Credential", - "commitMessage": "dev branch\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:35:03-04:00", - "tags": "key, API, generic" - }, - { - "line": "\nmore_secrets = '99432bfewaf823ec3294e231'", - "offender": "secrets = '99432bfewaf823ec3294e231", - "commit": "a4c9fb737d5552fd96fce5cc7eedb23353ba9ed0", - "repo": "test_repo_5", - "rule": "Generic Credential", - "commitMessage": "even more secrets\n", - "author": "Zach Rice", - "email": "zrice@gitlab.com", - "file": "secrets.py", - "date": "2020-02-01T10:30:22-05:00", - "tags": "key, API, generic" - }, { "line": "\naws_access_key_id='AKIAIO5FODNN7EXAMPL2'", "offender": "AKIAIO5FODNN7EXAMPL2", @@ -376,19 +155,6 @@ "date": "2020-02-01T10:08:04-05:00", "tags": "key, AWS" }, - { - "line": "\naws_access_key_id='AKIAIO5FODNN7EXAMPL2'", - "offender": "key_id='AKIAIO5FODNN7EXAMPL2", - "commit": "ca71fcdeda15f25f0cc661d90e8785c255925c27", - "repo": "test_repo_5", - "rule": "Generic Credential", - "commitMessage": "introduce more secrets\n", - "author": "Zach Rice", - "email": "zrice@gitlab.com", - "file": "secrets.py", - "date": "2020-02-01T10:08:04-05:00", - "tags": "key, API, generic" - }, { "line": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE'", "offender": "AKIAIO5FODNN7EXAMPLE", @@ -402,32 +168,6 @@ "date": "2020-02-01T10:07:34-05:00", "tags": "key, AWS" }, - { - "line": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE'", - "offender": "key_id='AKIAIO5FODNN7EXAMPLE", - "commit": "1f2a4abc47dabf991e6af6f9770867ce0ac1f360", - "repo": "test_repo_5", - "rule": "Generic Credential", - "commitMessage": "introduce secrets\n", - "author": "Zach Rice", - "email": "zrice@gitlab.com", - "file": "secrets.py", - "date": "2020-02-01T10:07:34-05:00", - "tags": "key, API, generic" - }, - { - "line": "db_password: verySecretProductionPassword", - "offender": "password: verySecretProductionPassword", - "commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247", - "repo": "test_repo_6", - "rule": "Generic Credential", - "commitMessage": "Adding some secrets in config folder\n\n", - "author": "Noel Algora", - "email": "noealgigu@gmail.com", - "file": "application.yaml", - "date": "2020-02-24T14:13:15-05:00", - "tags": "key, API, generic" - }, { "line": "aws_access_key_id=AKIAIO5FODNN7EXAMPLE", "offender": "AKIAIO5FODNN7EXAMPLE", @@ -440,18 +180,5 @@ "file": "config/application.properties", "date": "2020-02-24T14:13:15-05:00", "tags": "key, AWS" - }, - { - "line": "aws_access_key_id=AKIAIO5FODNN7EXAMPLE", - "offender": "key_id=AKIAIO5FODNN7EXAMPLE", - "commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247", - "repo": "test_repo_6", - "rule": "Generic Credential", - "commitMessage": "Adding some secrets in config folder\n\n", - "author": "Noel Algora", - "email": "noealgigu@gmail.com", - "file": "config/application.properties", - "date": "2020-02-24T14:13:15-05:00", - "tags": "key, API, generic" } ] diff --git a/test_data/test_local_owner_aws_leak_depth_2.json b/test_data/test_local_owner_aws_leak_depth_2.json index fe79c778..fdc33650 100644 --- a/test_data/test_local_owner_aws_leak_depth_2.json +++ b/test_data/test_local_owner_aws_leak_depth_2.json @@ -12,32 +12,6 @@ "date": "2019-10-24T09:29:27-04:00", "tags": "key, AWS" }, - { - "line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',", - "offender": "key_id='AKIAIO5FODNN7EXAMPLE", - "commit": "6557c92612d3b35979bd426d429255b3bf9fab74", - "repo": "test_repo_1", - "rule": "Generic Credential", - "commitMessage": "commit 1 with secrets\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "server.test.py", - "date": "2019-10-24T09:29:27-04:00", - "tags": "key, API, generic" - }, - { - "line": " aws_secret_access_key='ABCDEF+c2L7yXeGvUyrPgYsDnWRRC1AYEXAMPLE'", - "offender": "secret_access_key='ABCDEF+c2L7yXeGvUyrPgYsDnWRRC1AYEXAMPLE", - "commit": "6557c92612d3b35979bd426d429255b3bf9fab74", - "repo": "test_repo_1", - "rule": "Generic Credential", - "commitMessage": "commit 1 with secrets\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "server.test.py", - "date": "2019-10-24T09:29:27-04:00", - "tags": "key, API, generic" - }, { "line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"", "offender": "AKIALALEMEL33243OLIB", @@ -51,32 +25,6 @@ "date": "2019-10-25T13:12:32-04:00", "tags": "key, AWS" }, - { - "line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"", - "offender": "KEY = \"AKIALALEMEL33243OLIBE", - "commit": "f61cd8587b7ac1d75a89a0c9af870a2f24c60263", - "repo": "test_repo_2", - "rule": "Generic Credential", - "commitMessage": "rm secrets again\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:12:32-04:00", - "tags": "key, API, generic" - }, - { - "line": " const AWSSECRET = \"99432bfewaf823ec3294e231\"", - "offender": "SECRET = \"99432bfewaf823ec3294e231", - "commit": "f61cd8587b7ac1d75a89a0c9af870a2f24c60263", - "repo": "test_repo_2", - "rule": "Generic Credential", - "commitMessage": "rm secrets again\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:12:32-04:00", - "tags": "key, API, generic" - }, { "line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"", "offender": "AKIALALEMEL33243OLIB", @@ -90,32 +38,6 @@ "date": "2019-10-25T13:12:08-04:00", "tags": "key, AWS" }, - { - "line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"", - "offender": "KEY = \"AKIALALEMEL33243OLIBE", - "commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba", - "repo": "test_repo_2", - "rule": "Generic Credential", - "commitMessage": "adding another one\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:12:08-04:00", - "tags": "key, API, generic" - }, - { - "line": " const AWSSECRET = \"99432bfewaf823ec3294e231\"", - "offender": "SECRET = \"99432bfewaf823ec3294e231", - "commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba", - "repo": "test_repo_2", - "rule": "Generic Credential", - "commitMessage": "adding another one\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:12:08-04:00", - "tags": "key, API, generic" - }, { "line": "const AWSKEY = \"AKIALALEMEL33243OLIAE\"", "offender": "AKIALALEMEL33243OLIA", @@ -129,32 +51,6 @@ "date": "2019-10-25T13:54:26-04:00", "tags": "key, AWS" }, - { - "line": "const AWSKEY = \"AKIALALEMEL33243OLIAE\"", - "offender": "KEY = \"AKIALALEMEL33243OLIAE", - "commit": "cd5eb8bef855f73c46b97b4c088badffdc40ebe9", - "repo": "test_repo_3", - "rule": "Generic Credential", - "commitMessage": "rm secrets\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:54:26-04:00", - "tags": "key, API, generic" - }, - { - "line": "const AWSSECRET = \"99432bfewaf823ec3294e231\"", - "offender": "SECRET = \"99432bfewaf823ec3294e231", - "commit": "cd5eb8bef855f73c46b97b4c088badffdc40ebe9", - "repo": "test_repo_3", - "rule": "Generic Credential", - "commitMessage": "rm secrets\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:54:26-04:00", - "tags": "key, API, generic" - }, { "line": "const AWSKEY = \"AKIALALEMEL33243OLIAE\"", "offender": "AKIALALEMEL33243OLIA", @@ -168,45 +64,6 @@ "date": "2019-10-25T13:54:08-04:00", "tags": "key, AWS" }, - { - "line": "const AWSKEY = \"AKIALALEMEL33243OLIAE\"", - "offender": "KEY = \"AKIALALEMEL33243OLIAE", - "commit": "84ac4e80d4dbf2c968b64e9d4005f5079795bb81", - "repo": "test_repo_3", - "rule": "Generic Credential", - "commitMessage": "more secrets\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:54:08-04:00", - "tags": "key, API, generic" - }, - { - "line": "const AWSSECRET = \"99432bfewaf823ec3294e231\"", - "offender": "SECRET = \"99432bfewaf823ec3294e231", - "commit": "84ac4e80d4dbf2c968b64e9d4005f5079795bb81", - "repo": "test_repo_3", - "rule": "Generic Credential", - "commitMessage": "more secrets\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:54:08-04:00", - "tags": "key, API, generic" - }, - { - "line": "\nmore_secrets = '99432bfewaf823ec3294e231'", - "offender": "secrets = '99432bfewaf823ec3294e231", - "commit": "a4c9fb737d5552fd96fce5cc7eedb23353ba9ed0", - "repo": "test_repo_5", - "rule": "Generic Credential", - "commitMessage": "even more secrets\n", - "author": "Zach Rice", - "email": "zrice@gitlab.com", - "file": "secrets.py", - "date": "2020-02-01T10:30:22-05:00", - "tags": "key, API, generic" - }, { "line": "\naws_access_key_id='AKIAIO5FODNN7EXAMPL2'", "offender": "AKIAIO5FODNN7EXAMPL2", @@ -220,32 +77,6 @@ "date": "2020-02-01T10:08:04-05:00", "tags": "key, AWS" }, - { - "line": "\naws_access_key_id='AKIAIO5FODNN7EXAMPL2'", - "offender": "key_id='AKIAIO5FODNN7EXAMPL2", - "commit": "ca71fcdeda15f25f0cc661d90e8785c255925c27", - "repo": "test_repo_5", - "rule": "Generic Credential", - "commitMessage": "introduce more secrets\n", - "author": "Zach Rice", - "email": "zrice@gitlab.com", - "file": "secrets.py", - "date": "2020-02-01T10:08:04-05:00", - "tags": "key, API, generic" - }, - { - "line": "db_password: verySecretProductionPassword", - "offender": "password: verySecretProductionPassword", - "commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247", - "repo": "test_repo_6", - "rule": "Generic Credential", - "commitMessage": "Adding some secrets in config folder\n\n", - "author": "Noel Algora", - "email": "noealgigu@gmail.com", - "file": "application.yaml", - "date": "2020-02-24T14:13:15-05:00", - "tags": "key, API, generic" - }, { "line": "aws_access_key_id=AKIAIO5FODNN7EXAMPLE", "offender": "AKIAIO5FODNN7EXAMPLE", @@ -258,18 +89,5 @@ "file": "config/application.properties", "date": "2020-02-24T14:13:15-05:00", "tags": "key, AWS" - }, - { - "line": "aws_access_key_id=AKIAIO5FODNN7EXAMPLE", - "offender": "key_id=AKIAIO5FODNN7EXAMPLE", - "commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247", - "repo": "test_repo_6", - "rule": "Generic Credential", - "commitMessage": "Adding some secrets in config folder\n\n", - "author": "Noel Algora", - "email": "noealgigu@gmail.com", - "file": "config/application.properties", - "date": "2020-02-24T14:13:15-05:00", - "tags": "key, API, generic" } ] diff --git a/test_data/test_local_repo_five_files_at_commit.json b/test_data/test_local_repo_five_files_at_commit.json index 1ec7fd6c..a0b3313e 100644 --- a/test_data/test_local_repo_five_files_at_commit.json +++ b/test_data/test_local_repo_five_files_at_commit.json @@ -24,44 +24,5 @@ "file": "secrets.py", "date": "2020-02-01T10:30:22-05:00", "tags": "key, AWS" - }, - { - "line": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE'", - "offender": "key_id='AKIAIO5FODNN7EXAMPLE", - "commit": "a4c9fb737d5552fd96fce5cc7eedb23353ba9ed0", - "repo": "test_repo_5", - "rule": "Generic Credential", - "commitMessage": "even more secrets\n", - "author": "Zach Rice", - "email": "zrice@gitlab.com", - "file": "secrets.py", - "date": "2020-02-01T10:30:22-05:00", - "tags": "key, API, generic" - }, - { - "line": "aws_access_key_id='AKIAIO5FODNN7EXAMPL2'", - "offender": "key_id='AKIAIO5FODNN7EXAMPL2", - "commit": "a4c9fb737d5552fd96fce5cc7eedb23353ba9ed0", - "repo": "test_repo_5", - "rule": "Generic Credential", - "commitMessage": "even more secrets\n", - "author": "Zach Rice", - "email": "zrice@gitlab.com", - "file": "secrets.py", - "date": "2020-02-01T10:30:22-05:00", - "tags": "key, API, generic" - }, - { - "line": "more_secrets = '99432bfewaf823ec3294e231'", - "offender": "secrets = '99432bfewaf823ec3294e231", - "commit": "a4c9fb737d5552fd96fce5cc7eedb23353ba9ed0", - "repo": "test_repo_5", - "rule": "Generic Credential", - "commitMessage": "even more secrets\n", - "author": "Zach Rice", - "email": "zrice@gitlab.com", - "file": "secrets.py", - "date": "2020-02-01T10:30:22-05:00", - "tags": "key, API, generic" } ] diff --git a/test_data/test_local_repo_five_files_at_latest_commit.json b/test_data/test_local_repo_five_files_at_latest_commit.json index 1ec7fd6c..a0b3313e 100644 --- a/test_data/test_local_repo_five_files_at_latest_commit.json +++ b/test_data/test_local_repo_five_files_at_latest_commit.json @@ -24,44 +24,5 @@ "file": "secrets.py", "date": "2020-02-01T10:30:22-05:00", "tags": "key, AWS" - }, - { - "line": "aws_access_key_id='AKIAIO5FODNN7EXAMPLE'", - "offender": "key_id='AKIAIO5FODNN7EXAMPLE", - "commit": "a4c9fb737d5552fd96fce5cc7eedb23353ba9ed0", - "repo": "test_repo_5", - "rule": "Generic Credential", - "commitMessage": "even more secrets\n", - "author": "Zach Rice", - "email": "zrice@gitlab.com", - "file": "secrets.py", - "date": "2020-02-01T10:30:22-05:00", - "tags": "key, API, generic" - }, - { - "line": "aws_access_key_id='AKIAIO5FODNN7EXAMPL2'", - "offender": "key_id='AKIAIO5FODNN7EXAMPL2", - "commit": "a4c9fb737d5552fd96fce5cc7eedb23353ba9ed0", - "repo": "test_repo_5", - "rule": "Generic Credential", - "commitMessage": "even more secrets\n", - "author": "Zach Rice", - "email": "zrice@gitlab.com", - "file": "secrets.py", - "date": "2020-02-01T10:30:22-05:00", - "tags": "key, API, generic" - }, - { - "line": "more_secrets = '99432bfewaf823ec3294e231'", - "offender": "secrets = '99432bfewaf823ec3294e231", - "commit": "a4c9fb737d5552fd96fce5cc7eedb23353ba9ed0", - "repo": "test_repo_5", - "rule": "Generic Credential", - "commitMessage": "even more secrets\n", - "author": "Zach Rice", - "email": "zrice@gitlab.com", - "file": "secrets.py", - "date": "2020-02-01T10:30:22-05:00", - "tags": "key, API, generic" } ] diff --git a/test_data/test_local_repo_one_aws_leak.json b/test_data/test_local_repo_one_aws_leak.json index a189e2e4..7f869f1e 100644 --- a/test_data/test_local_repo_one_aws_leak.json +++ b/test_data/test_local_repo_one_aws_leak.json @@ -11,31 +11,5 @@ "file": "server.test.py", "date": "2019-10-24T09:29:27-04:00", "tags": "key, AWS" - }, - { - "line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',", - "offender": "key_id='AKIAIO5FODNN7EXAMPLE", - "commit": "6557c92612d3b35979bd426d429255b3bf9fab74", - "repo": "test_repo_1", - "rule": "Generic Credential", - "commitMessage": "commit 1 with secrets\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "server.test.py", - "date": "2019-10-24T09:29:27-04:00", - "tags": "key, API, generic" - }, - { - "line": " aws_secret_access_key='ABCDEF+c2L7yXeGvUyrPgYsDnWRRC1AYEXAMPLE'", - "offender": "secret_access_key='ABCDEF+c2L7yXeGvUyrPgYsDnWRRC1AYEXAMPLE", - "commit": "6557c92612d3b35979bd426d429255b3bf9fab74", - "repo": "test_repo_1", - "rule": "Generic Credential", - "commitMessage": "commit 1 with secrets\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "server.test.py", - "date": "2019-10-24T09:29:27-04:00", - "tags": "key, API, generic" } ] diff --git a/test_data/test_local_repo_one_aws_leak_commit.json b/test_data/test_local_repo_one_aws_leak_commit.json index a189e2e4..7f869f1e 100644 --- a/test_data/test_local_repo_one_aws_leak_commit.json +++ b/test_data/test_local_repo_one_aws_leak_commit.json @@ -11,31 +11,5 @@ "file": "server.test.py", "date": "2019-10-24T09:29:27-04:00", "tags": "key, AWS" - }, - { - "line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',", - "offender": "key_id='AKIAIO5FODNN7EXAMPLE", - "commit": "6557c92612d3b35979bd426d429255b3bf9fab74", - "repo": "test_repo_1", - "rule": "Generic Credential", - "commitMessage": "commit 1 with secrets\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "server.test.py", - "date": "2019-10-24T09:29:27-04:00", - "tags": "key, API, generic" - }, - { - "line": " aws_secret_access_key='ABCDEF+c2L7yXeGvUyrPgYsDnWRRC1AYEXAMPLE'", - "offender": "secret_access_key='ABCDEF+c2L7yXeGvUyrPgYsDnWRRC1AYEXAMPLE", - "commit": "6557c92612d3b35979bd426d429255b3bf9fab74", - "repo": "test_repo_1", - "rule": "Generic Credential", - "commitMessage": "commit 1 with secrets\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "server.test.py", - "date": "2019-10-24T09:29:27-04:00", - "tags": "key, API, generic" } ] diff --git a/test_data/test_local_repo_one_aws_leak_uncommitted.json b/test_data/test_local_repo_one_aws_leak_uncommitted.json index b7e8524d..c624672e 100644 --- a/test_data/test_local_repo_one_aws_leak_uncommitted.json +++ b/test_data/test_local_repo_one_aws_leak_uncommitted.json @@ -11,18 +11,5 @@ "file": "server.test.py", "date": "1970-01-01T00:00:00Z", "tags": "key, AWS" - }, - { - "line": " aws_access_key_id='AKIAIO5FODNN7DXAMPLE'", - "offender": "key_id='AKIAIO5FODNN7DXAMPLE", - "commit": "0000000000000000000000000000000000000000", - "repo": "test_repo_1", - "rule": "Generic Credential", - "commitMessage": "***STAGED CHANGES***", - "author": "", - "email": "", - "file": "server.test.py", - "date": "1970-01-01T00:00:00Z", - "tags": "key, API, generic" } ] diff --git a/test_data/test_local_repo_two_leaks.json b/test_data/test_local_repo_two_leaks.json index 612edee9..136bb6eb 100644 --- a/test_data/test_local_repo_two_leaks.json +++ b/test_data/test_local_repo_two_leaks.json @@ -12,32 +12,6 @@ "date": "2019-10-25T13:12:32-04:00", "tags": "key, AWS" }, - { - "line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"", - "offender": "KEY = \"AKIALALEMEL33243OLIBE", - "commit": "f61cd8587b7ac1d75a89a0c9af870a2f24c60263", - "repo": "test_repo_2", - "rule": "Generic Credential", - "commitMessage": "rm secrets again\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:12:32-04:00", - "tags": "key, API, generic" - }, - { - "line": " const AWSSECRET = \"99432bfewaf823ec3294e231\"", - "offender": "SECRET = \"99432bfewaf823ec3294e231", - "commit": "f61cd8587b7ac1d75a89a0c9af870a2f24c60263", - "repo": "test_repo_2", - "rule": "Generic Credential", - "commitMessage": "rm secrets again\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:12:32-04:00", - "tags": "key, API, generic" - }, { "line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"", "offender": "AKIALALEMEL33243OLIB", @@ -51,32 +25,6 @@ "date": "2019-10-25T13:12:08-04:00", "tags": "key, AWS" }, - { - "line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"", - "offender": "KEY = \"AKIALALEMEL33243OLIBE", - "commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba", - "repo": "test_repo_2", - "rule": "Generic Credential", - "commitMessage": "adding another one\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:12:08-04:00", - "tags": "key, API, generic" - }, - { - "line": " const AWSSECRET = \"99432bfewaf823ec3294e231\"", - "offender": "SECRET = \"99432bfewaf823ec3294e231", - "commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba", - "repo": "test_repo_2", - "rule": "Generic Credential", - "commitMessage": "adding another one\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:12:08-04:00", - "tags": "key, API, generic" - }, { "line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"", "offender": "AKIALALEMEL33243OLIA", @@ -90,19 +38,6 @@ "date": "2019-10-25T13:07:41-04:00", "tags": "key, AWS" }, - { - "line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"", - "offender": "secret: \"AKIALALEMEL33243OLIAE", - "commit": "996865bb912f3bc45898a370a13aadb315014b55", - "repo": "test_repo_2", - "rule": "Generic Credential", - "commitMessage": "committing pem\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:07:41-04:00", - "tags": "key, API, generic" - }, { "line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"", "offender": "AKIALALEMEL33243OLIA", @@ -116,19 +51,6 @@ "date": "2019-10-25T13:01:27-04:00", "tags": "key, AWS" }, - { - "line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"", - "offender": "secret: \"AKIALALEMEL33243OLIAE", - "commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c", - "repo": "test_repo_2", - "rule": "Generic Credential", - "commitMessage": "wait this is actually adding an aws secret\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:01:27-04:00", - "tags": "key, API, generic" - }, { "line": "Here's an AWS secret: AKIALALEMEL33243OLIAE", "offender": "AKIALALEMEL33243OLIA", @@ -142,19 +64,6 @@ "date": "2019-10-25T13:01:27-04:00", "tags": "key, AWS" }, - { - "line": "Here's an AWS secret: AKIALALEMEL33243OLIAE", - "offender": "secret: AKIALALEMEL33243OLIAE", - "commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c", - "repo": "test_repo_2", - "rule": "Generic Credential", - "commitMessage": "wait this is actually adding an aws secret\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:01:27-04:00", - "tags": "key, API, generic" - }, { "line": "\nHere's an AWS secret: AKIALALEMEL33243OLIAE", "offender": "AKIALALEMEL33243OLIA", @@ -167,18 +76,5 @@ "file": "secrets.md", "date": "2019-10-25T12:58:39-04:00", "tags": "key, AWS" - }, - { - "line": "\nHere's an AWS secret: AKIALALEMEL33243OLIAE", - "offender": "secret: AKIALALEMEL33243OLIAE", - "commit": "b10b3e2cb320a8c211fda94c4567299d37de7776", - "repo": "test_repo_2", - "rule": "Generic Credential", - "commitMessage": "adding aws key\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T12:58:39-04:00", - "tags": "key, API, generic" } ] diff --git a/test_data/test_local_repo_two_leaks_commit_from.json b/test_data/test_local_repo_two_leaks_commit_from.json index e6d5316d..47c7f306 100644 --- a/test_data/test_local_repo_two_leaks_commit_from.json +++ b/test_data/test_local_repo_two_leaks_commit_from.json @@ -14,45 +14,6 @@ }, { "line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"", - "offender": "secret: \"AKIALALEMEL33243OLIAE", - "commit": "996865bb912f3bc45898a370a13aadb315014b55", - "repo": "test_repo_2", - "rule": "Generic Credential", - "commitMessage": "committing pem\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:07:41-04:00", - "tags": "key, API, generic" - }, - { - "line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"", - "offender": "AKIALALEMEL33243OLIA", - "commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c", - "repo": "test_repo_2", - "rule": "AWS Manager ID", - "commitMessage": "wait this is actually adding an aws secret\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:01:27-04:00", - "tags": "key, AWS" - }, - { - "line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"", - "offender": "secret: \"AKIALALEMEL33243OLIAE", - "commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c", - "repo": "test_repo_2", - "rule": "Generic Credential", - "commitMessage": "wait this is actually adding an aws secret\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:01:27-04:00", - "tags": "key, API, generic" - }, - { - "line": "Here's an AWS secret: AKIALALEMEL33243OLIAE", "offender": "AKIALALEMEL33243OLIA", "commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c", "repo": "test_repo_2", @@ -66,16 +27,16 @@ }, { "line": "Here's an AWS secret: AKIALALEMEL33243OLIAE", - "offender": "secret: AKIALALEMEL33243OLIAE", + "offender": "AKIALALEMEL33243OLIA", "commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c", "repo": "test_repo_2", - "rule": "Generic Credential", + "rule": "AWS Manager ID", "commitMessage": "wait this is actually adding an aws secret\n", "author": "zach rice", "email": "zricer@protonmail.com", "file": "secrets.md", "date": "2019-10-25T13:01:27-04:00", - "tags": "key, API, generic" + "tags": "key, AWS" }, { "line": "\nHere's an AWS secret: AKIALALEMEL33243OLIAE", @@ -89,18 +50,5 @@ "file": "secrets.md", "date": "2019-10-25T12:58:39-04:00", "tags": "key, AWS" - }, - { - "line": "\nHere's an AWS secret: AKIALALEMEL33243OLIAE", - "offender": "secret: AKIALALEMEL33243OLIAE", - "commit": "b10b3e2cb320a8c211fda94c4567299d37de7776", - "repo": "test_repo_2", - "rule": "Generic Credential", - "commitMessage": "adding aws key\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T12:58:39-04:00", - "tags": "key, API, generic" } ] diff --git a/test_data/test_local_repo_two_leaks_commit_range.json b/test_data/test_local_repo_two_leaks_commit_range.json index 2335003b..b8cb7046 100644 --- a/test_data/test_local_repo_two_leaks_commit_range.json +++ b/test_data/test_local_repo_two_leaks_commit_range.json @@ -14,45 +14,6 @@ }, { "line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"", - "offender": "secret: \"AKIALALEMEL33243OLIAE", - "commit": "996865bb912f3bc45898a370a13aadb315014b55", - "repo": "test_repo_2", - "rule": "Generic Credential", - "commitMessage": "committing pem\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:07:41-04:00", - "tags": "key, API, generic" - }, - { - "line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"", - "offender": "AKIALALEMEL33243OLIA", - "commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c", - "repo": "test_repo_2", - "rule": "AWS Manager ID", - "commitMessage": "wait this is actually adding an aws secret\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:01:27-04:00", - "tags": "key, AWS" - }, - { - "line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"", - "offender": "secret: \"AKIALALEMEL33243OLIAE", - "commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c", - "repo": "test_repo_2", - "rule": "Generic Credential", - "commitMessage": "wait this is actually adding an aws secret\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:01:27-04:00", - "tags": "key, API, generic" - }, - { - "line": "Here's an AWS secret: AKIALALEMEL33243OLIAE", "offender": "AKIALALEMEL33243OLIA", "commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c", "repo": "test_repo_2", @@ -66,15 +27,15 @@ }, { "line": "Here's an AWS secret: AKIALALEMEL33243OLIAE", - "offender": "secret: AKIALALEMEL33243OLIAE", + "offender": "AKIALALEMEL33243OLIA", "commit": "17471a5fda722a9e423f1a0d3f0d267ea009d41c", "repo": "test_repo_2", - "rule": "Generic Credential", + "rule": "AWS Manager ID", "commitMessage": "wait this is actually adding an aws secret\n", "author": "zach rice", "email": "zricer@protonmail.com", "file": "secrets.md", "date": "2019-10-25T13:01:27-04:00", - "tags": "key, API, generic" + "tags": "key, AWS" } ] diff --git a/test_data/test_local_repo_two_leaks_commit_to.json b/test_data/test_local_repo_two_leaks_commit_to.json index 63eda70a..2d589fbc 100644 --- a/test_data/test_local_repo_two_leaks_commit_to.json +++ b/test_data/test_local_repo_two_leaks_commit_to.json @@ -12,32 +12,6 @@ "date": "2019-10-25T13:12:32-04:00", "tags": "key, AWS" }, - { - "line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"", - "offender": "KEY = \"AKIALALEMEL33243OLIBE", - "commit": "f61cd8587b7ac1d75a89a0c9af870a2f24c60263", - "repo": "test_repo_2", - "rule": "Generic Credential", - "commitMessage": "rm secrets again\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:12:32-04:00", - "tags": "key, API, generic" - }, - { - "line": " const AWSSECRET = \"99432bfewaf823ec3294e231\"", - "offender": "SECRET = \"99432bfewaf823ec3294e231", - "commit": "f61cd8587b7ac1d75a89a0c9af870a2f24c60263", - "repo": "test_repo_2", - "rule": "Generic Credential", - "commitMessage": "rm secrets again\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:12:32-04:00", - "tags": "key, API, generic" - }, { "line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"", "offender": "AKIALALEMEL33243OLIB", @@ -51,32 +25,6 @@ "date": "2019-10-25T13:12:08-04:00", "tags": "key, AWS" }, - { - "line": " const AWSKEY = \"AKIALALEMEL33243OLIBE\"", - "offender": "KEY = \"AKIALALEMEL33243OLIBE", - "commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba", - "repo": "test_repo_2", - "rule": "Generic Credential", - "commitMessage": "adding another one\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:12:08-04:00", - "tags": "key, API, generic" - }, - { - "line": " const AWSSECRET = \"99432bfewaf823ec3294e231\"", - "offender": "SECRET = \"99432bfewaf823ec3294e231", - "commit": "b2eb34a61c988afd9b4aaa9dd58c8dd7d5f14dba", - "repo": "test_repo_2", - "rule": "Generic Credential", - "commitMessage": "adding another one\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:12:08-04:00", - "tags": "key, API, generic" - }, { "line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"", "offender": "AKIALALEMEL33243OLIA", @@ -89,18 +37,5 @@ "file": "secrets.md", "date": "2019-10-25T13:07:41-04:00", "tags": "key, AWS" - }, - { - "line": "Here's an AWS secret: \"AKIALALEMEL33243OLIAE\"", - "offender": "secret: \"AKIALALEMEL33243OLIAE", - "commit": "996865bb912f3bc45898a370a13aadb315014b55", - "repo": "test_repo_2", - "rule": "Generic Credential", - "commitMessage": "committing pem\n", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "secrets.md", - "date": "2019-10-25T13:07:41-04:00", - "tags": "key, API, generic" } ]