forked from gitleaks/gitleaks
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix deduplication issue caused by clobbered findings (gitleaks#742)
* fix deduplication issue caused by clobbered findings * fix index * remove indexing, slow is better than wrong
- Loading branch information
1 parent
84e285e
commit ce42947
Showing
17 changed files
with
81 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,29 +26,29 @@ func TestFromGit(t *testing.T) { | |
source string | ||
logOpts string | ||
expected string | ||
expectedFindings []*report.Finding | ||
expectedFindings []report.Finding | ||
}{ | ||
{ | ||
source: filepath.Join(repoBasePath, "small"), | ||
expected: filepath.Join(expectPath, "git", "small.txt"), | ||
cfgName: "simple", | ||
expectedFindings: []*report.Finding{ | ||
expectedFindings: []report.Finding{ | ||
{ | ||
Description: "AWS Access Key", | ||
StartLine: 20, | ||
EndLine: 20, | ||
StartColumn: 19, | ||
EndColumn: 38, | ||
Secret: "AKIALALEMEL33243OLIA", | ||
Match: "AKIALALEMEL33243OLIA", | ||
File: "main.go", | ||
// Line: "\tawsToken := \"AKIALALEMEL33243OLIA\"", | ||
Date: "2021-11-02T23:37:53Z", | ||
Commit: "1b6da43b82b22e4eaa10bcf8ee591e91abbfc587", | ||
Author: "Zachary Rice", | ||
Email: "[email protected]", | ||
Message: "Accidentally add a secret", | ||
RuleID: "aws-access-key", | ||
Tags: []string{"key", "AWS"}, | ||
Date: "2021-11-02T23:37:53Z", | ||
Commit: "1b6da43b82b22e4eaa10bcf8ee591e91abbfc587", | ||
Author: "Zachary Rice", | ||
Email: "[email protected]", | ||
Message: "Accidentally add a secret", | ||
RuleID: "aws-access-key", | ||
Tags: []string{"key", "AWS"}, | ||
}, | ||
{ | ||
Description: "AWS Access Key", | ||
|
@@ -57,15 +57,15 @@ func TestFromGit(t *testing.T) { | |
StartColumn: 17, | ||
EndColumn: 36, | ||
Secret: "AKIALALEMEL33243OLIA", | ||
Match: "AKIALALEMEL33243OLIA", | ||
File: "foo/foo.go", | ||
// Line: "\taws_token := \"AKIALALEMEL33243OLIA\"", | ||
Date: "2021-11-02T23:48:06Z", | ||
Commit: "491504d5a31946ce75e22554cc34203d8e5ff3ca", | ||
Author: "Zach Rice", | ||
Email: "[email protected]", | ||
Message: "adding foo package with secret", | ||
RuleID: "aws-access-key", | ||
Tags: []string{"key", "AWS"}, | ||
Date: "2021-11-02T23:48:06Z", | ||
Commit: "491504d5a31946ce75e22554cc34203d8e5ff3ca", | ||
Author: "Zach Rice", | ||
Email: "[email protected]", | ||
Message: "adding foo package with secret", | ||
RuleID: "aws-access-key", | ||
Tags: []string{"key", "AWS"}, | ||
}, | ||
}, | ||
}, | ||
|
@@ -74,23 +74,23 @@ func TestFromGit(t *testing.T) { | |
expected: filepath.Join(expectPath, "git", "small-branch-foo.txt"), | ||
logOpts: "--all foo...", | ||
cfgName: "simple", | ||
expectedFindings: []*report.Finding{ | ||
expectedFindings: []report.Finding{ | ||
{ | ||
Description: "AWS Access Key", | ||
StartLine: 9, | ||
EndLine: 9, | ||
StartColumn: 17, | ||
EndColumn: 36, | ||
Secret: "AKIALALEMEL33243OLIA", | ||
// Line: "\taws_token := \"AKIALALEMEL33243OLIA\"", | ||
Date: "2021-11-02T23:48:06Z", | ||
File: "foo/foo.go", | ||
Commit: "491504d5a31946ce75e22554cc34203d8e5ff3ca", | ||
Author: "Zach Rice", | ||
Email: "[email protected]", | ||
Message: "adding foo package with secret", | ||
RuleID: "aws-access-key", | ||
Tags: []string{"key", "AWS"}, | ||
Match: "AKIALALEMEL33243OLIA", | ||
Date: "2021-11-02T23:48:06Z", | ||
File: "foo/foo.go", | ||
Commit: "491504d5a31946ce75e22554cc34203d8e5ff3ca", | ||
Author: "Zach Rice", | ||
Email: "[email protected]", | ||
Message: "adding foo package with secret", | ||
RuleID: "aws-access-key", | ||
Tags: []string{"key", "AWS"}, | ||
}, | ||
}, | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.