From c4b07f5113bf39019374579a64d83959236295e4 Mon Sep 17 00:00:00 2001 From: Noel Algora Date: Wed, 26 Feb 2020 21:33:15 +0100 Subject: [PATCH] Add file regex support (#340) * Modified Entropy to be able to apply it on regex match or specific capture group * Config tests * Small fixes on entropy ranges * Fix toml configs Fix tests * Start adding support for rules with filename regex Changed how config is parsed Created new functions to inspect files and content * File regex working * Fixing tests and configs * Implemented different regex for filename and filepath * Fix comments * Audit tests * Config rename vars * Fix audit tests * Filename offender * Indents and code styles * Indents and code styles * Removing bad test repo * Adding test repo 6 for filename and filepath tests * global whitelist path and fixes * Fixes on tests and new test for global whitelisting paths * Removing unused test * Fix comment --- audit/audit_test.go | 40 +++ audit/repo.go | 37 +- audit/util.go | 332 ++++++++++-------- config/config.go | 94 ++--- config/config_test.go | 7 - examples/leaky-repo.toml | 3 +- examples/regex_and_file.toml | 4 +- hosts/github.go | 2 +- .../test_configs/aws_key_file_regex.toml | 6 +- .../aws_key_global_whitelist_file.toml | 4 +- .../aws_key_global_whitelist_path.toml | 10 + .../bad_aws_key_global_whitelist_file.toml | 2 +- .../bad_aws_key_message_regex.toml | 13 - test_data/test_configs/large.toml | 13 +- test_data/test_configs/regex_filename.toml | 6 + test_data/test_configs/regex_filepath.toml | 6 + .../test_configs/regex_filepath_filename.toml | 7 + test_data/test_local_owner_aws_leak.json | 13 + .../test_local_owner_aws_leak_depth_2.json | 13 + ...local_repo_one_aws_leak_and_file_leak.json | 32 +- test_data/test_local_repo_six.json | 44 +++ test_data/test_local_repo_six_filename.json | 28 ++ test_data/test_local_repo_six_filepath.json | 15 + ...test_local_repo_six_filepath_filename.json | 15 + ...al_repo_six_path_globally_whitelisted.json | 15 + .../test_repos/test_repo_6/application.yaml | 3 + .../test_repo_6/config/application.properties | 3 + .../test_repo_6/dotGit/COMMIT_EDITMSG | 1 + test_data/test_repos/test_repo_6/dotGit/HEAD | 1 + .../test_repos/test_repo_6/dotGit/config | 7 + .../test_repos/test_repo_6/dotGit/description | 1 + test_data/test_repos/test_repo_6/dotGit/index | Bin 0 -> 333 bytes .../test_repo_6/dotGit/info/exclude | 6 + .../test_repos/test_repo_6/dotGit/logs/HEAD | 4 + .../test_repo_6/dotGit/logs/refs/heads/master | 3 + .../10/fa14c5ab0134436e2ae435138bf921eb477c60 | Bin 0 -> 784 bytes .../3a/76f3781306faf5612017bf18a4b4bdb9f927bf | Bin 0 -> 138 bytes .../41/42082bcb939bbc17985a69ba748491ac6b62a5 | Bin 0 -> 281 bytes .../49/8b267a8c7812490d6479839c5577eaaec79d62 | Bin 0 -> 77 bytes .../5c/b000d0f4965e9b0c080814478dbf4e87c114c7 | Bin 0 -> 111 bytes .../60/c9e47f150a6b713e247e6105b77f1b961f844f | Bin 0 -> 23 bytes .../61/87dbf4390fc6e28445dd3d988aefb9d1111988 | Bin 0 -> 708 bytes .../65/57c92612d3b35979bd426d429255b3bf9fab74 | Bin 0 -> 133 bytes .../69/465772e5c3a14379da6c369cdb46edbaa6d097 | Bin 0 -> 133 bytes .../6a/756416384c210ada2631f17862f5c01fffa478 | Bin 0 -> 946 bytes .../6c/9406b7d9320db083eca69b3f8bee9a6c7b50d4 | Bin 0 -> 114 bytes .../6c/bef5c370d8c3486ca85423dd70440c5e0a2aa2 | Bin 0 -> 2176 bytes .../80/8b12c5ca4b142367932e7045d555a639fc148c | Bin 0 -> 209 bytes .../80/ba94135cc378364af9d3cb2450df48e51faf2c | Bin 0 -> 1247 bytes .../98/b6c7cb3fb29a5993c4c95c56a2dc53050b9247 | Bin 0 -> 176 bytes .../9e/523225b31add24e72f2feb0b2645cfb36542dc | 3 + .../a1/ddd32febf3bde66331218f877ff637c85c5f92 | Bin 0 -> 208 bytes .../a1/fd29ec14823d8bc4a8d1a2cfe35451580f5118 | 3 + .../a4/fa2187727281aea78d7c3aaebdb4b924fc4e4d | Bin 0 -> 57 bytes .../a5/196d1be8fb59edf8062bef36d3a602e0812139 | 1 + .../a5/d7b84a673458d14d9aab082183a1968c2c7492 | Bin 0 -> 299 bytes .../b5/8d1184a9d43a39c0d95f32453efc78581877d6 | Bin 0 -> 529 bytes .../bc/379e22c22a97ca5ffc871c1449af854f6f26c4 | Bin 0 -> 195 bytes .../c9/8e6c52cbd1f50de572ff12a3441271fccff705 | Bin 0 -> 158 bytes .../cb/089cd89a7d7686d284d8761201649346b5aa1c | Bin 0 -> 37 bytes .../cb/19a50e8cdeb7011eccdb13f3b739f00d775bab | 2 + .../d2/74003914c707212cbe84e3e466a00013ccb639 | Bin 0 -> 154 bytes .../db/4ccd6cc9ef282e9bf2f8c5f7877f0d40520724 | Bin 0 -> 67 bytes .../dd/6e8207f130e113c97f5ed15238e7901290ee42 | Bin 0 -> 106 bytes .../dd/cd9ac6904950dcc48e4c04ba043707e9e0117f | Bin 0 -> 132 bytes .../e6/73bb3980f3c286291809e05f80873852bc3e9c | Bin 0 -> 1646 bytes .../e9/e5396f7e52aa48de485b4836ebb041cc7f7c46 | Bin 0 -> 59 bytes .../ec/17ec1939b7c3e86b7cb6c0c4de6b0818a7e75e | 2 + .../fe/f3190e94723e78847ab9f0daaa15add4ffd4ef | Bin 0 -> 58 bytes .../test_repo_6/dotGit/refs/heads/master | 1 + .../test_repos/test_repo_6/server.test.py | 10 + 71 files changed, 556 insertions(+), 256 deletions(-) create mode 100644 test_data/test_configs/aws_key_global_whitelist_path.toml delete mode 100644 test_data/test_configs/bad_aws_key_message_regex.toml create mode 100644 test_data/test_configs/regex_filename.toml create mode 100644 test_data/test_configs/regex_filepath.toml create mode 100644 test_data/test_configs/regex_filepath_filename.toml create mode 100644 test_data/test_local_repo_six.json create mode 100644 test_data/test_local_repo_six_filename.json create mode 100644 test_data/test_local_repo_six_filepath.json create mode 100644 test_data/test_local_repo_six_filepath_filename.json create mode 100644 test_data/test_local_repo_six_path_globally_whitelisted.json create mode 100644 test_data/test_repos/test_repo_6/application.yaml create mode 100644 test_data/test_repos/test_repo_6/config/application.properties create mode 100644 test_data/test_repos/test_repo_6/dotGit/COMMIT_EDITMSG create mode 100644 test_data/test_repos/test_repo_6/dotGit/HEAD create mode 100644 test_data/test_repos/test_repo_6/dotGit/config create mode 100644 test_data/test_repos/test_repo_6/dotGit/description create mode 100644 test_data/test_repos/test_repo_6/dotGit/index create mode 100644 test_data/test_repos/test_repo_6/dotGit/info/exclude create mode 100644 test_data/test_repos/test_repo_6/dotGit/logs/HEAD create mode 100644 test_data/test_repos/test_repo_6/dotGit/logs/refs/heads/master create mode 100644 test_data/test_repos/test_repo_6/dotGit/objects/10/fa14c5ab0134436e2ae435138bf921eb477c60 create mode 100644 test_data/test_repos/test_repo_6/dotGit/objects/3a/76f3781306faf5612017bf18a4b4bdb9f927bf create mode 100644 test_data/test_repos/test_repo_6/dotGit/objects/41/42082bcb939bbc17985a69ba748491ac6b62a5 create mode 100644 test_data/test_repos/test_repo_6/dotGit/objects/49/8b267a8c7812490d6479839c5577eaaec79d62 create mode 100644 test_data/test_repos/test_repo_6/dotGit/objects/5c/b000d0f4965e9b0c080814478dbf4e87c114c7 create mode 100644 test_data/test_repos/test_repo_6/dotGit/objects/60/c9e47f150a6b713e247e6105b77f1b961f844f create mode 100644 test_data/test_repos/test_repo_6/dotGit/objects/61/87dbf4390fc6e28445dd3d988aefb9d1111988 create mode 100644 test_data/test_repos/test_repo_6/dotGit/objects/65/57c92612d3b35979bd426d429255b3bf9fab74 create mode 100644 test_data/test_repos/test_repo_6/dotGit/objects/69/465772e5c3a14379da6c369cdb46edbaa6d097 create mode 100644 test_data/test_repos/test_repo_6/dotGit/objects/6a/756416384c210ada2631f17862f5c01fffa478 create mode 100644 test_data/test_repos/test_repo_6/dotGit/objects/6c/9406b7d9320db083eca69b3f8bee9a6c7b50d4 create mode 100644 test_data/test_repos/test_repo_6/dotGit/objects/6c/bef5c370d8c3486ca85423dd70440c5e0a2aa2 create mode 100644 test_data/test_repos/test_repo_6/dotGit/objects/80/8b12c5ca4b142367932e7045d555a639fc148c create mode 100644 test_data/test_repos/test_repo_6/dotGit/objects/80/ba94135cc378364af9d3cb2450df48e51faf2c create mode 100644 test_data/test_repos/test_repo_6/dotGit/objects/98/b6c7cb3fb29a5993c4c95c56a2dc53050b9247 create mode 100644 test_data/test_repos/test_repo_6/dotGit/objects/9e/523225b31add24e72f2feb0b2645cfb36542dc create mode 100644 test_data/test_repos/test_repo_6/dotGit/objects/a1/ddd32febf3bde66331218f877ff637c85c5f92 create mode 100644 test_data/test_repos/test_repo_6/dotGit/objects/a1/fd29ec14823d8bc4a8d1a2cfe35451580f5118 create mode 100644 test_data/test_repos/test_repo_6/dotGit/objects/a4/fa2187727281aea78d7c3aaebdb4b924fc4e4d create mode 100644 test_data/test_repos/test_repo_6/dotGit/objects/a5/196d1be8fb59edf8062bef36d3a602e0812139 create mode 100644 test_data/test_repos/test_repo_6/dotGit/objects/a5/d7b84a673458d14d9aab082183a1968c2c7492 create mode 100644 test_data/test_repos/test_repo_6/dotGit/objects/b5/8d1184a9d43a39c0d95f32453efc78581877d6 create mode 100644 test_data/test_repos/test_repo_6/dotGit/objects/bc/379e22c22a97ca5ffc871c1449af854f6f26c4 create mode 100644 test_data/test_repos/test_repo_6/dotGit/objects/c9/8e6c52cbd1f50de572ff12a3441271fccff705 create mode 100644 test_data/test_repos/test_repo_6/dotGit/objects/cb/089cd89a7d7686d284d8761201649346b5aa1c create mode 100644 test_data/test_repos/test_repo_6/dotGit/objects/cb/19a50e8cdeb7011eccdb13f3b739f00d775bab create mode 100644 test_data/test_repos/test_repo_6/dotGit/objects/d2/74003914c707212cbe84e3e466a00013ccb639 create mode 100644 test_data/test_repos/test_repo_6/dotGit/objects/db/4ccd6cc9ef282e9bf2f8c5f7877f0d40520724 create mode 100644 test_data/test_repos/test_repo_6/dotGit/objects/dd/6e8207f130e113c97f5ed15238e7901290ee42 create mode 100644 test_data/test_repos/test_repo_6/dotGit/objects/dd/cd9ac6904950dcc48e4c04ba043707e9e0117f create mode 100644 test_data/test_repos/test_repo_6/dotGit/objects/e6/73bb3980f3c286291809e05f80873852bc3e9c create mode 100644 test_data/test_repos/test_repo_6/dotGit/objects/e9/e5396f7e52aa48de485b4836ebb041cc7f7c46 create mode 100644 test_data/test_repos/test_repo_6/dotGit/objects/ec/17ec1939b7c3e86b7cb6c0c4de6b0818a7e75e create mode 100644 test_data/test_repos/test_repo_6/dotGit/objects/fe/f3190e94723e78847ab9f0daaa15add4ffd4ef create mode 100644 test_data/test_repos/test_repo_6/dotGit/refs/heads/master create mode 100644 test_data/test_repos/test_repo_6/server.test.py diff --git a/audit/audit_test.go b/audit/audit_test.go index 3049d145..0f59e2f2 100644 --- a/audit/audit_test.go +++ b/audit/audit_test.go @@ -253,6 +253,46 @@ func TestAudit(t *testing.T) { }, wantPath: "../test_data/test_local_repo_five_commit.json", }, + { + description: "test local repo six filename", + opts: options.Options{ + RepoPath: "../test_data/test_repos/test_repo_6", + Report: "../test_data/test_local_repo_six_filename.json.got", + Config: "../test_data/test_configs/regex_filename.toml", + ReportFormat: "json", + }, + wantPath: "../test_data/test_local_repo_six_filename.json", + }, + { + description: "test local repo six filepath", + opts: options.Options{ + RepoPath: "../test_data/test_repos/test_repo_6", + Report: "../test_data/test_local_repo_six_filepath.json.got", + Config: "../test_data/test_configs/regex_filepath.toml", + ReportFormat: "json", + }, + wantPath: "../test_data/test_local_repo_six_filepath.json", + }, + { + description: "test local repo six filename and filepath", + opts: options.Options{ + RepoPath: "../test_data/test_repos/test_repo_6", + Report: "../test_data/test_local_repo_six_filepath_filename.json.got", + Config: "../test_data/test_configs/regex_filepath_filename.toml", + ReportFormat: "json", + }, + wantPath: "../test_data/test_local_repo_six_filepath_filename.json", + }, + { + description: "test local repo six path globally whitelisted", + opts: options.Options{ + RepoPath: "../test_data/test_repos/test_repo_6", + Report: "../test_data/test_local_repo_six_path_globally_whitelisted.json.got", + Config: "../test_data/test_configs/aws_key_global_whitelist_path.toml", + ReportFormat: "json", + }, + wantPath: "../test_data/test_local_repo_six_path_globally_whitelisted.json", + }, } for _, test := range tests { diff --git a/audit/repo.go b/audit/repo.go index 46fc7899..e1b11ac4 100644 --- a/audit/repo.go +++ b/audit/repo.go @@ -171,35 +171,18 @@ func (repo *Repo) AuditUncommitted() error { } } - if fileMatched(filename, repo.config.Whitelist.File) { - log.Debugf("whitelisted file found, skipping audit of file: %s", filename) - } else if fileMatched(filename, repo.config.FileRegex) { - repo.Manager.SendLeaks(manager.Leak{ - Line: "N/A", - Offender: filename, - Commit: c.Hash.String(), - Repo: repo.Name, - Rule: "file regex matched" + repo.config.FileRegex.String(), - Message: c.Message, - Author: c.Author.Name, - Email: c.Author.Email, - Date: c.Author.When, - File: filename, - }) - } else { - dmp := diffmatchpatch.New() - diffs := dmp.DiffMain(prevFileContents, currFileContents, false) - var diffContents string - for _, d := range diffs { - switch d.Type { - case diffmatchpatch.DiffInsert: - diffContents += fmt.Sprintf("%s\n", d.Text) - case diffmatchpatch.DiffDelete: - diffContents += fmt.Sprintf("%s\n", d.Text) - } + diffs := diffmatchpatch.New().DiffMain(prevFileContents, currFileContents, false) + var diffContents string + for _, d := range diffs { + switch d.Type { + case diffmatchpatch.DiffInsert: + diffContents += fmt.Sprintf("%s\n", d.Text) + case diffmatchpatch.DiffDelete: + diffContents += fmt.Sprintf("%s\n", d.Text) } - InspectString(diffContents, c, repo, filename) } + + InspectFile(diffContents, filename, c, repo) } } diff --git a/audit/util.go b/audit/util.go index 27915e45..05e39736 100644 --- a/audit/util.go +++ b/audit/util.go @@ -3,6 +3,7 @@ package audit import ( "fmt" "math" + "path/filepath" "regexp" "runtime" "strings" @@ -31,33 +32,16 @@ func inspectPatch(patch *object.Patch, c *object.Commit, repo *Repo) { if f.IsBinary() { continue } - if fileMatched(getFileName(f), repo.config.Whitelist.File) { - log.Debugf("whitelisted file found, skipping audit of file: %s", getFileName(f)) - continue - } - if fileMatched(getFileName(f), repo.config.FileRegex) { - repo.Manager.SendLeaks(manager.Leak{ - Line: "N/A", - Offender: getFileName(f), - Commit: c.Hash.String(), - Repo: repo.Name, - Rule: "file regex matched" + repo.config.FileRegex.String(), - Author: c.Author.Name, - Email: c.Author.Email, - Date: c.Author.When, - File: getFileName(f), - }) - } for _, chunk := range f.Chunks() { if chunk.Type() == fdiff.Delete || chunk.Type() == fdiff.Add { - InspectString(chunk.Content(), c, repo, getFileName(f)) + InspectFile(chunk.Content(), getFileFullPath(f), c, repo) } } } } // getFileName accepts a file patch and returns the filename -func getFileName(f fdiff.FilePatch) string { +func getFileFullPath(f fdiff.FilePatch) string { fn := "???" from, to := f.Files() if from != nil { @@ -69,6 +53,31 @@ func getFileName(f fdiff.FilePatch) string { return fn } +// getFileName accepts a string with full path and returns only path +func getFilePath(fullpath string) string { + return filepath.Dir(fullpath) +} + +// getFileName accepts a string with full path and returns only filename +func getFileName(fullpath string) string { + return filepath.Base(fullpath) +} + +// aws_access_key_id='AKIAIO5FODNN7EXAMPLE', +// trippedEntropy checks if a given capture group or offender falls in between entropy ranges +// supplied by a custom gitleaks configuration. Gitleaks do not check entropy by default. +func trippedEntropy(groups []string, rule config.Rule) bool { + for _, e := range rule.Entropies { + if len(groups) > e.Group { + entropy := shannonEntropy(groups[e.Group]) + if entropy >= e.Min && entropy <= e.Max { + return true + } + } + } + return false +} + // getShannonEntropy https://en.wiktionary.org/wiki/Shannon_entropy func shannonEntropy(data string) (entropy float64) { if data == "" { @@ -89,21 +98,8 @@ func shannonEntropy(data string) (entropy float64) { return entropy } -// aws_access_key_id='AKIAIO5FODNN7EXAMPLE', -// trippedEntropy checks if a given groups or offender falls in between entropy ranges -// supplied by a custom gitleaks configuration. Gitleaks do not check entropy by default. -func trippedEntropy(groups []string, rule config.Rule) bool { - for _, e := range rule.Entropies { - if len(groups) > e.Group { - entropy := shannonEntropy(groups[e.Group]) - if entropy >= e.Min && entropy <= e.Max { - return true - } - } - } - return false -} +// Checks if the given rule has a regex func ruleContainRegex(rule config.Rule) bool { if rule.Regex == nil { return false @@ -114,103 +110,147 @@ func ruleContainRegex(rule config.Rule) bool { return true } -// InspectString accepts a string, commit object, repo, and filename. This function iterates over -// all the rules set by the gitleaks config. If the rule contains entropy checks then entropy will be checked first. -// Next, if the rule contains a regular expression then that will be checked. -func InspectString(content string, c *object.Commit, repo *Repo, filename string) { +// Checks if the given rule has a file name regex +func ruleContainFileNameRegex(rule config.Rule) bool { + if rule.FileNameRegex == nil { + return false + } + if rule.FileNameRegex.String() == "" { + return false + } + return true +} + +// Checks if the given rule has a file path regex +func ruleContainFilePathRegex(rule config.Rule) bool { + if rule.FilePathRegex == nil { + return false + } + if rule.FilePathRegex.String() == "" { + return false + } + return true +} + +func sendLeak(offender string, line string, filename string, rule config.Rule, c *object.Commit, repo *Repo) { + if repo.Manager.Opts.Redact { + line = strings.ReplaceAll(line, offender, "REDACTED") + offender = "REDACTED" + } + + repo.Manager.SendLeaks(manager.Leak{ + Line: line, + Offender: offender, + Commit: c.Hash.String(), + Repo: repo.Name, + Message: c.Message, + Rule: rule.Description, + Author: c.Author.Name, + Email: c.Author.Email, + Date: c.Author.When, + Tags: strings.Join(rule.Tags, ", "), + File: filename, + }) +} + +// InspectFile accepts a file content, fullpath of file, commit and repo. If the file is +// binary OR if a file is matched on whitelisted files set in the configuration, then gitleaks +// will skip auditing that file. It will check first if rules apply to this file comparing filename +// and path to their respective rule regexes and inspect file content with inspectFileContents after. +func InspectFile(content string, fullpath string, c *object.Commit, repo *Repo) { + + filename := getFileName(fullpath) + path := getFilePath(fullpath) + + // We want to check if there is a whitelist for this file + if len(repo.config.Whitelist.Files) != 0 { + for _, reFileName := range repo.config.Whitelist.Files { + if fileMatched(filename, reFileName) { + log.Debugf("whitelisted file found, skipping audit of file: %s", filename) + return + } + } + } + + // We want to check if there is a whitelist for this path + if len(repo.config.Whitelist.Paths) != 0 { + for _, reFilePath := range repo.config.Whitelist.Paths { + if fileMatched(path, reFilePath) { + log.Debugf("file in whitelisted path found, skipping audit of file: %s", filename) + return + } + } + } + for _, rule := range repo.config.Rules { - if rule.Regex.String() == "" { + start := time.Now() + + // For each rule we want to check filename whitelists + if isFileNameWhiteListed(filename, rule.Whitelist) || isFilePathWhiteListed(path, rule.Whitelist) { + continue + } + + // If it has fileNameRegex and it doesnt match we continue to next rule + if ruleContainFileNameRegex(rule) && !fileMatched(filename, rule.FileNameRegex) { continue } - if repo.timeoutReached() { - return + // If it has filePathRegex and it doesnt match we continue to next rule + if ruleContainFilePathRegex(rule) && !fileMatched(path, rule.FilePathRegex) { + continue } - start := time.Now() - locs := rule.Regex.FindAllIndex([]byte(content), -1) - if len(locs) != 0 { - // check if any rules are whitelisting this leak - if len(rule.Whitelist) != 0 { - for _, wl := range rule.Whitelist { - if fileMatched(filename, wl.File) { - // if matched, go to next rule - goto NEXT - } - } - } - for _, loc := range locs { - start := loc[0] - end := loc[1] - for start != 0 && content[start] != '\n' { - start = start - 1 - } - if start != 0 { - // skip newline - start = start + 1 - } - for end < len(content)-1 && content[end] != '\n' { - end = end + 1 - } - - line := content[start:end] - offender := content[loc[0]:loc[1]] - groups := rule.Regex.FindStringSubmatch(offender) - - if len(rule.Whitelist) != 0 { - for _, wl := range rule.Whitelist { - if wl.Regex.FindString(offender) != "" { - goto NEXT - } - } - } - - if len(rule.Entropies) != 0 { - if trippedEntropy(groups, rule) { - if repo.Manager.Opts.Redact { - line = strings.ReplaceAll(line, offender, "REDACTED") - offender = "REDACTED" - } - repo.Manager.SendLeaks(manager.Leak{ - Line: line, - Offender: offender, - Commit: c.Hash.String(), - Repo: repo.Name, - Message: c.Message, - Rule: rule.Description, - Author: c.Author.Name, - Email: c.Author.Email, - Date: c.Author.When, - Tags: strings.Join(rule.Tags, ", "), - File: filename, - }) - } - } else { - if repo.Manager.Opts.Redact { - line = strings.ReplaceAll(line, offender, "REDACTED") - offender = "REDACTED" - } - repo.Manager.SendLeaks(manager.Leak{ - Line: line, - Offender: offender, - Commit: c.Hash.String(), - Message: c.Message, - Repo: repo.Name, - Rule: rule.Description, - Author: c.Author.Name, - Email: c.Author.Email, - Date: c.Author.When, - Tags: strings.Join(rule.Tags, ", "), - File: filename, - }) - } - } + // If it doesnt contain a content regex then it is a filename regex match + if !ruleContainRegex(rule) { + sendLeak("Filename/path offender: "+filename, "N/A", fullpath, rule, c, repo) + } else { + //otherwise we check if it matches content regex + inspectFileContents(content, fullpath, rule, c, repo) } + + // TODO should return filenameRegex if only file rule repo.Manager.RecordTime(manager.RegexTime{ - Time: time.Now().Sub(start).Nanoseconds(), + Time: howLong(start), Regex: rule.Regex.String(), }) - NEXT: + } +} + +// InspectString accepts a string, commit object, repo, and filename. This function iterates over +// all the rules set by the gitleaks config. If the rule contains entropy checks then entropy will be checked first. +// Next, if the rule contains a regular expression then that will be checked. +func inspectFileContents(content string, path string, rule config.Rule, c *object.Commit, repo *Repo) { + locs := rule.Regex.FindAllIndex([]byte(content), -1) + if len(locs) != 0 { + for _, loc := range locs { + start := loc[0] + end := loc[1] + for start != 0 && content[start] != '\n' { + start = start - 1 + } + if start != 0 { + // skip newline + start = start + 1 + } + + for end < len(content)-1 && content[end] != '\n' { + end = end + 1 + } + + line := content[start:end] + offender := content[loc[0]:loc[1]] + groups := rule.Regex.FindStringSubmatch(offender) + + if isOffenderWhiteListed(offender, rule.Whitelist) { + continue + } + + if len(rule.Entropies) != 0 && !trippedEntropy(groups, rule) { + continue + } + + sendLeak(offender, line, path, rule, c, repo) + } } } @@ -281,30 +321,13 @@ func inspectFilesAtCommit(c *object.Commit, repo *Repo) error { } else if err != nil { return err } - if fileMatched(f, repo.config.Whitelist.File) { - log.Debugf("whitelisted file found, skipping audit of file: %s", f.Name) - return nil - } - if fileMatched(f.Name, repo.config.FileRegex) { - repo.Manager.SendLeaks(manager.Leak{ - Line: "N/A", - Offender: f.Name, - Commit: c.Hash.String(), - Repo: repo.Name, - Rule: "file regex matched" + repo.config.FileRegex.String(), - Author: c.Author.Name, - Email: c.Author.Email, - Date: c.Author.When, - File: f.Name, - }) - } content, err := f.Contents() if err != nil { return err } - InspectString(content, c, repo, f.Name) + InspectFile(content, f.Name, c, repo) return nil }) @@ -333,6 +356,39 @@ func isCommitWhiteListed(commitHash string, whitelistedCommits []string) bool { return false } +func isOffenderWhiteListed(offender string, whitelist []config.Whitelist) bool { + if len(whitelist) != 0 { + for _, wl := range whitelist { + if wl.Regex.FindString(offender) != "" { + return true + } + } + } + return false +} + +func isFileNameWhiteListed(filename string, whitelist []config.Whitelist) bool { + if len(whitelist) != 0 { + for _, wl := range whitelist { + if fileMatched(filename, wl.File) { + return true + } + } + } + return false +} + +func isFilePathWhiteListed(filepath string, whitelist []config.Whitelist) bool { + if len(whitelist) != 0 { + for _, wl := range whitelist { + if fileMatched(filepath, wl.Path) { + return true + } + } + } + return false +} + func fileMatched(f interface{}, re *regexp.Regexp) bool { if re == nil { return false diff --git a/config/config.go b/config/config.go index 355d72fb..62a8aa7c 100644 --- a/config/config.go +++ b/config/config.go @@ -16,9 +16,10 @@ type Whitelist struct { Description string Regex *regexp.Regexp File *regexp.Regexp + Path *regexp.Regexp } -// entropy represents an entropy range +// Entropy represents an entropy range type Entropy struct { Min float64 Max float64 @@ -31,23 +32,24 @@ type Entropy struct { // that match is not whitelisted (globally or locally), then a leak will be appended // to the final audit report. type Rule struct { - Description string - Regex *regexp.Regexp - Tags []string - Whitelist []Whitelist - Entropies []Entropy + Description string + Regex *regexp.Regexp + FileNameRegex *regexp.Regexp + FilePathRegex *regexp.Regexp + Tags []string + Whitelist []Whitelist + Entropies []Entropy } // Config is a composite struct of Rules and Whitelists // Each Rule contains a description, regular expression, tags, and whitelists if available type Config struct { - FileRegex *regexp.Regexp - Message *regexp.Regexp Rules []Rule Whitelist struct { Description string Commits []string - File *regexp.Regexp + Files []*regexp.Regexp + Paths []*regexp.Regexp } } @@ -55,20 +57,19 @@ type Config struct { // see the config in config/defaults.go for an example. TomlLoader is used // to generate Config values (compiling regexes, etc). type TomlLoader struct { - Global struct { - File string - Message string - } Whitelist struct { Description string Commits []string - File string + Files []string + Paths []string } Rules []struct { - Description string - Regex string - Tags []string - Entropies []struct { + Description string + Regex string + FileNameRegex string + FilePathRegex string + Tags []string + Entropies []struct { Min string Max string Group string @@ -77,6 +78,7 @@ type TomlLoader struct { Description string Regex string File string + Path string } } } @@ -116,22 +118,35 @@ func (tomlLoader TomlLoader) Parse() (Config, error) { if err != nil { return cfg, fmt.Errorf("problem loading config: %v", err) } + fileNameRe, err := regexp.Compile(rule.FileNameRegex) + if err != nil { + return cfg, fmt.Errorf("problem loading config: %v", err) + } + filePathRe, err := regexp.Compile(rule.FilePathRegex) + if err != nil { + return cfg, fmt.Errorf("problem loading config: %v", err) + } // rule specific whitelists var whitelists []Whitelist for _, wl := range rule.Whitelist { - re, err := regexp.Compile(wl.Regex) + wlRe, err := regexp.Compile(wl.Regex) if err != nil { return cfg, fmt.Errorf("problem loading config: %v", err) } - fileRe, err := regexp.Compile(wl.File) + wlFileNameRe, err := regexp.Compile(wl.File) + if err != nil { + return cfg, fmt.Errorf("problem loading config: %v", err) + } + wlFilePathRe, err := regexp.Compile(wl.Path) if err != nil { return cfg, fmt.Errorf("problem loading config: %v", err) } whitelists = append(whitelists, Whitelist{ Description: wl.Description, - File: fileRe, - Regex: re, + File: wlFileNameRe, + Path: wlFilePathRe, + Regex: wlRe, }) } @@ -165,37 +180,32 @@ func (tomlLoader TomlLoader) Parse() (Config, error) { } cfg.Rules = append(cfg.Rules, Rule{ - Description: rule.Description, - Regex: re, - Tags: rule.Tags, - Whitelist: whitelists, - Entropies: entropies, + Description: rule.Description, + Regex: re, + FileNameRegex: fileNameRe, + FilePathRegex: filePathRe, + Tags: rule.Tags, + Whitelist: whitelists, + Entropies: entropies, }) } - // global leaks - if tomlLoader.Global.File != "" { - re, err := regexp.Compile(tomlLoader.Global.File) + // global file name whitelists + for _, wlFileName := range tomlLoader.Whitelist.Files { + re, err := regexp.Compile(wlFileName) if err != nil { return cfg, fmt.Errorf("problem loading config: %v", err) } - cfg.FileRegex = re - } - if tomlLoader.Global.Message != "" { - re, err := regexp.Compile(tomlLoader.Global.Message) - if err != nil { - return cfg, fmt.Errorf("problem loading config: %v", err) - } - cfg.Message = re + cfg.Whitelist.Files = append(cfg.Whitelist.Files, re) } - // global whitelists - if tomlLoader.Whitelist.File != "" { - re, err := regexp.Compile(tomlLoader.Whitelist.File) + // global file path whitelists + for _, wlFilePath := range tomlLoader.Whitelist.Paths { + re, err := regexp.Compile(wlFilePath) if err != nil { return cfg, fmt.Errorf("problem loading config: %v", err) } - cfg.Whitelist.File = re + cfg.Whitelist.Paths = append(cfg.Whitelist.Paths, re) } cfg.Whitelist.Commits = tomlLoader.Whitelist.Commits cfg.Whitelist.Description = tomlLoader.Whitelist.Description diff --git a/config/config_test.go b/config/config_test.go index 5150d935..48b2084a 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -54,13 +54,6 @@ func TestParse(t *testing.T) { }, wantErr: fmt.Errorf("problem loading config: error parsing regexp: missing argument to repetition operator: `??`"), }, - { - description: "test bad global message regex", - opts: options.Options{ - Config: "../test_data/test_configs/bad_aws_key_message_regex.toml", - }, - wantErr: fmt.Errorf("problem loading config: error parsing regexp: missing argument to repetition operator: `??`"), - }, { description: "test successful load big ol thing", opts: options.Options{ diff --git a/examples/leaky-repo.toml b/examples/leaky-repo.toml index db80933e..0f70ca2f 100644 --- a/examples/leaky-repo.toml +++ b/examples/leaky-repo.toml @@ -160,7 +160,8 @@ title = "gitleaks config" Min = "5.2" Max = "5.5" -[Global] +[[rules]] + description = "Files with keys and credentials" file = '''(?i)(id_rsa|passwd|id_rsa.pub|pgpass|pem|key|shadow)''' [whitelist] diff --git a/examples/regex_and_file.toml b/examples/regex_and_file.toml index f5ee271c..243da8e7 100644 --- a/examples/regex_and_file.toml +++ b/examples/regex_and_file.toml @@ -6,5 +6,7 @@ regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}''' tags = ["key", "AWS"] -[Global] +[[rules]] + description = "PEM Files" file = '''(.*)?pem$''' + tags = ["key", "PEM"] diff --git a/hosts/github.go b/hosts/github.go index 6d50b469..713b1526 100644 --- a/hosts/github.go +++ b/hosts/github.go @@ -161,7 +161,7 @@ func (g *Github) AuditPR() { if f.Patch == nil { continue } - audit.InspectString(*f.Patch, &commitObj, repo, *f.Filename) + audit.InspectFile(*f.Patch, *f.Filename, &commitObj, repo) } } page = resp.NextPage diff --git a/test_data/test_configs/aws_key_file_regex.toml b/test_data/test_configs/aws_key_file_regex.toml index 8cfc22f2..81b40e4f 100644 --- a/test_data/test_configs/aws_key_file_regex.toml +++ b/test_data/test_configs/aws_key_file_regex.toml @@ -8,6 +8,6 @@ regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}''' tags = ["key", "AWS"] -[Global] - file = '''(.*)?py$''' - +[[rules]] + description = "Python files" + fileRegex = '''(.*)?py$''' diff --git a/test_data/test_configs/aws_key_global_whitelist_file.toml b/test_data/test_configs/aws_key_global_whitelist_file.toml index 02d22f9a..dfc4b7ea 100644 --- a/test_data/test_configs/aws_key_global_whitelist_file.toml +++ b/test_data/test_configs/aws_key_global_whitelist_file.toml @@ -5,4 +5,6 @@ [whitelist] description = "ignore md files" - file = '''(.*)?md$''' \ No newline at end of file + files = [ + '''(.*)?md$''' + ] \ No newline at end of file diff --git a/test_data/test_configs/aws_key_global_whitelist_path.toml b/test_data/test_configs/aws_key_global_whitelist_path.toml new file mode 100644 index 00000000..0b84c5ea --- /dev/null +++ b/test_data/test_configs/aws_key_global_whitelist_path.toml @@ -0,0 +1,10 @@ +[[rules]] + description = "AWS Manager ID" + regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}''' + tags = ["key", "AWS"] + +[whitelist] + description = "ignore config folders" + paths = [ + '''config(uration)?''' + ] \ No newline at end of file diff --git a/test_data/test_configs/bad_aws_key_global_whitelist_file.toml b/test_data/test_configs/bad_aws_key_global_whitelist_file.toml index 5a8fdad5..10a6aba0 100644 --- a/test_data/test_configs/bad_aws_key_global_whitelist_file.toml +++ b/test_data/test_configs/bad_aws_key_global_whitelist_file.toml @@ -5,4 +5,4 @@ [whitelist] description = "ignore md files" - file = '''???????''' \ No newline at end of file + files = ['''???????'''] \ No newline at end of file diff --git a/test_data/test_configs/bad_aws_key_message_regex.toml b/test_data/test_configs/bad_aws_key_message_regex.toml deleted file mode 100644 index 863ce088..00000000 --- a/test_data/test_configs/bad_aws_key_message_regex.toml +++ /dev/null @@ -1,13 +0,0 @@ -[[rules]] - description = "AWS Secret Key" - regex = '''(?i)aws(.{0,20})?(?-i)['\"][0-9a-zA-Z\/+]{40}['\"]''' - tags = ["key", "AWS"] - -[[rules]] - description = "AWS Manager ID" - regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}''' - tags = ["key", "AWS"] - -[Global] - message = '''?????????????''' - diff --git a/test_data/test_configs/large.toml b/test_data/test_configs/large.toml index 7cd23c55..15d1bee7 100644 --- a/test_data/test_configs/large.toml +++ b/test_data/test_configs/large.toml @@ -135,11 +135,14 @@ title = "gitleaks config" file = '''(.*)?Jenkinsfile$''' # Global rules. This instructs gitleaks to ignore all .pem files or if a message with -[Global] - file = '''(.*?)(pem)''' - message = '''somethingbad''' +[[rules]] + description = "Files with keys and credentials" + fileRegex = '''(.*?)(pem)''' [whitelist] - description = "image whitelists" - file = '''(.*?)(jpg|gif|doc|pdf|bin)$''' + description = "File whitelists" + files = [ + '''(.*?)(jpg|gif)$''', + '''(.*?)(doc|pdf|bin)$''' + ] diff --git a/test_data/test_configs/regex_filename.toml b/test_data/test_configs/regex_filename.toml new file mode 100644 index 00000000..eab1877e --- /dev/null +++ b/test_data/test_configs/regex_filename.toml @@ -0,0 +1,6 @@ + +[[rules]] + description = "Generic password" + regex = '''(?i)(password|token).{0,20}?\s*[:|=]\s*?(?-i)([0-9a-zA-Z\/+]{4,40})''' + fileNameRegex = '''.*\.ya?ml''' + tags = ["key", "Yml", "Yaml"] diff --git a/test_data/test_configs/regex_filepath.toml b/test_data/test_configs/regex_filepath.toml new file mode 100644 index 00000000..0252df84 --- /dev/null +++ b/test_data/test_configs/regex_filepath.toml @@ -0,0 +1,6 @@ + +[[rules]] + description = "AWS Manager ID" + regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}''' + filePathRegex = '''config(guration)?''' + tags = ["key", "AWS"] diff --git a/test_data/test_configs/regex_filepath_filename.toml b/test_data/test_configs/regex_filepath_filename.toml new file mode 100644 index 00000000..f0ca3022 --- /dev/null +++ b/test_data/test_configs/regex_filepath_filename.toml @@ -0,0 +1,7 @@ + +[[rules]] + description = "Generic password" + regex = '''(?i)(password|token).{0,20}?\s*[:|=]\s*?(?-i)([0-9a-zA-Z\/+]{4,40})''' + fileNameRegex = '''.*\.properties''' + filePathRegex = '''config(guration)?''' + tags = ["key", "Yml", "Yaml"] diff --git a/test_data/test_local_owner_aws_leak.json b/test_data/test_local_owner_aws_leak.json index 5b68494d..7b06075c 100644 --- a/test_data/test_local_owner_aws_leak.json +++ b/test_data/test_local_owner_aws_leak.json @@ -271,5 +271,18 @@ "file": "secrets.py", "date": "2020-02-01T10:07:34-05:00", "tags": "key, AWS" + }, + { + "line": "aws_access_key_id=AKIAIO5FODNN7EXAMPLE", + "offender": "AKIAIO5FODNN7EXAMPLE", + "commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247", + "repo": "test_repo_6", + "rule": "AWS Manager ID", + "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, AWS" } ] 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 1d5b326d..ac786490 100644 --- a/test_data/test_local_owner_aws_leak_depth_2.json +++ b/test_data/test_local_owner_aws_leak_depth_2.json @@ -141,5 +141,18 @@ "file": "secrets.py", "date": "2020-02-01T10:08:04-05:00", "tags": "key, AWS" + }, + { + "line": "aws_access_key_id=AKIAIO5FODNN7EXAMPLE", + "offender": "AKIAIO5FODNN7EXAMPLE", + "commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247", + "repo": "test_repo_6", + "rule": "AWS Manager ID", + "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, AWS" } ] diff --git a/test_data/test_local_repo_one_aws_leak_and_file_leak.json b/test_data/test_local_repo_one_aws_leak_and_file_leak.json index edae0d97..f715fc51 100644 --- a/test_data/test_local_repo_one_aws_leak_and_file_leak.json +++ b/test_data/test_local_repo_one_aws_leak_and_file_leak.json @@ -1,30 +1,17 @@ [ { "line": "N/A", - "offender": "server.test.py", + "offender": "Filename/path offender: server.test.py", "commit": "d274003914c707212cbe84e3e466a00013ccb639", "repo": "test_repo_1", - "rule": "file regex matched(.*)?py$", - "commitMessage": "", + "rule": "Python files", + "commitMessage": "comment\n", "author": "zach rice", "email": "zricer@protonmail.com", "file": "server.test.py", "date": "2019-10-24T10:03:38-04:00", "tags": "" }, - { - "line": "N/A", - "offender": "server.test.py", - "commit": "6557c92612d3b35979bd426d429255b3bf9fab74", - "repo": "test_repo_1", - "rule": "file regex matched(.*)?py$", - "commitMessage": "", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "server.test.py", - "date": "2019-10-24T09:29:27-04:00", - "tags": "" - }, { "line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',", "offender": "AKIAIO5FODNN7EXAMPLE", @@ -37,5 +24,18 @@ "file": "server.test.py", "date": "2019-10-24T09:29:27-04:00", "tags": "key, AWS" + }, + { + "line": "N/A", + "offender": "Filename/path offender: server.test.py", + "commit": "6557c92612d3b35979bd426d429255b3bf9fab74", + "repo": "test_repo_1", + "rule": "Python files", + "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": "" } ] diff --git a/test_data/test_local_repo_six.json b/test_data/test_local_repo_six.json new file mode 100644 index 00000000..8c0cf9d7 --- /dev/null +++ b/test_data/test_local_repo_six.json @@ -0,0 +1,44 @@ +[ + { + "line": "api_token: exampleSecretPassword", + "lineNumber": 3, + "offender": "token: exampleSecretPassword", + "commit": "e7bf376f855ae9bc6e3bb27b5f9d65c57eba799d", + "repo": "test_repo_6", + "rule": "Generic password", + "commitMessage": "More secrets\n\n", + "author": "Noel Algora", + "email": "noealgigu@gmail.com", + "file": "config/config.yaml", + "date": "2020-02-19T04:08:26-05:00", + "tags": "key, Yml, Yaml" + }, + { + "line": "db_password_token: exampleSecretPassword", + "lineNumber": 3, + "offender": "password_token: exampleSecretPassword", + "commit": "e7bf376f855ae9bc6e3bb27b5f9d65c57eba799d", + "repo": "test_repo_6", + "rule": "Generic password", + "commitMessage": "More secrets\n\n", + "author": "Noel Algora", + "email": "noealgigu@gmail.com", + "file": "config/config.yaml", + "date": "2020-02-19T04:08:26-05:00", + "tags": "key, Yml, Yaml" + }, + { + "line": "aws_access_key_id=AKIAIO5FODNN7EXAMPLE", + "lineNumber": 1, + "offender": "AKIAIO5FODNN7EXAMPLE", + "commit": "95cf0237f8cdfc0686a29df08260d8635f46c9b0", + "repo": "test_repo_6", + "rule": "AWS Manager ID", + "commitMessage": "AWS Key in properties\n\n", + "author": "Noel Algora", + "email": "noealgigu@gmail.com", + "file": "config/application.properties", + "date": "2020-02-19T04:04:15-05:00", + "tags": "key, AWS" + } +] diff --git a/test_data/test_local_repo_six_filename.json b/test_data/test_local_repo_six_filename.json new file mode 100644 index 00000000..94002854 --- /dev/null +++ b/test_data/test_local_repo_six_filename.json @@ -0,0 +1,28 @@ +[ + { + "line": "api_token: exampleSecretPassword", + "offender": "token: exampleSecretPassword", + "commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247", + "repo": "test_repo_6", + "rule": "Generic password", + "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, Yml, Yaml" + }, + { + "line": "db_password: verySecretProductionPassword", + "offender": "password: verySecretProductionPassword", + "commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247", + "repo": "test_repo_6", + "rule": "Generic password", + "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, Yml, Yaml" + } +] diff --git a/test_data/test_local_repo_six_filepath.json b/test_data/test_local_repo_six_filepath.json new file mode 100644 index 00000000..005c7270 --- /dev/null +++ b/test_data/test_local_repo_six_filepath.json @@ -0,0 +1,15 @@ +[ + { + "line": "aws_access_key_id=AKIAIO5FODNN7EXAMPLE", + "offender": "AKIAIO5FODNN7EXAMPLE", + "commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247", + "repo": "test_repo_6", + "rule": "AWS Manager ID", + "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, AWS" + } +] diff --git a/test_data/test_local_repo_six_filepath_filename.json b/test_data/test_local_repo_six_filepath_filename.json new file mode 100644 index 00000000..f06fb5c6 --- /dev/null +++ b/test_data/test_local_repo_six_filepath_filename.json @@ -0,0 +1,15 @@ +[ + { + "line": "apiToken=d41d8cd98f00b204e9800998ecf8427e", + "offender": "Token=d41d8cd98f00b204e9800998ecf8427e", + "commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247", + "repo": "test_repo_6", + "rule": "Generic password", + "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, Yml, Yaml" + } +] diff --git a/test_data/test_local_repo_six_path_globally_whitelisted.json b/test_data/test_local_repo_six_path_globally_whitelisted.json new file mode 100644 index 00000000..988e26c1 --- /dev/null +++ b/test_data/test_local_repo_six_path_globally_whitelisted.json @@ -0,0 +1,15 @@ +[ + { + "line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',", + "offender": "AKIAIO5FODNN7EXAMPLE", + "commit": "6557c92612d3b35979bd426d429255b3bf9fab74", + "repo": "test_repo_6", + "rule": "AWS Manager ID", + "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, AWS" + } +] diff --git a/test_data/test_repos/test_repo_6/application.yaml b/test_data/test_repos/test_repo_6/application.yaml new file mode 100644 index 00000000..dd6e8207 --- /dev/null +++ b/test_data/test_repos/test_repo_6/application.yaml @@ -0,0 +1,3 @@ +appName: "Gitleaks-Testing-App" +api_token: exampleSecretPassword +db_password: verySecretProductionPassword \ No newline at end of file diff --git a/test_data/test_repos/test_repo_6/config/application.properties b/test_data/test_repos/test_repo_6/config/application.properties new file mode 100644 index 00000000..5cb000d0 --- /dev/null +++ b/test_data/test_repos/test_repo_6/config/application.properties @@ -0,0 +1,3 @@ +language=en_EN +apiToken=d41d8cd98f00b204e9800998ecf8427e +aws_access_key_id=AKIAIO5FODNN7EXAMPLE \ No newline at end of file diff --git a/test_data/test_repos/test_repo_6/dotGit/COMMIT_EDITMSG b/test_data/test_repos/test_repo_6/dotGit/COMMIT_EDITMSG new file mode 100644 index 00000000..60c9e47f --- /dev/null +++ b/test_data/test_repos/test_repo_6/dotGit/COMMIT_EDITMSG @@ -0,0 +1 @@ +comment diff --git a/test_data/test_repos/test_repo_6/dotGit/HEAD b/test_data/test_repos/test_repo_6/dotGit/HEAD new file mode 100644 index 00000000..cb089cd8 --- /dev/null +++ b/test_data/test_repos/test_repo_6/dotGit/HEAD @@ -0,0 +1 @@ +ref: refs/heads/master diff --git a/test_data/test_repos/test_repo_6/dotGit/config b/test_data/test_repos/test_repo_6/dotGit/config new file mode 100644 index 00000000..6c9406b7 --- /dev/null +++ b/test_data/test_repos/test_repo_6/dotGit/config @@ -0,0 +1,7 @@ +[core] + repositoryformatversion = 0 + filemode = true + bare = false + logallrefupdates = true + ignorecase = true + precomposeunicode = true diff --git a/test_data/test_repos/test_repo_6/dotGit/description b/test_data/test_repos/test_repo_6/dotGit/description new file mode 100644 index 00000000..498b267a --- /dev/null +++ b/test_data/test_repos/test_repo_6/dotGit/description @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/test_data/test_repos/test_repo_6/dotGit/index b/test_data/test_repos/test_repo_6/dotGit/index new file mode 100644 index 0000000000000000000000000000000000000000..9a4f995b2a1aae3afeab9316f260234519b743bc GIT binary patch literal 333 zcmZ?q402{*U|<4b=C}}faUjhAqd{y2Jv9*qhQ=jeHiXE!o7cqt(cq!*$@;j9K^D&^ z2u*nB#2}DZP>_?EoLG{XpQl%un41GO=PXDI&^#~=)@~r)gl1lR%m#)FU#7*)=HcKF zaqr#l*M3msID>3*eqLH;x<0b81x5JD{#FUy3F#ANDl*FacWUnYLQ+^YH^8PK_y6UNRX>5kWyvPHB>O 1571923767 -0400 commit (initial): commit 1 with secrets +6557c92612d3b35979bd426d429255b3bf9fab74 d274003914c707212cbe84e3e466a00013ccb639 zach rice 1571925818 -0400 commit: comment +d274003914c707212cbe84e3e466a00013ccb639 98b6c7cb3fb29a5993c4c95c56a2dc53050b9247 Noel Algora 1582571595 -0500 commit: Adding some secrets in config folder +98b6c7cb3fb29a5993c4c95c56a2dc53050b9247 98b6c7cb3fb29a5993c4c95c56a2dc53050b9247 Noel Algora 1582571636 -0500 discard: [bc379e22c22a97ca5ffc871c1449af854f6f26c4] diff --git a/test_data/test_repos/test_repo_6/dotGit/logs/refs/heads/master b/test_data/test_repos/test_repo_6/dotGit/logs/refs/heads/master new file mode 100644 index 00000000..1112c7db --- /dev/null +++ b/test_data/test_repos/test_repo_6/dotGit/logs/refs/heads/master @@ -0,0 +1,3 @@ +0000000000000000000000000000000000000000 6557c92612d3b35979bd426d429255b3bf9fab74 zach rice 1571923767 -0400 commit (initial): commit 1 with secrets +6557c92612d3b35979bd426d429255b3bf9fab74 d274003914c707212cbe84e3e466a00013ccb639 zach rice 1571925818 -0400 commit: comment +d274003914c707212cbe84e3e466a00013ccb639 98b6c7cb3fb29a5993c4c95c56a2dc53050b9247 Noel Algora 1582571595 -0500 commit: Adding some secrets in config folder diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/10/fa14c5ab0134436e2ae435138bf921eb477c60 b/test_data/test_repos/test_repo_6/dotGit/objects/10/fa14c5ab0134436e2ae435138bf921eb477c60 new file mode 100644 index 0000000000000000000000000000000000000000..c32cf91d44974fe535cf2b75e37623bbcbb69492 GIT binary patch literal 784 zcmV+r1MmEJ0fm%bZ__Xo#d)Ql;*wT$f0~2=FMx^!V~k0Rp|!kC3^%!H46Yq)XJZo| zp5r*BV@x3RA+>$)J@TEv_h8VmBU2=u-N+i_&7nWUB7FlBnQo z;i(obtRTM6+Gm_lWt1|PF=MD&a#SOYUZ;s6i0y;Mj+|+2!5PsUA)yDXHLY!oW0ELk zh)by3w6Te%pbC*kQDX<75>mO?gCK2mdd=35^TM}og3wK#kXpw1yNCh5}#@E#BmA2D{Is0Jr6u8;P>SuxKWin#wA&o+sPkKhfO+F^O^9$C0QsInxPc^d&q2y+I05 zU@Ct(v OU4)Rel7nBha@t(wn|DV5 literal 0 HcmV?d00001 diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/3a/76f3781306faf5612017bf18a4b4bdb9f927bf b/test_data/test_repos/test_repo_6/dotGit/objects/3a/76f3781306faf5612017bf18a4b4bdb9f927bf new file mode 100644 index 0000000000000000000000000000000000000000..0bd54d2c1d8cca5c8246d0dd18fc408854cbe069 GIT binary patch literal 138 zcmV;50CoR(0ZYosPf{>6GGlP@402{*U|<4b#@LPP6&Tys1%m19Dqlth1{UVIz3dDO zjZ4IRR{C1x%{mHH#@5g+bo7+Bh;sU5y#m*(q021)i1aY<6{i-Jr55Rxq!yRx6;uMv sV+aXybp=vv47!F223)+Ejk-r?-kftzqvgflt1p>^C*RQm066(7zoF4W0{{R3 literal 0 HcmV?d00001 diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/41/42082bcb939bbc17985a69ba748491ac6b62a5 b/test_data/test_repos/test_repo_6/dotGit/objects/41/42082bcb939bbc17985a69ba748491ac6b62a5 new file mode 100644 index 0000000000000000000000000000000000000000..dba982899e55860a4eb9fd52adc3deaa74d41f11 GIT binary patch literal 281 zcmV+!0p|XA0acJ&P6IIvMfuJuF6pQOL0Wamv=Q^!XXiH1wk zg=vZz}Pal`Ndeue!ODiC}gn+foU}Oq=ooe=^kN1UoO^YsFL< f<^bLNA~fc6c>uNl!{+PhK{s#uTfL|spbC+Vc>jt5 literal 0 HcmV?d00001 diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/49/8b267a8c7812490d6479839c5577eaaec79d62 b/test_data/test_repos/test_repo_6/dotGit/objects/49/8b267a8c7812490d6479839c5577eaaec79d62 new file mode 100644 index 0000000000000000000000000000000000000000..b558235fa77fbc9e56902bc61148d32e42a70755 GIT binary patch literal 77 zcmV-T0J8sh0ZYosPf{>9W(dv8OUzA8Q7B3+$S=+;$uFw3R!B|BEKw-Q$ShV!%gjkt jP)|uMPA9Zjg literal 0 HcmV?d00001 diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/5c/b000d0f4965e9b0c080814478dbf4e87c114c7 b/test_data/test_repos/test_repo_6/dotGit/objects/5c/b000d0f4965e9b0c080814478dbf4e87c114c7 new file mode 100644 index 0000000000000000000000000000000000000000..8226e0266b6e7ffe61314d45269678458f4b9075 GIT binary patch literal 111 zcmV-#0FeK90ZYosPg1ZnWynd)OD|1KPqj_Wi+A$eGm`)S literal 0 HcmV?d00001 diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/60/c9e47f150a6b713e247e6105b77f1b961f844f b/test_data/test_repos/test_repo_6/dotGit/objects/60/c9e47f150a6b713e247e6105b77f1b961f844f new file mode 100644 index 0000000000000000000000000000000000000000..e212d90f3fabd74203f9f743d042f0cde0bc711f GIT binary patch literal 23 fcmbBdhdwu^tQ1~wf8p^i(s0T zT2HqeOm$Cvty?mYbnd$p&zYJo)?BWL&a|~$Qhra_#ehHSSqI*Q-)@t3iM59A1KYt+VIRAuu?D5!oHdRkh=Z9l z4cA<$LrKOpU}jv3N|`|>qIcFqRj{m1r**9L8Xu$a!_IUIWNYV39ByH(eJ>{UqF597 z79A#4MEf0o26rK4{f4$2quwNfp^adhJk7qHf6nMt@57C7ZGztf9DKb}Y9MfuE!LUp zg2m!6Q|jU9;N;*x|CEB6n3=%31P63|h2F*$dLErh!J*m}qN?<2W-9tl*$bGj!zCY&NHlkQ(qMTiioLj@689l+~EN1AUr50RZ8Gd&+}$MZK3M99|M`{3Ice zX4u^@n%_}DbSwje%cj&AR@i`ni>=(lzX2VJjGjCN+>u+Y{zR{g!ofM6$)kXg3j~)& z2y6^kC)apPpy2J&qAo2R$pFH=hF<=}`InF{anG)ilLWz;Y%yeKBIKhGT-2UUUmQ~Q q!FR5FQcf<#NDkKR$-^;CUj~4gyfU=L3Y_JaCR(NFf%*+dC9pC^&}bt7 literal 0 HcmV?d00001 diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/65/57c92612d3b35979bd426d429255b3bf9fab74 b/test_data/test_repos/test_repo_6/dotGit/objects/65/57c92612d3b35979bd426d429255b3bf9fab74 new file mode 100644 index 0000000000000000000000000000000000000000..edf7d2fb0e62b9a281faba25dcfc481559bbccbd GIT binary patch literal 133 zcmV;00DAv;0iBIo3c@fD0R7G>_5w=MY#s#>uac}=5->*66``lMf+z56U|<;PtyKXN z<3R>9@XXH6ehKWRlrY{Hqsthr=bSYfqOb%)uhL6OAFw4VFe)*ew=c%^IlA;mOZ9%D n-Y#HVF!N-C4{+3|wc72z6#gsz)nMRVrNGKGSXT7`Tx&jrpjJOP literal 0 HcmV?d00001 diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/69/465772e5c3a14379da6c369cdb46edbaa6d097 b/test_data/test_repos/test_repo_6/dotGit/objects/69/465772e5c3a14379da6c369cdb46edbaa6d097 new file mode 100644 index 0000000000000000000000000000000000000000..e59352e95772e6098665f165dce21d63710f0d03 GIT binary patch literal 133 zcmV;00DAv;0V^p=O;s>7v}76N4wm*^E#GAz7%S^xFtz0Z;j75m%kznPziiJt@jRLC^s?si0n literal 0 HcmV?d00001 diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/6a/756416384c210ada2631f17862f5c01fffa478 b/test_data/test_repos/test_repo_6/dotGit/objects/6a/756416384c210ada2631f17862f5c01fffa478 new file mode 100644 index 0000000000000000000000000000000000000000..072ee533384e5be65d132e80b92e8d46ca29a11c GIT binary patch literal 946 zcmV;j15NyR0d16FYurW)DX-B86r5$B= zb>|DAzrF9QbPg{4cBh@4dFP#Hw(6v!%OAe~@w>xU=auv4u`LdZLt1&_C({odQ!DaF zu?}uXl!P`MT(hHXYZAFgrjjv#ub67-dzTX1B{JNau47BpjuvZ|=CcKDU24e-nXn#v z_9-rj9@>4CR>scaGC$$U9O}z29E4&rX+*syaX{fXI=?34$qYk~AvlwmdXCYonOuV$ zn!%ueijGMJN+>f)ggyj32(dR6T1+iE(LT>8;8Q<;X`G%3Er!75baSyR3fGW!6nIk( zCPb#PoK5-l-Rft$Ik&ty_hZ-5o15dy0%d)1VAjU@n65RX;4X4;a7cIFC1<)>)fHLS zG&DzQZ`==QM=3CqRDW}wzU4W3tr}Vr+j2Uh5@XQF=kljT;|lb7*U(PJY=(A&xyTkH z@a5|L?cE(|m)dir$Vj19Yz+L&#t3qbye#r1+%d6s?s_U-i*MW--B%)Awl6MU#GPvO zKiIke=>$%O36+>Ehp;U8iEFyNIew#Yw?Sg0p);wG&=ZEL4P$!jZI-%EskCovY=Pjv`|ME^ofp-m4V*`;On-CztfNx^uqk1Yp2qt`B-L`|aoqrcB1thQ$a2WgOi4qWGyAfflt zVW^QVFHRzzk1^zJPvP{8qVsjeQJsjNM-zB20PC9oMvEmw0i|lqsO9L^9(!je zY0KgO!HFh1GRtLIo4Q3nSt??s_-=>adRBrvn0LLR@(Ug9q5oPO5Z&MYwYtB*zSX8n zOD7+w{O8lhixc`v+nUPyRBgPN7pull-oE|#?)P7ccOgi)q7|MXEKY{Ts&_A0Csl$q zeo)eDY*}s8bpQwA`-sQm#ky=IJWhihSoA#cSW@=z$7sE|wjb73&%sOtf!|_U`Ki U?AIJ_Y5s+)Q~BHc07G9gA$trp-T(jq literal 0 HcmV?d00001 diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/6c/bef5c370d8c3486ca85423dd70440c5e0a2aa2 b/test_data/test_repos/test_repo_6/dotGit/objects/6c/bef5c370d8c3486ca85423dd70440c5e0a2aa2 new file mode 100644 index 0000000000000000000000000000000000000000..b098b0b66e206a72124d32206debad73e240f4ee GIT binary patch literal 2176 zcmV-`2!Ho@0hL($Z`;Tb?yursF{h}tlCB;Yhx@e zWu`QQ*14r9WUSEE&`Rai8XM-g{#7lQ)WrG?_S= zrZ!efQMwx=buJBUg&|n<5xN)>Hlo2IE?8<&r5o7HdcCzP8Y)e)tnH4r8(I0s{N7pD zXw8=Tg`)@?4m6^y3rS|9wgz6^l2v=Zs5(!>8bGoeVM)Nrq5#^}4v*~jG=-(S13YX)b+asTv%x-_+*qY|(Q_}l>|bvkKJ9O zV414;J*kXJVPL|P=%qn^(Cc3~mOfy(KjA&jm5aR$DiQjkaCu?y-Z>1kan73jcW>v- z4Sj({=|<7BzbvT#3MtbtXFYX;JA%#g&051a`XQ$U_DQnZ9R-t)X>j`H$A7;&ygUle zOS5JVKaLU`v<+@$-0PzC`#f?Xj}`st`>G$*4FBALK7zth)SSM(-t5Eh-QnbWG086f zI-(iN_lD?P$Ioa!;=5Zib&=cQ?0q#G2YB;K_X_Qc7`rTFNyApowI1Re%5BmJPlu-S-w@gZX7}VUNY|J!p%~zQ8b~{{FV5o-6iqm;FEd@c#Vu z+0~0z=Sgyb9v7Rkn<e(vSGPS7bphRB9JIo>9+PAH{DF!_N<5*-I0 zGC5Cc-feF&)VOBBT_M`)<{mgXkioA`H=NZvvHQR9>rZf<9jG#;05qjEZe%(^FMt z`MS|!iIEg9lfjQKFRspCzM1(qz{+8mIocn=@Mx@c47DPxyQepn` zam*($YbN?9ALc-I3?>LXvLVPGH{B)xfIMA%@L=Na^v9HFe_T+Hs|8e*=UGn zzY#Tf>=}*I81jZVc}9pGPDUGFfuY&052Yr8Kp_4h?SY|!55+j6xuggg3hwuMAds3& zCV%)1S?X5In0ENY{|~NNieCz7=I@eDS?2Bn2(e68$ya3f5k65eg|_xf&;3h&pRgr- z(fPUu?$7)7G75I(mJZ_C9mycq731su$E%z4W}ExdCQ{(pGsnp@Q0qWps)P_04HBQ z|HC7^tE_NB(qb)>=MOf%;09gR4JLM!ZYHt+VJ95+;(6wS_a=9&Z%Bk#IthP{KtfB@ z1!VR(WI8*)V<6@h7T=rK1+#bv#yfU8by$ED^}uByyy||BiACVsr7(%(-~Rym!v%V@ C_Bz%8 literal 0 HcmV?d00001 diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/80/8b12c5ca4b142367932e7045d555a639fc148c b/test_data/test_repos/test_repo_6/dotGit/objects/80/8b12c5ca4b142367932e7045d555a639fc148c new file mode 100644 index 0000000000000000000000000000000000000000..9cd8d69460c86bbcd9b032b9c98776f077f08c21 GIT binary patch literal 209 zcmV;?051P{0Zorji^4Dv#XaX!4D`?yMX<7Z@=$I4!@4ShsHc)<1`XB(GQp+aeq&W| zPH$j-@4YE2TS78SS`lOxjP-Dl4nbKYP>zs{*Ro=vDjg(@p|su(de8MsK$w^Zako(s zEZ#5zd#BBrLGq_jx5;p%?CnMd340AG|G1D!5p!{+y3ja|)1PI!+;X&yJ} zSKao%?;|PMw46E3I-@`pk$3#=?z@ktMXna~=G)o%H{Dm$MJA^@jk-~n-boUl_ejwG9Hm0@1DYyih6^T#^<>(>4_*6~%F=+bqv% zA;|ebh?&IE*y{WgVxx3sR8dWczOQI05?GdM&r-KdOv=+ zy}$YJ3!{%$7LklPB2LjZH;$J@X>kHb-R!QVE$}#iF=2FlcF`EpYdEh|Nn0+>$UViX zwEbIdHb_r>pgWA<|InCv=kyj~UDI114<39l*Mnx~Cs1b=C0P`NQD=hDSoyfT_5N?~ zwc$<~o-^ES99SMY@=>A+k_s~DNd<9;Hii0K#KyjYM-BBD3+m7Q z=2PEfAv4Hwr;Gb>d@u{(rA}30?rUfB-koT zO&|M?$2Rz#+S$s2kQ=_j#L=iCe0jm@bRbzB%b|n3`SSR@)wF=qRx11g-ang&8#_4I zfxutNFNpXgN*wJWw(A-eY}f1uDCz8s{J8gsQLjKcdv)>Yn$XpcQ(0nqy0|`@A!>gI zg$1}p-usP7AH~B&v8*tQX4>c=%kJ8;&Ha-bTV9ZZz{%4|NO5ADagEh{tvzWxc`6V{Li;sv-@2XT6gZMlA$rl^Ro&wj)x3Z;J5!cXqFz&@9#O z+{cX@FfO5g4^nNRX;6Jq3HdJ{D@y3MebZsZ?WpgMTF%`Bx0kBcP4`14Go4~~by{{F J{R5J=dNhq_Y9s&v literal 0 HcmV?d00001 diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/98/b6c7cb3fb29a5993c4c95c56a2dc53050b9247 b/test_data/test_repos/test_repo_6/dotGit/objects/98/b6c7cb3fb29a5993c4c95c56a2dc53050b9247 new file mode 100644 index 0000000000000000000000000000000000000000..f3467bbd4d3b4c11f03a43f5954b6cf9619053b7 GIT binary patch literal 176 zcmV;h08jsT0iBN9ZNwlD0P{^1+d!fP7GtDSlxrY8;AKsactn`%KdvFaGa6}lv{n`v zXWrHnfs{Cf$Xh@P4ihu&LX31oBNig53zG4KXoDuctwnaqL zmigFhQ1P{X#)R)76`nPZ8R5}~#F|TfedQKQ{ov6)LA%{JuU&BPjt)`X^j=)@uUI`( eDm}wBn!qJIWnEA@@aSjBaE_W}D)k3TXHVivi&aAa literal 0 HcmV?d00001 diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/9e/523225b31add24e72f2feb0b2645cfb36542dc b/test_data/test_repos/test_repo_6/dotGit/objects/9e/523225b31add24e72f2feb0b2645cfb36542dc new file mode 100644 index 00000000..2103921e --- /dev/null +++ b/test_data/test_repos/test_repo_6/dotGit/objects/9e/523225b31add24e72f2feb0b2645cfb36542dc @@ -0,0 +1,3 @@ +xMŽO ‚@Å;ï§è`‘%:XjE ¢<ɺ;˜¤»°³~ûÌ +z§÷`~ïMVê Fþ´Ó…PƒÒnÜHZ"ƒ•-xIL”Eca™¶Ú÷>±Ç ‘C¾ã¶® «,�¬)TNÀé¿Èm7 +]U¨$J¯%ù“R.¥w¬ÓBΜ`³Ö‡q|÷ûIt vÇmôÝy_6ïÙ?¨!æ‹0Šb´�ÔW\>ε9æ …êr:-†Aò+a}Æ^K§N$ \ No newline at end of file diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/a1/ddd32febf3bde66331218f877ff637c85c5f92 b/test_data/test_repos/test_repo_6/dotGit/objects/a1/ddd32febf3bde66331218f877ff637c85c5f92 new file mode 100644 index 0000000000000000000000000000000000000000..0867e75c9a688924acd123a3cee57ab17c13a56b GIT binary patch literal 208 zcmV;>05AV|0Zot1s=_c3g)|3Dg0e`U93dI6WywO7I!G8pVZH5lUTaf8n3(%jLRGAYaAIcw literal 0 HcmV?d00001 diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/a1/fd29ec14823d8bc4a8d1a2cfe35451580f5118 b/test_data/test_repos/test_repo_6/dotGit/objects/a1/fd29ec14823d8bc4a8d1a2cfe35451580f5118 new file mode 100644 index 00000000..b72c5f77 --- /dev/null +++ b/test_data/test_repos/test_repo_6/dotGit/objects/a1/fd29ec14823d8bc4a8d1a2cfe35451580f5118 @@ -0,0 +1,3 @@ +xuPMOÃ0 åÚüŠGV1lc.LEB`†Ä¸!Miç*a]R5!þ;N‡øââÄö{ÏÏÎ+—ãìôt§³;Ì�z-:¢ƒK zQ«º"hç–ðEcê€à°RKÂÚ\‰zí5\Œ³~À¬™¦/š7Ì~Ú‘‡ªª_h­|PMÀÆ�næªXf]Rv�†ž¨ßTVÙh²Ì$ÈmSþÔ„ñÑׂ�D+dUÎþƒæF\âˆ%­Z}VJ{²n¨ßPAæ™ä@S"�è[Èôz2›ß=Üß̧w³Éôv~5}¸�IÁ¬HLv,’�nu"C¦F¢_ÅÏ?¼dáD’гª 9¬){üeÆŠ/,Ó$axZòu ƒgm +‹(·jÏòc•~Üøé[+Ñ9ÈÞ%.öN"s<æ¸=àVéŌ⯠+~L–îïbÔãþÂY¥eMª$ \ No newline at end of file diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/a4/fa2187727281aea78d7c3aaebdb4b924fc4e4d b/test_data/test_repos/test_repo_6/dotGit/objects/a4/fa2187727281aea78d7c3aaebdb4b924fc4e4d new file mode 100644 index 0000000000000000000000000000000000000000..0aabdd404ead93e87747db7463148dcfc4406264 GIT binary patch literal 57 zcmbOuDK-kgbrAKuAb%2QHA^dN)z?r`Std5O*i(wxzt< z<8Q{(x!A$u)AQBhdezymA|n=J0q+5Dr+sn=CdLg=pKW5`2))6618flb=)GldaRiS< zdPHEo!2sR95OhjzpEUOdh8#WULR4N`cM`V;qmKfb9Za0uy0{kP*0O;RgZjc8fmriI zpa;ebmT0nJEV$Vt$CRyRJW;_8PzgFP)wsklU8HRR&W@HU!nwG`b(P|}99}$jdTOu^ zk70`_=&qE)#?m48J>)X-$4Qk|l>GZ%c^YLaL<^&3MMe?wl*C+K*}clt!8Zn-Acho3~C3mIU^)2m!&xD{|}q*hdbH4$sh3|egWDEqwx$qkTC!N literal 0 HcmV?d00001 diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/b5/8d1184a9d43a39c0d95f32453efc78581877d6 b/test_data/test_repos/test_repo_6/dotGit/objects/b5/8d1184a9d43a39c0d95f32453efc78581877d6 new file mode 100644 index 0000000000000000000000000000000000000000..043d9c546046fd8e97c51aa441fc04770e35a2e1 GIT binary patch literal 529 zcmV+s0`C2I0ezC&Zqq;zhPjQO;>U@|L2;~bfdHwI3PI2tDpB`}kZNs@?N#kvcX!=# z2=C6U-H3n?H&HU4`43;5);h(@S1+E7pT?Skk)oml@JP|ZH;b? z6poIOAq#i~p&UDEKGm&vW|blO>cmsBW?kzC?#HW?^Wh1I$B^(nm;@^%yre|R5M9N$ zKKBxaM_js}_*E|z4qj1X%WxI&<+bt?#?%|6#HM~vLt={uxbsp!cg=(5Nq|o`L@x9z%<+64vz literal 0 HcmV?d00001 diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/bc/379e22c22a97ca5ffc871c1449af854f6f26c4 b/test_data/test_repos/test_repo_6/dotGit/objects/bc/379e22c22a97ca5ffc871c1449af854f6f26c4 new file mode 100644 index 0000000000000000000000000000000000000000..ad8ee05b479c62be3ecdc997879e1cd70d7c4904 GIT binary patch literal 195 zcmV;!06hPA0iDiEY6CG4MbV6V6}16}Zhb8XA%={dQ5H}tRm%c>f+T1C(Hb&)TsZKk zm69e1t6pYj2IG{`)(X}n@levbfQF=T6udGVJfaD^v)d1Lt`pqV8?xl(>4ih>oFqj~ zlQt*&ptv1FSQ+$5Jf+@dJEAMdVtI+l^(!gcueOq;1 xocu4m4gBQ*-}lciNcC*J;7qN;TF`m$1bSeNJOFEekOpB73!EwQ_yhQ*Ss;z>UgQ7( literal 0 HcmV?d00001 diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/c9/8e6c52cbd1f50de572ff12a3441271fccff705 b/test_data/test_repos/test_repo_6/dotGit/objects/c9/8e6c52cbd1f50de572ff12a3441271fccff705 new file mode 100644 index 0000000000000000000000000000000000000000..14206b0be8055a643e766f4891228035eb86c109 GIT binary patch literal 158 zcmV;P0Ac@l0ZYosPf{>6F=cS^402{*U|<4b#@LPP6&Tys1%m19Dqlth1{UVIz3dDO zjZ4IRR{C1x%{mHH#@5g+bo7+Bh;sU5y#m*(q021)i1aY<6{i-Jr55Rxq!yRx6;uMv zV+aXybp=wA42B8@T>m~x@=YnSt7xg(`Qg?o(Y06pUwMDDPPCEZ!SShDS_fbL%zb99 MyDotZ0RKTY9%ztF9RL6T literal 0 HcmV?d00001 diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/cb/089cd89a7d7686d284d8761201649346b5aa1c b/test_data/test_repos/test_repo_6/dotGit/objects/cb/089cd89a7d7686d284d8761201649346b5aa1c new file mode 100644 index 0000000000000000000000000000000000000000..17c8d93ced73ec5db532487582e5971988714a58 GIT binary patch literal 37 tcmbGp0iBLZ3Iib!1+(@PeSrkOqYWYCDy_E6KpY1#n>l?Jt4f_zRr-(&nB2tcWwxwjtMI6+5AFw#*6Y53jY@%`KF=nfmIn>TY z6AKoK-U@n;wRJcttiG%-=fA$O& IAAFxjc?OwAqyPW_ literal 0 HcmV?d00001 diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/db/4ccd6cc9ef282e9bf2f8c5f7877f0d40520724 b/test_data/test_repos/test_repo_6/dotGit/objects/db/4ccd6cc9ef282e9bf2f8c5f7877f0d40520724 new file mode 100644 index 0000000000000000000000000000000000000000..7f8431777a0b401f45298e1a0df6364593149613 GIT binary patch literal 67 zcmV-J0KETr0V^p=O;s>8U@$Z=Ff%bxNGvGG$xKcx$;{8wD=5k@NG&SKOf6=J*}!n& Z%e1)JJRBS%?!Ei{+7F5x2LL$x6(>ml8+8Bx literal 0 HcmV?d00001 diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/dd/6e8207f130e113c97f5ed15238e7901290ee42 b/test_data/test_repos/test_repo_6/dotGit/objects/dd/6e8207f130e113c97f5ed15238e7901290ee42 new file mode 100644 index 0000000000000000000000000000000000000000..db5b596edb2959c3cae95e467f751e8a9afaa2fe GIT binary patch literal 106 zcmV-w0G0oE0ZYosPf{>6Fk?t8DDX?nO|?=`a?dQuNlnZy)(uH5F3HSG*L5r?P~u7~ z$c!(^&rZ#=Qb?^x%q_@C4NgriN-YUUEG{n3FG}G`Ns2FkvaJ-#Qj02~@7v}76N4wm*^E#GBk7x9X;hOqMSZiufX+c=rYScB0T^q{W1q<5I?m5 literal 0 HcmV?d00001 diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/e6/73bb3980f3c286291809e05f80873852bc3e9c b/test_data/test_repos/test_repo_6/dotGit/objects/e6/73bb3980f3c286291809e05f80873852bc3e9c new file mode 100644 index 0000000000000000000000000000000000000000..144d4077bbfa5593abd0ed2b1ae93b259fa6873e GIT binary patch literal 1646 zcmV-!29f!A0hL$pPa8Q9y|0_UV!A|1QjsieKinx4t`+@poGL&qy`EGka(11>Wn(Y4 zmo%dEZ@)M8E&+OXYWV<(?HSL!dGkC>N;9D+PagmJ%f^GOb~c+RomJA7olfl}Id4_& zx5MY9uv+Pvi{JK-_QvDGO6tekoz4b5*CfA)MO8|g8*@%Bx2p2w4JqyA%nC2*gYfx$ zAvBKn=iXOtoMlsy%LxodGv(*?WTZ^CY>s6ET4Ir~!+u;PWkGdCh4eD_hy;GLT$0cQ zEli=N3j0%4N;m3kVDEU|#G)Kk!a3{;x|G%_qp6?Q)=KTm6+IdR7lOQ6NQ6sTXyasV zbm8D;YV1OI&(;nO7!f@S7N+)9?Oh1Y7x+e^EMo-Z=fcxmTuPcq$r;~7=#S;jzoE`J^?*lbON|e_I-R&M|l^WeCK{N-)9&O;#KtHc^Lz z_iq{?3`s2}Sn_jV!S&h16N3Ow+M#F9-@g7U5NB^L^Yf5a;0?3IGAY_hbvkOg zc0oHkT(7H6vcb{7vAQBx>I{#?{-7 z$$dJcop01zxRvYC*RRxV7V_0>sdO*od)E+YeNg(z?F%>XKUp}t*j)N{fiMVkH>j**~Dz6w<}!v2o)vr&f3Qit))@^y({QNGu)>Xg)f+@;!Ld-G=wv`s0lpSv z>OS}x{FyTQXg4%aC@=I1*SMet6Iq%iEoBd|2p5_QZ4YKGq(k4`>ghndxzIDPBzAJ7 z*#zCclrY!mRBwfL3hF|AFe|q*^ro1C+HAkJ(1uC_UlzeA=Lg`@2A?=KB=X!qPL-R7 z9^GuBtGT&D5^1oVU_I8RKzb~n zDYUaJT*}8vwP3-GPNKx|a?pqd5M8cDEU)_epw^(mnY0U-axl}{!lUJ$g@6i(EWRQ{ zSC<}g-DHiW9D&UY*ap$65)}6>ISJ5d{uy(B|a|=I<(ygYb;woa0dQ8v>} zO7C_cRv<1((o_nBW%=6-OAX*-`j|4P>1kZP1z*@Q9!@@{kQOrypJLG)CB=;~JD9Vh za5@bEyY%$*6gOSt7Xn5272YjRp#k>~s2egt_&^7oX_oPwdlq%6P$-GUEeu@&M^REY z+oq>&|L$I+?W1mfXrAjaio3w;UZAYLwi*ordPf5NgisRXejR|kpp-!l{r^8VDUDh} zY2tN2x=rE76@qGw(ZQ`vS(CF*Csz>92+L<@^jUR2Lp&1Kh2pki`scgDgYo$9ci2n1 z?Lpv|wi|&e5YXhBSkC|}PTsXXI{FXmqa(HskaKwq{NCI#+y$|RyS1PGHry@n_7$>! zlRb-b65h`!;k&dI`n_w0yI0a$W3Rvaj;t41-OLMyd(@PeM8XI%dI%+kut06_u8$rL z2=fFhUQlpZU}WR8BGujf&;!L9K3T>J>}aXvnmfHA~895N^u zUv9?2=H&feLzR+9lULz+VD}4g&T0{-&c^P37%eq_U&=yl+r9R!^gQ9s}_z*mGRDfe|FR8MI5D-!W%Pk>Ts5{we}yZ9Ch+baCPBo&IV<}Vil s|FdAcmITIy*&-ctJ8*Q3bZv4c#&{z)pIwE^!@F{gK(9Oh0QinDkobiyOaK4? literal 0 HcmV?d00001 diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/e9/e5396f7e52aa48de485b4836ebb041cc7f7c46 b/test_data/test_repos/test_repo_6/dotGit/objects/e9/e5396f7e52aa48de485b4836ebb041cc7f7c46 new file mode 100644 index 0000000000000000000000000000000000000000..da7e1c7c4610280c50c51ee98c9c92925d129f44 GIT binary patch literal 59 zcmV-B0L1@z0V^p=O;s>4VlXr?Ff%bxC{8UZOD)nXNi8nXE2w0c7i6TmS?aFJbAA2S R+-k1pH>Wz?0RWT25#mb?7wrH5 literal 0 HcmV?d00001 diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/ec/17ec1939b7c3e86b7cb6c0c4de6b0818a7e75e b/test_data/test_repos/test_repo_6/dotGit/objects/ec/17ec1939b7c3e86b7cb6c0c4de6b0818a7e75e new file mode 100644 index 00000000..d7558de5 --- /dev/null +++ b/test_data/test_repos/test_repo_6/dotGit/objects/ec/17ec1939b7c3e86b7cb6c0c4de6b0818a7e75e @@ -0,0 +1,2 @@ +x-ÍK‚0P×9E [�r§Kïà&0H +Ȥ&ƒ…·7~–Ý]õÚ/âq¾\õ±ó!vyrµ«q‹à�Ö´0&‘¹×� &Hʉ”AHÔÏ< dÉÁD_E±e†