From fae366a404357fa6c6611756a11e61546ebec4e0 Mon Sep 17 00:00:00 2001 From: Zachary Rice Date: Wed, 12 Aug 2020 17:18:25 -0400 Subject: [PATCH] Global allowlist regex (#422) * work in progress * Update test configs * adding test * golint and change to allowlist * fix race condition, this mistakenly got committed * Updating tests and examples * bump to v6 as this is a breaking change to the config * More consistent variables --- Makefile | 2 +- config/config.go | 154 ++++++++++-------- config/config_test.go | 4 +- examples/leaky-repo.toml | 50 +++--- .../simple_regex_and_allowlist_config.toml | 6 +- go.mod | 2 +- hosts/github.go | 6 +- hosts/gitlab.go | 6 +- hosts/host.go | 2 +- hosts/hosts_test.go | 6 +- main.go | 10 +- manager/manager.go | 6 +- manager/manager_test.go | 4 +- options/options.go | 2 +- scan/repo.go | 10 +- scan/rule.go | 56 ++----- scan/scan.go | 7 +- scan/scan_test.go | 16 +- .../test_configs/aws_key_allowlist_files.toml | 14 +- .../aws_key_allowlist_python_files.toml | 4 +- .../test_configs/aws_key_aws_allowlisted.toml | 4 +- test_data/test_configs/large.toml | 16 +- .../large_with_global_allowlist_regex.toml | 151 +++++++++++++++++ test_data/test_configs/regex_filename.toml | 2 +- test_data/test_configs/regex_filepath.toml | 2 +- .../test_configs/regex_filepath_filename.toml | 4 +- test_data/test_local_owner_aws_leak.json | 15 ++ ...t_local_owner_aws_leak_allowlist_repo.json | 15 ++ .../test_local_owner_aws_leak_depth_2.json | 15 ++ test_data/test_local_repo_nine_aws_leak.json | 17 ++ .../test_repo_9/dotGit/COMMIT_EDITMSG | 1 + test_data/test_repos/test_repo_9/dotGit/HEAD | 1 + .../test_repos/test_repo_9/dotGit/config | 7 + .../test_repos/test_repo_9/dotGit/description | 1 + test_data/test_repos/test_repo_9/dotGit/index | Bin 0 -> 145 bytes .../test_repo_9/dotGit/info/exclude | 6 + .../test_repos/test_repo_9/dotGit/logs/HEAD | 3 + .../test_repo_9/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 .../60/c9e47f150a6b713e247e6105b77f1b961f844f | Bin 0 -> 23 bytes .../61/87dbf4390fc6e28445dd3d988aefb9d1111988 | Bin 0 -> 708 bytes .../65/57c92612d3b35979bd426d429255b3bf9fab74 | 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 .../8d/1fb60d2d80f0590f191ed5ace1e45ef780909a | 2 + .../9e/523225b31add24e72f2feb0b2645cfb36542dc | 3 + .../a1/fd29ec14823d8bc4a8d1a2cfe35451580f5118 | 3 + .../a4/fa2187727281aea78d7c3aaebdb4b924fc4e4d | Bin 0 -> 57 bytes .../a5/196d1be8fb59edf8062bef36d3a602e0812139 | 1 + .../a5/d7b84a673458d14d9aab082183a1968c2c7492 | Bin 0 -> 299 bytes .../b5/8d1184a9d43a39c0d95f32453efc78581877d6 | Bin 0 -> 529 bytes .../c1/f3c6341548a65be1eded56b4f7cacec7fe9090 | Bin 0 -> 59 bytes .../c9/8e6c52cbd1f50de572ff12a3441271fccff705 | Bin 0 -> 158 bytes .../cb/089cd89a7d7686d284d8761201649346b5aa1c | Bin 0 -> 37 bytes .../cb/19a50e8cdeb7011eccdb13f3b739f00d775bab | 2 + .../d2/74003914c707212cbe84e3e466a00013ccb639 | Bin 0 -> 154 bytes .../e6/73bb3980f3c286291809e05f80873852bc3e9c | Bin 0 -> 1646 bytes .../e9/e5396f7e52aa48de485b4836ebb041cc7f7c46 | Bin 0 -> 59 bytes .../ec/17ec1939b7c3e86b7cb6c0c4de6b0818a7e75e | 2 + .../f9/f2f36962fa38ca4525b99ef702fba03e3a79a7 | Bin 0 -> 220 bytes .../fe/f3190e94723e78847ab9f0daaa15add4ffd4ef | Bin 0 -> 58 bytes .../test_repo_9/dotGit/refs/heads/master | 1 + .../test_repos/test_repo_9/server.test.py | 9 + 69 files changed, 449 insertions(+), 204 deletions(-) create mode 100644 test_data/test_configs/large_with_global_allowlist_regex.toml create mode 100644 test_data/test_local_repo_nine_aws_leak.json create mode 100644 test_data/test_repos/test_repo_9/dotGit/COMMIT_EDITMSG create mode 100644 test_data/test_repos/test_repo_9/dotGit/HEAD create mode 100644 test_data/test_repos/test_repo_9/dotGit/config create mode 100644 test_data/test_repos/test_repo_9/dotGit/description create mode 100644 test_data/test_repos/test_repo_9/dotGit/index create mode 100644 test_data/test_repos/test_repo_9/dotGit/info/exclude create mode 100644 test_data/test_repos/test_repo_9/dotGit/logs/HEAD create mode 100644 test_data/test_repos/test_repo_9/dotGit/logs/refs/heads/master create mode 100644 test_data/test_repos/test_repo_9/dotGit/objects/10/fa14c5ab0134436e2ae435138bf921eb477c60 create mode 100644 test_data/test_repos/test_repo_9/dotGit/objects/3a/76f3781306faf5612017bf18a4b4bdb9f927bf create mode 100644 test_data/test_repos/test_repo_9/dotGit/objects/41/42082bcb939bbc17985a69ba748491ac6b62a5 create mode 100644 test_data/test_repos/test_repo_9/dotGit/objects/49/8b267a8c7812490d6479839c5577eaaec79d62 create mode 100644 test_data/test_repos/test_repo_9/dotGit/objects/60/c9e47f150a6b713e247e6105b77f1b961f844f create mode 100644 test_data/test_repos/test_repo_9/dotGit/objects/61/87dbf4390fc6e28445dd3d988aefb9d1111988 create mode 100644 test_data/test_repos/test_repo_9/dotGit/objects/65/57c92612d3b35979bd426d429255b3bf9fab74 create mode 100644 test_data/test_repos/test_repo_9/dotGit/objects/6a/756416384c210ada2631f17862f5c01fffa478 create mode 100644 test_data/test_repos/test_repo_9/dotGit/objects/6c/9406b7d9320db083eca69b3f8bee9a6c7b50d4 create mode 100644 test_data/test_repos/test_repo_9/dotGit/objects/6c/bef5c370d8c3486ca85423dd70440c5e0a2aa2 create mode 100644 test_data/test_repos/test_repo_9/dotGit/objects/80/8b12c5ca4b142367932e7045d555a639fc148c create mode 100644 test_data/test_repos/test_repo_9/dotGit/objects/80/ba94135cc378364af9d3cb2450df48e51faf2c create mode 100644 test_data/test_repos/test_repo_9/dotGit/objects/8d/1fb60d2d80f0590f191ed5ace1e45ef780909a create mode 100644 test_data/test_repos/test_repo_9/dotGit/objects/9e/523225b31add24e72f2feb0b2645cfb36542dc create mode 100644 test_data/test_repos/test_repo_9/dotGit/objects/a1/fd29ec14823d8bc4a8d1a2cfe35451580f5118 create mode 100644 test_data/test_repos/test_repo_9/dotGit/objects/a4/fa2187727281aea78d7c3aaebdb4b924fc4e4d create mode 100644 test_data/test_repos/test_repo_9/dotGit/objects/a5/196d1be8fb59edf8062bef36d3a602e0812139 create mode 100644 test_data/test_repos/test_repo_9/dotGit/objects/a5/d7b84a673458d14d9aab082183a1968c2c7492 create mode 100644 test_data/test_repos/test_repo_9/dotGit/objects/b5/8d1184a9d43a39c0d95f32453efc78581877d6 create mode 100644 test_data/test_repos/test_repo_9/dotGit/objects/c1/f3c6341548a65be1eded56b4f7cacec7fe9090 create mode 100644 test_data/test_repos/test_repo_9/dotGit/objects/c9/8e6c52cbd1f50de572ff12a3441271fccff705 create mode 100644 test_data/test_repos/test_repo_9/dotGit/objects/cb/089cd89a7d7686d284d8761201649346b5aa1c create mode 100644 test_data/test_repos/test_repo_9/dotGit/objects/cb/19a50e8cdeb7011eccdb13f3b739f00d775bab create mode 100644 test_data/test_repos/test_repo_9/dotGit/objects/d2/74003914c707212cbe84e3e466a00013ccb639 create mode 100644 test_data/test_repos/test_repo_9/dotGit/objects/e6/73bb3980f3c286291809e05f80873852bc3e9c create mode 100644 test_data/test_repos/test_repo_9/dotGit/objects/e9/e5396f7e52aa48de485b4836ebb041cc7f7c46 create mode 100644 test_data/test_repos/test_repo_9/dotGit/objects/ec/17ec1939b7c3e86b7cb6c0c4de6b0818a7e75e create mode 100644 test_data/test_repos/test_repo_9/dotGit/objects/f9/f2f36962fa38ca4525b99ef702fba03e3a79a7 create mode 100644 test_data/test_repos/test_repo_9/dotGit/objects/fe/f3190e94723e78847ab9f0daaa15add4ffd4ef create mode 100644 test_data/test_repos/test_repo_9/dotGit/refs/heads/master create mode 100644 test_data/test_repos/test_repo_9/server.test.py diff --git a/Makefile b/Makefile index 17d6a9ba..01519bf4 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ VERSION := `git fetch --tags && git tag | sort -V | tail -1` PKG=github.com/zricethezav/gitleaks LDFLAGS=-ldflags "-X=github.com/zricethezav/gitleaks/v5/version.Version=$(VERSION)" -_LDFLAGS="github.com/zricethezav/gitleaks/v5/version.Version=$(VERSION)" +_LDFLAGS="github.com/zricethezav/gitleaks/v6/version.Version=$(VERSION)" COVER=--cover --coverprofile=cover.out test-cover: diff --git a/config/config.go b/config/config.go index 7a291169..595bfc23 100644 --- a/config/config.go +++ b/config/config.go @@ -6,19 +6,21 @@ import ( "regexp" "strconv" - "github.com/zricethezav/gitleaks/v5/options" + "github.com/zricethezav/gitleaks/v6/options" "github.com/BurntSushi/toml" log "github.com/sirupsen/logrus" ) -// Allowlist is struct containing items that if encountered will allowlist +// AllowList is struct containing items that if encountered will allowlist // a commit/line of code that would be considered a leak. type Allowlist struct { Description string - Regex *regexp.Regexp - File *regexp.Regexp - Path *regexp.Regexp + Regexes []*regexp.Regexp + Commits []string + Files []*regexp.Regexp + Paths []*regexp.Regexp + Repos []*regexp.Regexp } // Entropy represents an entropy range @@ -34,56 +36,50 @@ type Entropy struct { // that match is not allowlisted (globally or locally), then a leak will be appended // to the final scan report. type Rule struct { - Description string - Regex *regexp.Regexp - FileNameRegex *regexp.Regexp - FilePathRegex *regexp.Regexp - Tags []string - Allowlist []Allowlist - Entropies []Entropy + Description string + Regex *regexp.Regexp + File *regexp.Regexp + Path *regexp.Regexp + Tags []string + Allowlist Allowlist + Entropies []Entropy } // Config is a composite struct of Rules and Allowlists // Each Rule contains a description, regular expression, tags, and allowlists if available type Config struct { Rules []Rule - Allowlist struct { - Description string - Commits []string - Files []*regexp.Regexp - Paths []*regexp.Regexp - Repos []*regexp.Regexp - } + Allowlist Allowlist +} + +// TomlAllowList is a struct used in the TomlLoader that loads in allowlists from +// specific rules or globally at the top level config +type TomlAllowList struct { + Description string + Regexes []string + Commits []string + Files []string + Paths []string + Repos []string } // TomlLoader gets loaded with the values from a gitleaks toml config // see the config in config/defaults.go for an example. TomlLoader is used // to generate Config values (compiling regexes, etc). type TomlLoader struct { - Allowlist struct { + AllowList TomlAllowList + Rules []struct { Description string - Commits []string - Files []string - Paths []string - Repos []string - } - Rules []struct { - Description string - Regex string - FileNameRegex string - FilePathRegex string - Tags []string - Entropies []struct { + Regex string + File string + Path string + Tags []string + Entropies []struct { Min string Max string Group string } - Allowlist []struct { - Description string - Regex string - File string - Path string - } + AllowList TomlAllowList } } @@ -99,7 +95,7 @@ func NewConfig(options options.Options) (Config, error) { if options.Config != "" { _, err = toml.DecodeFile(options.Config, &tomlLoader) // append a allowlist rule for allowlisting the config - tomlLoader.Allowlist.Files = append(tomlLoader.Allowlist.Files, path.Base(options.Config)) + tomlLoader.AllowList.Files = append(tomlLoader.AllowList.Files, path.Base(options.Config)) } else { _, err = toml.Decode(DefaultConfig, &tomlLoader) } @@ -121,7 +117,7 @@ func (tomlLoader TomlLoader) Parse() (Config, error) { var cfg Config for _, rule := range tomlLoader.Rules { // check and make sure the rule is valid - if rule.Regex == "" && rule.FilePathRegex == "" && rule.FileNameRegex == "" && len(rule.Entropies) == 0 { + if rule.Regex == "" && rule.Path == "" && rule.File == "" && len(rule.Entropies) == 0 { log.Warnf("Rule %s does not define any actionable data", rule.Description) continue } @@ -129,36 +125,43 @@ func (tomlLoader TomlLoader) Parse() (Config, error) { if err != nil { return cfg, fmt.Errorf("problem loading config: %v", err) } - fileNameRe, err := regexp.Compile(rule.FileNameRegex) + fileNameRe, err := regexp.Compile(rule.File) if err != nil { return cfg, fmt.Errorf("problem loading config: %v", err) } - filePathRe, err := regexp.Compile(rule.FilePathRegex) + filePathRe, err := regexp.Compile(rule.Path) if err != nil { return cfg, fmt.Errorf("problem loading config: %v", err) } // rule specific allowlists - var allowlists []Allowlist - for _, wl := range rule.Allowlist { - wlRe, err := regexp.Compile(wl.Regex) + var allowList Allowlist + + // rule specific regexes + for _, re := range rule.AllowList.Regexes { + allowListedRegex, err := regexp.Compile(re) if err != nil { return cfg, fmt.Errorf("problem loading config: %v", err) } - wlFileNameRe, err := regexp.Compile(wl.File) + allowList.Regexes = append(allowList.Regexes, allowListedRegex) + } + + // rule specific filenames + for _, re := range rule.AllowList.Files { + allowListedRegex, err := regexp.Compile(re) if err != nil { return cfg, fmt.Errorf("problem loading config: %v", err) } - wlFilePathRe, err := regexp.Compile(wl.Path) + allowList.Files = append(allowList.Files, allowListedRegex) + } + + // rule specific paths + for _, re := range rule.AllowList.Paths { + allowListedRegex, err := regexp.Compile(re) if err != nil { return cfg, fmt.Errorf("problem loading config: %v", err) } - allowlists = append(allowlists, Allowlist{ - Description: wl.Description, - File: wlFileNameRe, - Path: wlFilePathRe, - Regex: wlRe, - }) + allowList.Paths = append(allowList.Paths, allowListedRegex) } var entropies []Entropy @@ -191,47 +194,56 @@ func (tomlLoader TomlLoader) Parse() (Config, error) { } r := Rule{ - Description: rule.Description, - Regex: re, - FileNameRegex: fileNameRe, - FilePathRegex: filePathRe, - Tags: rule.Tags, - Allowlist: allowlists, - Entropies: entropies, + Description: rule.Description, + Regex: re, + File: fileNameRe, + Path: filePathRe, + Tags: rule.Tags, + Allowlist: allowList, + Entropies: entropies, } cfg.Rules = append(cfg.Rules, r) } - // global file name allowlists - for _, wlFileName := range tomlLoader.Allowlist.Files { - re, err := regexp.Compile(wlFileName) + // global regex allowLists + for _, allowListRegex := range tomlLoader.AllowList.Regexes { + re, err := regexp.Compile(allowListRegex) + if err != nil { + return cfg, fmt.Errorf("problem loading config: %v", err) + } + cfg.Allowlist.Regexes = append(cfg.Allowlist.Regexes, re) + } + + // global file name allowLists + for _, allowListFileName := range tomlLoader.AllowList.Files { + re, err := regexp.Compile(allowListFileName) if err != nil { return cfg, fmt.Errorf("problem loading config: %v", err) } cfg.Allowlist.Files = append(cfg.Allowlist.Files, re) } - // global file path allowlists - for _, wlFilePath := range tomlLoader.Allowlist.Paths { - re, err := regexp.Compile(wlFilePath) + // global file path allowLists + for _, allowListFilePath := range tomlLoader.AllowList.Paths { + re, err := regexp.Compile(allowListFilePath) if err != nil { return cfg, fmt.Errorf("problem loading config: %v", err) } cfg.Allowlist.Paths = append(cfg.Allowlist.Paths, re) } - // global repo allowlists - for _, wlRepo := range tomlLoader.Allowlist.Repos { - re, err := regexp.Compile(wlRepo) + // global repo allowLists + for _, allowListRepo := range tomlLoader.AllowList.Repos { + re, err := regexp.Compile(allowListRepo) if err != nil { return cfg, fmt.Errorf("problem loading config: %v", err) } cfg.Allowlist.Repos = append(cfg.Allowlist.Repos, re) } - cfg.Allowlist.Commits = tomlLoader.Allowlist.Commits - cfg.Allowlist.Description = tomlLoader.Allowlist.Description + cfg.Allowlist.Commits = tomlLoader.AllowList.Commits + cfg.Allowlist.Description = tomlLoader.AllowList.Description return cfg, nil } diff --git a/config/config_test.go b/config/config_test.go index 50c64c91..62235425 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -5,7 +5,7 @@ import ( "regexp" "testing" - "github.com/zricethezav/gitleaks/v5/options" + "github.com/zricethezav/gitleaks/v6/options" ) func TestParse(t *testing.T) { @@ -122,7 +122,7 @@ func TestParse(t *testing.T) { _, err := NewConfig(test.opts) if err != nil { if test.wantErr == nil { - t.Error(err) + t.Error(test.description, err) } else if test.wantErr.Error() != err.Error() { t.Errorf("expected err: %s, got %s", test.wantErr, err) } diff --git a/examples/leaky-repo.toml b/examples/leaky-repo.toml index b206ff0b..62ef4d2d 100644 --- a/examples/leaky-repo.toml +++ b/examples/leaky-repo.toml @@ -129,8 +129,8 @@ title = "gitleaks config" [[rules]] description = "Port" regex = '''(?i)port(.{0,4})?[0-9]{1,10}''' - [[rules.allowlist]] - regex = '''(?i)port ''' + [rules.allowlist] + regexes = ['''(?i)port '''] description = "ignore export " @@ -139,8 +139,8 @@ title = "gitleaks config" description = "Email" regex = '''[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}''' tags = ["email"] - [[rules.allowlist]] - file = '''(?i)bashrc''' + [rules.allowlist] + files = ['''(?i)bashrc'''] description = "ignore bashrc emails" @@ -149,35 +149,26 @@ title = "gitleaks config" regex = '''(?i)(dbpasswd|dbuser|dbname|dbhost|api_key|apikey|secret|key|api|password|user|guid|hostname|pw|auth)(.{0,20})?['|"]([0-9a-zA-Z-_\/+!{}/=]{4,120})['|"]''' tags = ["key", "API", "generic"] # ignore leaks with specific identifiers like slack and aws - [[rules.allowlist]] - regex = '''xox[baprs]-([0-9a-zA-Z]{10,48})''' - description = "ignore slack" - [[rules.allowlist]] - description = "MailChimp API key" - regex = '''(?i)(.{0,20})?['"][0-9a-f]{32}-us[0-9]{1,2}['"]''' - [[rules.allowlist]] - description = "AWS Manager ID" - regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}''' - -#[[rules]] -# description = "s3config" -# regex = '''(?i)(dbpasswd|dbuser|dbname|dbhost|api_key|apikey|key|api|password|user|guid|hostname|pw|auth)(.{0,3})?([0-9a-zA-Z-_\/+!{}=]{4,120})''' -# fileNameRegex = '''(?i)s3cfg$''' + [rules.allowlist] + description = "ignore slack, mailchimp, aws" + regexes = [ + '''xox[baprs]-([0-9a-zA-Z]{10,48})''', + '''(?i)(.{0,20})?['"][0-9a-f]{32}-us[0-9]{1,2}['"]''', + '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}''' + ] [[rules]] description = "High Entropy" regex = '''[0-9a-zA-Z-_!{}/=]{4,120}''' - fileNameRegex = '''(?i)(dump.sql|high-entropy-misc.txt)$''' + file = '''(?i)(dump.sql|high-entropy-misc.txt)$''' tags = ["entropy"] - [[rules.Entropies]] - Min = "4.3" - Max = "7.0" - [[rules.allowlist]] - description = "ignore ssh key and pems" - file = '''(pem|ppk|env)$''' - path = '''(.*)?ssh''' - - + [[rules.Entropies]] + Min = "4.3" + Max = "7.0" + [rules.allowlist] + description = "ignore ssh key and pems" + files = ['''(pem|ppk|env)$'''] + paths = ['''(.*)?ssh'''] [[rules]] description = "Potential bash var" @@ -195,8 +186,9 @@ title = "gitleaks config" [[rules]] description = "Files with keys and credentials" - fileNameRegex = '''(?i)(id_rsa|passwd|id_rsa.pub|pgpass|pem|key|shadow)''' + file = '''(?i)(id_rsa|passwd|id_rsa.pub|pgpass|pem|key|shadow)''' +# Global allowlist [allowlist] description = "image allowlists" files = ['''(.*?)(jpg|gif|doc|pdf|bin)$'''] diff --git a/examples/simple_regex_and_allowlist_config.toml b/examples/simple_regex_and_allowlist_config.toml index bfd9f579..e99eb49c 100644 --- a/examples/simple_regex_and_allowlist_config.toml +++ b/examples/simple_regex_and_allowlist_config.toml @@ -8,6 +8,6 @@ description = "AWS Manager ID" regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}''' tags = ["key", "AWS"] - [[rules.allowlist]] - regex = '''AKIAIO5FODNN7EXAMPLE.*''' - description = "ignore example aws key" + [rules.allowlist] + regexes = ['''AKIAIO5FODNN7EXAMPLE.*'''] + description = "ignore example aws key" diff --git a/go.mod b/go.mod index b3fdd146..04d5600d 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/zricethezav/gitleaks/v5 +module github.com/zricethezav/gitleaks/v6 go 1.14 diff --git a/hosts/github.go b/hosts/github.go index 95b1851c..9330b824 100644 --- a/hosts/github.go +++ b/hosts/github.go @@ -6,9 +6,9 @@ import ( "strings" "sync" - "github.com/zricethezav/gitleaks/v5/manager" - "github.com/zricethezav/gitleaks/v5/options" - "github.com/zricethezav/gitleaks/v5/scan" + "github.com/zricethezav/gitleaks/v6/manager" + "github.com/zricethezav/gitleaks/v6/options" + "github.com/zricethezav/gitleaks/v6/scan" "github.com/go-git/go-git/v5" "github.com/go-git/go-git/v5/plumbing" diff --git a/hosts/gitlab.go b/hosts/gitlab.go index 72a1397c..c4b00365 100644 --- a/hosts/gitlab.go +++ b/hosts/gitlab.go @@ -4,9 +4,9 @@ import ( "context" "sync" - "github.com/zricethezav/gitleaks/v5/manager" - "github.com/zricethezav/gitleaks/v5/options" - "github.com/zricethezav/gitleaks/v5/scan" + "github.com/zricethezav/gitleaks/v6/manager" + "github.com/zricethezav/gitleaks/v6/options" + "github.com/zricethezav/gitleaks/v6/scan" log "github.com/sirupsen/logrus" "github.com/xanzy/go-gitlab" diff --git a/hosts/host.go b/hosts/host.go index f320f82b..3c03e478 100644 --- a/hosts/host.go +++ b/hosts/host.go @@ -3,7 +3,7 @@ package hosts import ( "strings" - "github.com/zricethezav/gitleaks/v5/manager" + "github.com/zricethezav/gitleaks/v6/manager" ) const ( diff --git a/hosts/hosts_test.go b/hosts/hosts_test.go index 92350cec..c39389e4 100644 --- a/hosts/hosts_test.go +++ b/hosts/hosts_test.go @@ -6,9 +6,9 @@ import ( "os" "testing" - "github.com/zricethezav/gitleaks/v5/config" - "github.com/zricethezav/gitleaks/v5/manager" - "github.com/zricethezav/gitleaks/v5/options" + "github.com/zricethezav/gitleaks/v6/config" + "github.com/zricethezav/gitleaks/v6/manager" + "github.com/zricethezav/gitleaks/v6/options" ) var ( diff --git a/main.go b/main.go index 2e0b0e5e..de1fcbeb 100644 --- a/main.go +++ b/main.go @@ -5,11 +5,11 @@ import ( "os" "time" - "github.com/zricethezav/gitleaks/v5/config" - "github.com/zricethezav/gitleaks/v5/hosts" - "github.com/zricethezav/gitleaks/v5/manager" - "github.com/zricethezav/gitleaks/v5/options" - "github.com/zricethezav/gitleaks/v5/scan" + "github.com/zricethezav/gitleaks/v6/config" + "github.com/zricethezav/gitleaks/v6/hosts" + "github.com/zricethezav/gitleaks/v6/manager" + "github.com/zricethezav/gitleaks/v6/options" + "github.com/zricethezav/gitleaks/v6/scan" "github.com/hako/durafmt" log "github.com/sirupsen/logrus" diff --git a/manager/manager.go b/manager/manager.go index b671abec..806e2eff 100644 --- a/manager/manager.go +++ b/manager/manager.go @@ -14,8 +14,8 @@ import ( "text/tabwriter" "time" - "github.com/zricethezav/gitleaks/v5/config" - "github.com/zricethezav/gitleaks/v5/options" + "github.com/zricethezav/gitleaks/v6/config" + "github.com/zricethezav/gitleaks/v6/options" "github.com/go-git/go-git/v5" "github.com/hako/durafmt" @@ -252,7 +252,7 @@ func (manager *Manager) DebugOutput() { w := tabwriter.NewWriter(os.Stdout, 0, 0, padding, '.', 0) log.Debugf("--------------------------\n") - log.Debugf("| Individual Regex Times |\n") + log.Debugf("| Individual Regexes Times |\n") log.Debugf("--------------------------\n") for k, v := range manager.metadata.RegexTime { _, _ = fmt.Fprintf(w, "%s\t%s\n", k, durafmt.Parse(time.Duration(v)*time.Nanosecond)) diff --git a/manager/manager_test.go b/manager/manager_test.go index 52aa6490..73613df0 100644 --- a/manager/manager_test.go +++ b/manager/manager_test.go @@ -3,8 +3,8 @@ package manager import ( "crypto/rand" "fmt" - "github.com/zricethezav/gitleaks/v5/config" - "github.com/zricethezav/gitleaks/v5/options" + "github.com/zricethezav/gitleaks/v6/config" + "github.com/zricethezav/gitleaks/v6/options" "io" "testing" ) diff --git a/options/options.go b/options/options.go index 00bbe115..d7cfc1b8 100644 --- a/options/options.go +++ b/options/options.go @@ -7,7 +7,7 @@ import ( "os/user" "strings" - "github.com/zricethezav/gitleaks/v5/version" + "github.com/zricethezav/gitleaks/v6/version" "github.com/go-git/go-git/v5" "github.com/go-git/go-git/v5/plumbing/transport/http" diff --git a/scan/repo.go b/scan/repo.go index 934962b7..b5959bc6 100644 --- a/scan/repo.go +++ b/scan/repo.go @@ -11,8 +11,8 @@ import ( "runtime" "time" - "github.com/zricethezav/gitleaks/v5/config" - "github.com/zricethezav/gitleaks/v5/manager" + "github.com/zricethezav/gitleaks/v6/config" + "github.com/zricethezav/gitleaks/v6/manager" "github.com/BurntSushi/toml" "github.com/go-git/go-billy/v5" @@ -77,11 +77,11 @@ func Run(m *manager.Manager) error { func runHelper(r *Repo) error { // Ignore allowlisted repos - for _, wlRepo := range r.Manager.Config.Allowlist.Repos { - if RegexMatched(r.Manager.Opts.RepoPath, wlRepo) { + for _, allowListedRepo := range r.Manager.Config.Allowlist.Repos { + if RegexMatched(r.Manager.Opts.RepoPath, allowListedRepo) { return nil } - if RegexMatched(r.Manager.Opts.Repo, wlRepo) { + if RegexMatched(r.Manager.Opts.Repo, allowListedRepo) { return nil } } diff --git a/scan/rule.go b/scan/rule.go index 1d283ec8..d8f2b25c 100644 --- a/scan/rule.go +++ b/scan/rule.go @@ -11,8 +11,8 @@ import ( "strings" "time" - "github.com/zricethezav/gitleaks/v5/config" - "github.com/zricethezav/gitleaks/v5/manager" + "github.com/zricethezav/gitleaks/v6/config" + "github.com/zricethezav/gitleaks/v6/manager" fdiff "github.com/go-git/go-git/v5/plumbing/format/diff" "github.com/go-git/go-git/v5/plumbing/object" @@ -58,17 +58,17 @@ func (repo *Repo) CheckRules(bundle *Bundle) { start := time.Now() // For each rule we want to check filename allowlists - if isFileNameWhiteListed(filename, rule.Allowlist) || isFilePathWhiteListed(path, rule.Allowlist) { + if isAllowListed(filename, rule.Allowlist.Files) || isAllowListed(path, rule.Allowlist.Paths) { continue } // If it has fileNameRegex and it doesnt match we continue to next rule - if ruleContainFileNameRegex(rule) && !RegexMatched(filename, rule.FileNameRegex) { + if ruleContainFileRegex(rule) && !RegexMatched(filename, rule.File) { continue } // If it has filePathRegex and it doesnt match we continue to next rule - if ruleContainFilePathRegex(rule) && !RegexMatched(path, rule.FilePathRegex) { + if ruleContainPathRegex(rule) && !RegexMatched(path, rule.Path) { continue } @@ -112,7 +112,7 @@ func (repo *Repo) CheckRules(bundle *Bundle) { offender := bundle.Content[loc[0]:loc[1]] groups := rule.Regex.FindStringSubmatch(offender) - if isOffenderWhiteListed(offender, rule.Allowlist) { + if isAllowListed(line, append(rule.Allowlist.Regexes, repo.config.Allowlist.Regexes...)) { continue } @@ -146,7 +146,6 @@ func (repo *Repo) CheckRules(bundle *Bundle) { } } - // TODO should return filenameRegex if only file rule repo.Manager.RecordTime(manager.RegexTime{ Time: howLong(start), Regex: rule.Regex.String(), @@ -339,28 +338,28 @@ func ruleContainRegex(rule config.Rule) bool { } // Checks if the given rule has a file name regex -func ruleContainFileNameRegex(rule config.Rule) bool { - if rule.FileNameRegex == nil { +func ruleContainFileRegex(rule config.Rule) bool { + if rule.File == nil { return false } - if rule.FileNameRegex.String() == "" { + if rule.File.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 { +func ruleContainPathRegex(rule config.Rule) bool { + if rule.Path == nil { return false } - if rule.FilePathRegex.String() == "" { + if rule.Path.String() == "" { return false } return true } -func isCommitWhiteListed(commitHash string, allowlistedCommits []string) bool { +func isCommitAllowListed(commitHash string, allowlistedCommits []string) bool { for _, hash := range allowlistedCommits { if commitHash == hash { return true @@ -369,35 +368,14 @@ func isCommitWhiteListed(commitHash string, allowlistedCommits []string) bool { return false } -func isOffenderWhiteListed(offender string, allowlist []config.Allowlist) bool { - if len(allowlist) != 0 { - for _, wl := range allowlist { - if wl.Regex.FindString(offender) != "" { +func isAllowListed(target string, allowList []*regexp.Regexp) bool { + if len(allowList) != 0 { + for _, re := range allowList { + if re.FindString(target) != "" { return true } } } return false -} -func isFileNameWhiteListed(filename string, allowlist []config.Allowlist) bool { - if len(allowlist) != 0 { - for _, wl := range allowlist { - if RegexMatched(filename, wl.File) { - return true - } - } - } - return false -} - -func isFilePathWhiteListed(filepath string, allowlist []config.Allowlist) bool { - if len(allowlist) != 0 { - for _, wl := range allowlist { - if RegexMatched(filepath, wl.Path) { - return true - } - } - } - return false } diff --git a/scan/scan.go b/scan/scan.go index 39b5f62e..07b19a6f 100644 --- a/scan/scan.go +++ b/scan/scan.go @@ -7,7 +7,7 @@ import ( "sync" "time" - "github.com/zricethezav/gitleaks/v5/manager" + "github.com/zricethezav/gitleaks/v6/manager" "github.com/go-git/go-git/v5" "github.com/go-git/go-git/v5/plumbing" @@ -96,7 +96,7 @@ func (repo *Repo) Scan() error { } // Check if Commit is allowlisted - if isCommitWhiteListed(c.Hash.String(), repo.config.Allowlist.Commits) { + if isCommitAllowListed(c.Hash.String(), repo.config.Allowlist.Commits) { return nil } @@ -140,9 +140,10 @@ func (repo *Repo) Scan() error { start := time.Now() patch, err := parent.Patch(c) if err != nil { - return fmt.Errorf("could not generate Patch") + log.Errorf("could not generate Patch") } repo.Manager.RecordTime(manager.PatchTime(howLong(start))) + wg.Add(1) semaphore <- true go func(c *object.Commit, patch *object.Patch) { diff --git a/scan/scan_test.go b/scan/scan_test.go index 39b4d2ec..a33d2af0 100644 --- a/scan/scan_test.go +++ b/scan/scan_test.go @@ -10,9 +10,9 @@ import ( "sort" "testing" - "github.com/zricethezav/gitleaks/v5/config" - "github.com/zricethezav/gitleaks/v5/manager" - "github.com/zricethezav/gitleaks/v5/options" + "github.com/zricethezav/gitleaks/v6/config" + "github.com/zricethezav/gitleaks/v6/manager" + "github.com/zricethezav/gitleaks/v6/options" "github.com/sergi/go-diff/diffmatchpatch" ) @@ -385,6 +385,16 @@ func TestScan(t *testing.T) { }, wantPath: "../test_data/test_local_repo_eight.json", }, + { + description: "test local repo nine", + opts: options.Options{ + RepoPath: "../test_data/test_repos/test_repo_9", + Report: "../test_data/test_local_repo_nine_aws_leak.json.got", + Config: "../test_data/test_configs/large_with_global_allowlist_regex.toml", + ReportFormat: "json", + }, + wantPath: "../test_data/test_local_repo_nine_aws_leak.json", + }, } for _, test := range tests { diff --git a/test_data/test_configs/aws_key_allowlist_files.toml b/test_data/test_configs/aws_key_allowlist_files.toml index 9034d1da..5dc6608e 100644 --- a/test_data/test_configs/aws_key_allowlist_files.toml +++ b/test_data/test_configs/aws_key_allowlist_files.toml @@ -2,13 +2,7 @@ description = "AWS Manager ID" regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}''' tags = ["key", "AWS"] - [[rules.allowlist]] - description = "ignore md files" - file = '''(.*)?md$''' - [[rules.allowlist]] - description = "ignore this regex" - regex = '''ignore$''' - [[rules.allowlist]] - description = "ignore regex and md files" - regex = '''ignore$''' - file = '''(.*)?md$''' + [rules.allowlist] + description = "ignore sample regex md files" + files = ['''(.*)?md$'''] + regexes = ['''ignore$'''] diff --git a/test_data/test_configs/aws_key_allowlist_python_files.toml b/test_data/test_configs/aws_key_allowlist_python_files.toml index 66b73b56..c3301202 100644 --- a/test_data/test_configs/aws_key_allowlist_python_files.toml +++ b/test_data/test_configs/aws_key_allowlist_python_files.toml @@ -2,6 +2,6 @@ description = "AWS Manager ID" regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}''' tags = ["key", "AWS"] - [[rules.allowlist]] + [rules.allowlist] description = "ignore python files" - file = '''(.*)?py$''' + files = ['''(.*)?py$'''] diff --git a/test_data/test_configs/aws_key_aws_allowlisted.toml b/test_data/test_configs/aws_key_aws_allowlisted.toml index 49879172..e8d7cf6d 100644 --- a/test_data/test_configs/aws_key_aws_allowlisted.toml +++ b/test_data/test_configs/aws_key_aws_allowlisted.toml @@ -2,6 +2,6 @@ description = "AWS Manager ID" regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}''' tags = ["key", "AWS"] - [[rules.allowlist]] - regex = '''AKIAIO5FODNN7EXAMPLE.*''' + [rules.allowlist] description = "ignore aws key" + regexes = ['''AKIAIO5FODNN7EXAMPLE.*'''] diff --git a/test_data/test_configs/large.toml b/test_data/test_configs/large.toml index dc01a815..78c3a50c 100644 --- a/test_data/test_configs/large.toml +++ b/test_data/test_configs/large.toml @@ -125,19 +125,19 @@ title = "gitleaks config" description = "AWS Manager ID" regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}''' tags = ["key", "AWS"] - [[rules.allowlist]] + [rules.allowlist] description = "ignore common jenkins functions" - regex = '''allowlistme''' - file = '''(.*)?Jenkinsfile$''' - [[rules.allowlist]] - description = "ignore common jenkins functions2" - regex = '''allowlistme''' - file = '''(.*)?Jenkinsfile$''' + regexes = [ + '''allowlistme''' + ] + files = [ + '''(.*)?Jenkinsfile$''' + ] # Global rules. This instructs gitleaks to ignore all .pem files or if a message with [[rules]] description = "Files with keys and credentials" - fileRegex = '''(.*?)(pem)''' + file = '''(.*?)(pem)''' [allowlist] description = "File allowlists" diff --git a/test_data/test_configs/large_with_global_allowlist_regex.toml b/test_data/test_configs/large_with_global_allowlist_regex.toml new file mode 100644 index 00000000..1d63f47d --- /dev/null +++ b/test_data/test_configs/large_with_global_allowlist_regex.toml @@ -0,0 +1,151 @@ +title = "gitleaks config" + +[[rules]] + description = "AWS Secret Key" + regex = '''(?i)aws(.{0,20})?(?-i)['\"][0-9a-zA-Z\/+]{40}['\"]''' + tags = ["key", "AWS"] + +[[rules]] + description = "AWS MWS key" + regex = '''amzn\.mws\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}''' + tags = ["key", "AWS", "MWS"] + +[[rules]] + description = "Facebook Secret Key" + regex = '''(?i)(facebook|fb)(.{0,20})?(?-i)['\"][0-9a-f]{32}['\"]''' + tags = ["key", "Facebook"] + +[[rules]] + description = "Facebook Client ID" + regex = '''(?i)(facebook|fb)(.{0,20})?['\"][0-9]{13,17}['\"]''' + tags = ["key", "Facebook"] + +[[rules]] + description = "Twitter Secret Key" + regex = '''(?i)twitter(.{0,20})?['\"][0-9a-z]{35,44}['\"]''' + tags = ["key", "Twitter"] + +[[rules]] + description = "Twitter Client ID" + regex = '''(?i)twitter(.{0,20})?['\"][0-9a-z]{18,25}['\"]''' + tags = ["client", "Twitter"] + +[[rules]] + description = "Github" + regex = '''(?i)github(.{0,20})?(?-i)['\"][0-9a-zA-Z]{35,40}['\"]''' + tags = ["key", "Github"] + +[[rules]] + description = "LinkedIn Client ID" + regex = '''(?i)linkedin(.{0,20})?(?-i)['\"][0-9a-z]{12}['\"]''' + tags = ["client", "LinkedIn"] + +[[rules]] + description = "LinkedIn Secret Key" + regex = '''(?i)linkedin(.{0,20})?['\"][0-9a-z]{16}['\"]''' + tags = ["secret", "LinkedIn"] + +[[rules]] + description = "Slack" + regex = '''xox[baprs]-([0-9a-zA-Z]{10,48})?''' + tags = ["key", "Slack"] + +[[rules]] + description = "EC" + regex = '''-----BEGIN EC PRIVATE KEY-----''' + tags = ["key", "EC"] + +[[rules]] + description = "Generic API key" + regex = '''(?i)(api_key|apikey)(.{0,20})?['|"][0-9a-zA-Z]{32,45}['|"]''' + tags = ["key", "API", "generic"] + +[[rules]] + description = "Generic Secret" + regex = '''(?i)secret(.{0,20})?['|"][0-9a-zA-Z]{32,45}['|"]''' + tags = ["key", "Secret", "generic"] + +[[rules]] + description = "Google API key" + regex = '''AIza[0-9A-Za-z\\-_]{35}''' + tags = ["key", "Google"] + + +[[rules]] + description = "Heroku API key" + regex = '''(?i)heroku(.{0,20})?['"][0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}['"]''' + tags = ["key", "Heroku"] + +[[rules]] + description = "MailChimp API key" + regex = '''(?i)(mailchimp|mc)(.{0,20})?['"][0-9a-f]{32}-us[0-9]{1,2}['"]''' + tags = ["key", "Mailchimp"] + +[[rules]] + description = "Mailgun API key" + regex = '''(?i)(mailgun|mg)(.{0,20})?['"][0-9a-z]{32}['"]''' + tags = ["key", "Mailgun"] + +[[rules]] + description = "PayPal Braintree access token" + regex = '''access_token\$production\$[0-9a-z]{16}\$[0-9a-f]{32}''' + tags = ["key", "Paypal"] + +[[rules]] + description = "Picatic API key" + regex = '''sk_live_[0-9a-z]{32}''' + tags = ["key", "Picatic"] + +[[rules]] + description = "Slack Webhook" + regex = '''https://hooks.slack.com/services/T[a-zA-Z0-9_]{8}/B[a-zA-Z0-9_]{8}/[a-zA-Z0-9_]{24}''' + tags = ["key", "slack"] + +[[rules]] + description = "Stripe API key" + regex = '''(?i)stripe(.{0,20})?['\"][sk|rk]_live_[0-9a-zA-Z]{24}''' + tags = ["key", "Stripe"] + +[[rules]] + description = "Square access token" + regex = '''sq0atp-[0-9A-Za-z\-_]{22}''' + tags = ["key", "square"] + +[[rules]] + description = "Square OAuth secret" + regex = '''sq0csp-[0-9A-Za-z\\-_]{43}''' + tags = ["key", "square"] + +[[rules]] + description = "Twilio API key" + regex = '''(?i)twilio(.{0,20})?['\"][0-9a-f]{32}['\"]''' + tags = ["key", "twilio"] + +[[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"] + [rules.allowlist] + description = "ignore common jenkins functions" + regexes = [ + '''allowlistme''' + ] + files = [ + '''(.*)?Jenkinsfile$''' + ] + +[[rules]] + description = "Files with keys and credentials" + file = '''(.*?)(pem)''' + +# Global allowlist +[allowlist] + description = "global allowlists" + files = [ + '''(.*?)(jpg|gif)$''', + '''(.*?)(doc|pdf|bin)$''' + ] + regexes = [ + '''(.*?)gitleaks:allow''' + ] + diff --git a/test_data/test_configs/regex_filename.toml b/test_data/test_configs/regex_filename.toml index eab1877e..a9b9cd2f 100644 --- a/test_data/test_configs/regex_filename.toml +++ b/test_data/test_configs/regex_filename.toml @@ -2,5 +2,5 @@ [[rules]] description = "Generic password" regex = '''(?i)(password|token).{0,20}?\s*[:|=]\s*?(?-i)([0-9a-zA-Z\/+]{4,40})''' - fileNameRegex = '''.*\.ya?ml''' + file = '''.*\.ya?ml''' tags = ["key", "Yml", "Yaml"] diff --git a/test_data/test_configs/regex_filepath.toml b/test_data/test_configs/regex_filepath.toml index 0252df84..0d5ce04e 100644 --- a/test_data/test_configs/regex_filepath.toml +++ b/test_data/test_configs/regex_filepath.toml @@ -2,5 +2,5 @@ [[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)?''' + path = '''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 index f0ca3022..d4ab0bbd 100644 --- a/test_data/test_configs/regex_filepath_filename.toml +++ b/test_data/test_configs/regex_filepath_filename.toml @@ -2,6 +2,6 @@ [[rules]] description = "Generic password" regex = '''(?i)(password|token).{0,20}?\s*[:|=]\s*?(?-i)([0-9a-zA-Z\/+]{4,40})''' - fileNameRegex = '''.*\.properties''' - filePathRegex = '''config(guration)?''' + file = '''.*\.properties''' + path = '''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 373920d7..e5fbaf14 100644 --- a/test_data/test_local_owner_aws_leak.json +++ b/test_data/test_local_owner_aws_leak.json @@ -178,5 +178,20 @@ "date": "2020-07-25T14:41:11-04:00", "tags": "key, AWS", "operation": "addition" + }, + { + "line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE', #gitleaks:allow", + "lineNumber": 6, + "offender": "AKIAIO5FODNN7EXAMPLE", + "commit": "8d1fb60d2d80f0590f191ed5ace1e45ef780909a", + "repo": "test_repo_9", + "rule": "AWS Manager ID", + "commitMessage": "gitleaks allow secret\n", + "author": "Zach Rice", + "email": "zrice@gitlab.com", + "file": "server.test.py", + "date": "2020-08-12T13:36:20-04:00", + "tags": "key, AWS", + "operation": "addition" } ] diff --git a/test_data/test_local_owner_aws_leak_allowlist_repo.json b/test_data/test_local_owner_aws_leak_allowlist_repo.json index cd379e84..112f031f 100644 --- a/test_data/test_local_owner_aws_leak_allowlist_repo.json +++ b/test_data/test_local_owner_aws_leak_allowlist_repo.json @@ -178,5 +178,20 @@ "date": "2020-07-25T14:41:11-04:00", "tags": "key, AWS", "operation": "addition" + }, + { + "line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE', #gitleaks:allow", + "lineNumber": 6, + "offender": "AKIAIO5FODNN7EXAMPLE", + "commit": "8d1fb60d2d80f0590f191ed5ace1e45ef780909a", + "repo": "test_repo_9", + "rule": "AWS Manager ID", + "commitMessage": "gitleaks allow secret\n", + "author": "Zach Rice", + "email": "zrice@gitlab.com", + "file": "server.test.py", + "date": "2020-08-12T13:36:20-04:00", + "tags": "key, AWS", + "operation": "addition" } ] 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 969bb6eb..42be9a68 100644 --- a/test_data/test_local_owner_aws_leak_depth_2.json +++ b/test_data/test_local_owner_aws_leak_depth_2.json @@ -88,5 +88,20 @@ "date": "2020-07-25T14:44:48-04:00", "tags": "key, AWS", "operation": "addition" + }, + { + "line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE', #gitleaks:allow", + "lineNumber": 6, + "offender": "AKIAIO5FODNN7EXAMPLE", + "commit": "8d1fb60d2d80f0590f191ed5ace1e45ef780909a", + "repo": "test_repo_9", + "rule": "AWS Manager ID", + "commitMessage": "gitleaks allow secret\n", + "author": "Zach Rice", + "email": "zrice@gitlab.com", + "file": "server.test.py", + "date": "2020-08-12T13:36:20-04:00", + "tags": "key, AWS", + "operation": "addition" } ] diff --git a/test_data/test_local_repo_nine_aws_leak.json b/test_data/test_local_repo_nine_aws_leak.json new file mode 100644 index 00000000..ab418b8d --- /dev/null +++ b/test_data/test_local_repo_nine_aws_leak.json @@ -0,0 +1,17 @@ +[ + { + "line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',", + "lineNumber": 5, + "offender": "AKIAIO5FODNN7EXAMPLE", + "commit": "6557c92612d3b35979bd426d429255b3bf9fab74", + "repo": "test_repo_9", + "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", + "operation": "addition" + } +] diff --git a/test_data/test_repos/test_repo_9/dotGit/COMMIT_EDITMSG b/test_data/test_repos/test_repo_9/dotGit/COMMIT_EDITMSG new file mode 100644 index 00000000..73bc0b91 --- /dev/null +++ b/test_data/test_repos/test_repo_9/dotGit/COMMIT_EDITMSG @@ -0,0 +1 @@ +gitleaks allow secret diff --git a/test_data/test_repos/test_repo_9/dotGit/HEAD b/test_data/test_repos/test_repo_9/dotGit/HEAD new file mode 100644 index 00000000..cb089cd8 --- /dev/null +++ b/test_data/test_repos/test_repo_9/dotGit/HEAD @@ -0,0 +1 @@ +ref: refs/heads/master diff --git a/test_data/test_repos/test_repo_9/dotGit/config b/test_data/test_repos/test_repo_9/dotGit/config new file mode 100644 index 00000000..6c9406b7 --- /dev/null +++ b/test_data/test_repos/test_repo_9/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_9/dotGit/description b/test_data/test_repos/test_repo_9/dotGit/description new file mode 100644 index 00000000..498b267a --- /dev/null +++ b/test_data/test_repos/test_repo_9/dotGit/description @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/test_data/test_repos/test_repo_9/dotGit/index b/test_data/test_repos/test_repo_9/dotGit/index new file mode 100644 index 0000000000000000000000000000000000000000..fcab4fb7a3d12b80dc1a24c9a945d129848353fa GIT binary patch literal 145 zcmZ?q402{*U|<4b#&{ErCjCo{HDEehHi40WftAs_^&A63;}W3sSD+dZAT9dy)91{j zUlylaRd>$&&h&eMomJ&>2EO9dqO#N?y^_@861{>-pjw8IAXir)CCOl@V8C_o^Dz@q qk7dyh-@Xmo^8M7g 1571923767 -0400 commit (initial): commit 1 with secrets +6557c92612d3b35979bd426d429255b3bf9fab74 d274003914c707212cbe84e3e466a00013ccb639 zach rice 1571925818 -0400 commit: comment +d274003914c707212cbe84e3e466a00013ccb639 8d1fb60d2d80f0590f191ed5ace1e45ef780909a Zach Rice 1597253780 -0400 commit: gitleaks allow secret diff --git a/test_data/test_repos/test_repo_9/dotGit/logs/refs/heads/master b/test_data/test_repos/test_repo_9/dotGit/logs/refs/heads/master new file mode 100644 index 00000000..8244f382 --- /dev/null +++ b/test_data/test_repos/test_repo_9/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 8d1fb60d2d80f0590f191ed5ace1e45ef780909a Zach Rice 1597253780 -0400 commit: gitleaks allow secret diff --git a/test_data/test_repos/test_repo_9/dotGit/objects/10/fa14c5ab0134436e2ae435138bf921eb477c60 b/test_data/test_repos/test_repo_9/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_9/dotGit/objects/3a/76f3781306faf5612017bf18a4b4bdb9f927bf b/test_data/test_repos/test_repo_9/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_9/dotGit/objects/41/42082bcb939bbc17985a69ba748491ac6b62a5 b/test_data/test_repos/test_repo_9/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_9/dotGit/objects/49/8b267a8c7812490d6479839c5577eaaec79d62 b/test_data/test_repos/test_repo_9/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_9/dotGit/objects/60/c9e47f150a6b713e247e6105b77f1b961f844f b/test_data/test_repos/test_repo_9/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_9/dotGit/objects/65/57c92612d3b35979bd426d429255b3bf9fab74 b/test_data/test_repos/test_repo_9/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_9/dotGit/objects/6a/756416384c210ada2631f17862f5c01fffa478 b/test_data/test_repos/test_repo_9/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_9/dotGit/objects/6c/bef5c370d8c3486ca85423dd70440c5e0a2aa2 b/test_data/test_repos/test_repo_9/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_9/dotGit/objects/80/8b12c5ca4b142367932e7045d555a639fc148c b/test_data/test_repos/test_repo_9/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_9/dotGit/objects/8d/1fb60d2d80f0590f191ed5ace1e45ef780909a b/test_data/test_repos/test_repo_9/dotGit/objects/8d/1fb60d2d80f0590f191ed5ace1e45ef780909a new file mode 100644 index 00000000..e086a5ae --- /dev/null +++ b/test_data/test_repos/test_repo_9/dotGit/objects/8d/1fb60d2d80f0590f191ed5ace1e45ef780909a @@ -0,0 +1,2 @@ +x•ŽM +Â0F]çseò߀ˆgpén2�Úbk$�žÞzWEãmìö¸eÕF·wMþõÔ¯*t_�æ¹¼a®ÒÔ­¼G* \ No newline at end of file diff --git a/test_data/test_repos/test_repo_9/dotGit/objects/9e/523225b31add24e72f2feb0b2645cfb36542dc b/test_data/test_repos/test_repo_9/dotGit/objects/9e/523225b31add24e72f2feb0b2645cfb36542dc new file mode 100644 index 00000000..2103921e --- /dev/null +++ b/test_data/test_repos/test_repo_9/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_9/dotGit/objects/a1/fd29ec14823d8bc4a8d1a2cfe35451580f5118 b/test_data/test_repos/test_repo_9/dotGit/objects/a1/fd29ec14823d8bc4a8d1a2cfe35451580f5118 new file mode 100644 index 00000000..b72c5f77 --- /dev/null +++ b/test_data/test_repos/test_repo_9/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_9/dotGit/objects/a4/fa2187727281aea78d7c3aaebdb4b924fc4e4d b/test_data/test_repos/test_repo_9/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_9/dotGit/objects/b5/8d1184a9d43a39c0d95f32453efc78581877d6 b/test_data/test_repos/test_repo_9/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_9/dotGit/objects/c1/f3c6341548a65be1eded56b4f7cacec7fe9090 b/test_data/test_repos/test_repo_9/dotGit/objects/c1/f3c6341548a65be1eded56b4f7cacec7fe9090 new file mode 100644 index 0000000000000000000000000000000000000000..7a69ceae39b2ced357a194cee84ba746b5a31caf GIT binary patch literal 59 zcmV-B0L1@z0V^p=O;s>4VlXr?Ff%bxC{8UZOD)nXNi8nXE2w1n`RQ|J(l3isuBtod ReP{Z;z|N|2IRL_z6trD{7>)n{ literal 0 HcmV?d00001 diff --git a/test_data/test_repos/test_repo_9/dotGit/objects/c9/8e6c52cbd1f50de572ff12a3441271fccff705 b/test_data/test_repos/test_repo_9/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_9/dotGit/objects/cb/089cd89a7d7686d284d8761201649346b5aa1c b/test_data/test_repos/test_repo_9/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_9/dotGit/objects/e6/73bb3980f3c286291809e05f80873852bc3e9c b/test_data/test_repos/test_repo_9/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_9/dotGit/objects/e9/e5396f7e52aa48de485b4836ebb041cc7f7c46 b/test_data/test_repos/test_repo_9/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_9/dotGit/objects/ec/17ec1939b7c3e86b7cb6c0c4de6b0818a7e75e b/test_data/test_repos/test_repo_9/dotGit/objects/ec/17ec1939b7c3e86b7cb6c0c4de6b0818a7e75e new file mode 100644 index 00000000..d7558de5 --- /dev/null +++ b/test_data/test_repos/test_repo_9/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†YQjJehI`(p7|0=(20^6+3Lc_~t<#<&K?dH#|>>A<=GNAwD$Qv}kJA{#Us7SiY#VG4~4ZZf>B0|9YTo}^iy z68O5q3OIOeTL$E3QP$t^B;EN;R*@R^Bwn~iDT%p0QCDj+`FB+)RNm(}7;j#qiNr_cZ2&TrcTm-cVBn~#daT`FFM WNC1_JeF5VSj^x2;OX3PNC|jdhXKG6T literal 0 HcmV?d00001 diff --git a/test_data/test_repos/test_repo_9/dotGit/objects/fe/f3190e94723e78847ab9f0daaa15add4ffd4ef b/test_data/test_repos/test_repo_9/dotGit/objects/fe/f3190e94723e78847ab9f0daaa15add4ffd4ef new file mode 100644 index 0000000000000000000000000000000000000000..708c674cc657379608f2552cdc96673bc3a0f78d GIT binary patch literal 58 zcmb