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 00000000..fcab4fb7 Binary files /dev/null and b/test_data/test_repos/test_repo_9/dotGit/index differ diff --git a/test_data/test_repos/test_repo_9/dotGit/info/exclude b/test_data/test_repos/test_repo_9/dotGit/info/exclude new file mode 100644 index 00000000..a5196d1b --- /dev/null +++ b/test_data/test_repos/test_repo_9/dotGit/info/exclude @@ -0,0 +1,6 @@ +# git ls-files --others --exclude-from=.git/info/exclude +# Lines that start with '#' are comments. +# For a project mostly in C, the following would be a good set of +# exclude patterns (uncomment them if you want to use them): +# *.[oa] +# *~ diff --git a/test_data/test_repos/test_repo_9/dotGit/logs/HEAD b/test_data/test_repos/test_repo_9/dotGit/logs/HEAD new file mode 100644 index 00000000..8244f382 --- /dev/null +++ b/test_data/test_repos/test_repo_9/dotGit/logs/HEAD @@ -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/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 00000000..c32cf91d Binary files /dev/null and b/test_data/test_repos/test_repo_9/dotGit/objects/10/fa14c5ab0134436e2ae435138bf921eb477c60 differ 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 00000000..0bd54d2c Binary files /dev/null and b/test_data/test_repos/test_repo_9/dotGit/objects/3a/76f3781306faf5612017bf18a4b4bdb9f927bf differ 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 00000000..dba98289 Binary files /dev/null and b/test_data/test_repos/test_repo_9/dotGit/objects/41/42082bcb939bbc17985a69ba748491ac6b62a5 differ 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 00000000..b558235f Binary files /dev/null and b/test_data/test_repos/test_repo_9/dotGit/objects/49/8b267a8c7812490d6479839c5577eaaec79d62 differ 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 00000000..e212d90f Binary files /dev/null and b/test_data/test_repos/test_repo_9/dotGit/objects/60/c9e47f150a6b713e247e6105b77f1b961f844f differ diff --git a/test_data/test_repos/test_repo_9/dotGit/objects/61/87dbf4390fc6e28445dd3d988aefb9d1111988 b/test_data/test_repos/test_repo_9/dotGit/objects/61/87dbf4390fc6e28445dd3d988aefb9d1111988 new file mode 100644 index 00000000..eb42e868 Binary files /dev/null and b/test_data/test_repos/test_repo_9/dotGit/objects/61/87dbf4390fc6e28445dd3d988aefb9d1111988 differ 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 00000000..edf7d2fb Binary files /dev/null and b/test_data/test_repos/test_repo_9/dotGit/objects/65/57c92612d3b35979bd426d429255b3bf9fab74 differ 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 00000000..072ee533 Binary files /dev/null and b/test_data/test_repos/test_repo_9/dotGit/objects/6a/756416384c210ada2631f17862f5c01fffa478 differ diff --git a/test_data/test_repos/test_repo_9/dotGit/objects/6c/9406b7d9320db083eca69b3f8bee9a6c7b50d4 b/test_data/test_repos/test_repo_9/dotGit/objects/6c/9406b7d9320db083eca69b3f8bee9a6c7b50d4 new file mode 100644 index 00000000..0d57232e Binary files /dev/null and b/test_data/test_repos/test_repo_9/dotGit/objects/6c/9406b7d9320db083eca69b3f8bee9a6c7b50d4 differ 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 00000000..b098b0b6 Binary files /dev/null and b/test_data/test_repos/test_repo_9/dotGit/objects/6c/bef5c370d8c3486ca85423dd70440c5e0a2aa2 differ 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 00000000..9cd8d694 Binary files /dev/null and b/test_data/test_repos/test_repo_9/dotGit/objects/80/8b12c5ca4b142367932e7045d555a639fc148c differ diff --git a/test_data/test_repos/test_repo_9/dotGit/objects/80/ba94135cc378364af9d3cb2450df48e51faf2c b/test_data/test_repos/test_repo_9/dotGit/objects/80/ba94135cc378364af9d3cb2450df48e51faf2c new file mode 100644 index 00000000..86d326dd Binary files /dev/null and b/test_data/test_repos/test_repo_9/dotGit/objects/80/ba94135cc378364af9d3cb2450df48e51faf2c differ 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 00000000..0aabdd40 Binary files /dev/null and b/test_data/test_repos/test_repo_9/dotGit/objects/a4/fa2187727281aea78d7c3aaebdb4b924fc4e4d differ diff --git a/test_data/test_repos/test_repo_9/dotGit/objects/a5/196d1be8fb59edf8062bef36d3a602e0812139 b/test_data/test_repos/test_repo_9/dotGit/objects/a5/196d1be8fb59edf8062bef36d3a602e0812139 new file mode 100644 index 00000000..62de872c --- /dev/null +++ b/test_data/test_repos/test_repo_9/dotGit/objects/a5/196d1be8fb59edf8062bef36d3a602e0812139 @@ -0,0 +1 @@ +x-�±jÃ0„;ç)<¤ µSJ§B¦@¦¾Aé Û¿lI¤_¸Yú쑃·ãø¾»Þ³ÇûÇÛSƒÉ)|n­ó’ѶÔYÒäoðe”Ö&†SW©£‹–Ç­Þ5ør±:EV“‹Óûf“C�¨¹«ä… ×Ä_�Yý .âüZu�¥÷\\œ°°ø½Tz"GdQÐÖ…íW£*)f<—¸=¬ÎâÆ‚ÅD…%Ë£ù¬ò¡û¦ùYÃÿîá›SC \ No newline at end of file diff --git a/test_data/test_repos/test_repo_9/dotGit/objects/a5/d7b84a673458d14d9aab082183a1968c2c7492 b/test_data/test_repos/test_repo_9/dotGit/objects/a5/d7b84a673458d14d9aab082183a1968c2c7492 new file mode 100644 index 00000000..cafdfdb1 Binary files /dev/null and b/test_data/test_repos/test_repo_9/dotGit/objects/a5/d7b84a673458d14d9aab082183a1968c2c7492 differ 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 00000000..043d9c54 Binary files /dev/null and b/test_data/test_repos/test_repo_9/dotGit/objects/b5/8d1184a9d43a39c0d95f32453efc78581877d6 differ 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 00000000..7a69ceae Binary files /dev/null and b/test_data/test_repos/test_repo_9/dotGit/objects/c1/f3c6341548a65be1eded56b4f7cacec7fe9090 differ 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 00000000..14206b0b Binary files /dev/null and b/test_data/test_repos/test_repo_9/dotGit/objects/c9/8e6c52cbd1f50de572ff12a3441271fccff705 differ 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 00000000..17c8d93c Binary files /dev/null and b/test_data/test_repos/test_repo_9/dotGit/objects/cb/089cd89a7d7686d284d8761201649346b5aa1c differ diff --git a/test_data/test_repos/test_repo_9/dotGit/objects/cb/19a50e8cdeb7011eccdb13f3b739f00d775bab b/test_data/test_repos/test_repo_9/dotGit/objects/cb/19a50e8cdeb7011eccdb13f3b739f00d775bab new file mode 100644 index 00000000..692983a5 --- /dev/null +++ b/test_data/test_repos/test_repo_9/dotGit/objects/cb/19a50e8cdeb7011eccdb13f3b739f00d775bab @@ -0,0 +1,2 @@ +x��Í +1 „½êS䨥MÚf+"¾J“­XØY ‚OïŠ^¼íÀ00‡áéFB\™…‚à=kÄ`±%!9Jë0ÌŽè½�\ã5 ;x%½ÁT4Ãéõ‰érŸÆ:}*ÝAÇþ Ö³�HöƳžÛ¾TØ–¡Ô’ºÝ~�…g©7xd�r}l3´Èó.Eë” £E•ܸLÙ…�æÇ–T%P\ ëÛüÁ~óP7oq,\é \ No newline at end of file diff --git a/test_data/test_repos/test_repo_9/dotGit/objects/d2/74003914c707212cbe84e3e466a00013ccb639 b/test_data/test_repos/test_repo_9/dotGit/objects/d2/74003914c707212cbe84e3e466a00013ccb639 new file mode 100644 index 00000000..142e1a6d Binary files /dev/null and b/test_data/test_repos/test_repo_9/dotGit/objects/d2/74003914c707212cbe84e3e466a00013ccb639 differ 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 00000000..144d4077 Binary files /dev/null and b/test_data/test_repos/test_repo_9/dotGit/objects/e6/73bb3980f3c286291809e05f80873852bc3e9c differ 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 00000000..da7e1c7c Binary files /dev/null and b/test_data/test_repos/test_repo_9/dotGit/objects/e9/e5396f7e52aa48de485b4836ebb041cc7f7c46 differ 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†