diff --git a/audit/audit_test.go b/audit/audit_test.go index 3049d145..0f59e2f2 100644 --- a/audit/audit_test.go +++ b/audit/audit_test.go @@ -253,6 +253,46 @@ func TestAudit(t *testing.T) { }, wantPath: "../test_data/test_local_repo_five_commit.json", }, + { + description: "test local repo six filename", + opts: options.Options{ + RepoPath: "../test_data/test_repos/test_repo_6", + Report: "../test_data/test_local_repo_six_filename.json.got", + Config: "../test_data/test_configs/regex_filename.toml", + ReportFormat: "json", + }, + wantPath: "../test_data/test_local_repo_six_filename.json", + }, + { + description: "test local repo six filepath", + opts: options.Options{ + RepoPath: "../test_data/test_repos/test_repo_6", + Report: "../test_data/test_local_repo_six_filepath.json.got", + Config: "../test_data/test_configs/regex_filepath.toml", + ReportFormat: "json", + }, + wantPath: "../test_data/test_local_repo_six_filepath.json", + }, + { + description: "test local repo six filename and filepath", + opts: options.Options{ + RepoPath: "../test_data/test_repos/test_repo_6", + Report: "../test_data/test_local_repo_six_filepath_filename.json.got", + Config: "../test_data/test_configs/regex_filepath_filename.toml", + ReportFormat: "json", + }, + wantPath: "../test_data/test_local_repo_six_filepath_filename.json", + }, + { + description: "test local repo six path globally whitelisted", + opts: options.Options{ + RepoPath: "../test_data/test_repos/test_repo_6", + Report: "../test_data/test_local_repo_six_path_globally_whitelisted.json.got", + Config: "../test_data/test_configs/aws_key_global_whitelist_path.toml", + ReportFormat: "json", + }, + wantPath: "../test_data/test_local_repo_six_path_globally_whitelisted.json", + }, } for _, test := range tests { diff --git a/audit/repo.go b/audit/repo.go index 46fc7899..e1b11ac4 100644 --- a/audit/repo.go +++ b/audit/repo.go @@ -171,35 +171,18 @@ func (repo *Repo) AuditUncommitted() error { } } - if fileMatched(filename, repo.config.Whitelist.File) { - log.Debugf("whitelisted file found, skipping audit of file: %s", filename) - } else if fileMatched(filename, repo.config.FileRegex) { - repo.Manager.SendLeaks(manager.Leak{ - Line: "N/A", - Offender: filename, - Commit: c.Hash.String(), - Repo: repo.Name, - Rule: "file regex matched" + repo.config.FileRegex.String(), - Message: c.Message, - Author: c.Author.Name, - Email: c.Author.Email, - Date: c.Author.When, - File: filename, - }) - } else { - dmp := diffmatchpatch.New() - diffs := dmp.DiffMain(prevFileContents, currFileContents, false) - var diffContents string - for _, d := range diffs { - switch d.Type { - case diffmatchpatch.DiffInsert: - diffContents += fmt.Sprintf("%s\n", d.Text) - case diffmatchpatch.DiffDelete: - diffContents += fmt.Sprintf("%s\n", d.Text) - } + diffs := diffmatchpatch.New().DiffMain(prevFileContents, currFileContents, false) + var diffContents string + for _, d := range diffs { + switch d.Type { + case diffmatchpatch.DiffInsert: + diffContents += fmt.Sprintf("%s\n", d.Text) + case diffmatchpatch.DiffDelete: + diffContents += fmt.Sprintf("%s\n", d.Text) } - InspectString(diffContents, c, repo, filename) } + + InspectFile(diffContents, filename, c, repo) } } diff --git a/audit/util.go b/audit/util.go index 27915e45..05e39736 100644 --- a/audit/util.go +++ b/audit/util.go @@ -3,6 +3,7 @@ package audit import ( "fmt" "math" + "path/filepath" "regexp" "runtime" "strings" @@ -31,33 +32,16 @@ func inspectPatch(patch *object.Patch, c *object.Commit, repo *Repo) { if f.IsBinary() { continue } - if fileMatched(getFileName(f), repo.config.Whitelist.File) { - log.Debugf("whitelisted file found, skipping audit of file: %s", getFileName(f)) - continue - } - if fileMatched(getFileName(f), repo.config.FileRegex) { - repo.Manager.SendLeaks(manager.Leak{ - Line: "N/A", - Offender: getFileName(f), - Commit: c.Hash.String(), - Repo: repo.Name, - Rule: "file regex matched" + repo.config.FileRegex.String(), - Author: c.Author.Name, - Email: c.Author.Email, - Date: c.Author.When, - File: getFileName(f), - }) - } for _, chunk := range f.Chunks() { if chunk.Type() == fdiff.Delete || chunk.Type() == fdiff.Add { - InspectString(chunk.Content(), c, repo, getFileName(f)) + InspectFile(chunk.Content(), getFileFullPath(f), c, repo) } } } } // getFileName accepts a file patch and returns the filename -func getFileName(f fdiff.FilePatch) string { +func getFileFullPath(f fdiff.FilePatch) string { fn := "???" from, to := f.Files() if from != nil { @@ -69,6 +53,31 @@ func getFileName(f fdiff.FilePatch) string { return fn } +// getFileName accepts a string with full path and returns only path +func getFilePath(fullpath string) string { + return filepath.Dir(fullpath) +} + +// getFileName accepts a string with full path and returns only filename +func getFileName(fullpath string) string { + return filepath.Base(fullpath) +} + +// aws_access_key_id='AKIAIO5FODNN7EXAMPLE', +// trippedEntropy checks if a given capture group or offender falls in between entropy ranges +// supplied by a custom gitleaks configuration. Gitleaks do not check entropy by default. +func trippedEntropy(groups []string, rule config.Rule) bool { + for _, e := range rule.Entropies { + if len(groups) > e.Group { + entropy := shannonEntropy(groups[e.Group]) + if entropy >= e.Min && entropy <= e.Max { + return true + } + } + } + return false +} + // getShannonEntropy https://en.wiktionary.org/wiki/Shannon_entropy func shannonEntropy(data string) (entropy float64) { if data == "" { @@ -89,21 +98,8 @@ func shannonEntropy(data string) (entropy float64) { return entropy } -// aws_access_key_id='AKIAIO5FODNN7EXAMPLE', -// trippedEntropy checks if a given groups or offender falls in between entropy ranges -// supplied by a custom gitleaks configuration. Gitleaks do not check entropy by default. -func trippedEntropy(groups []string, rule config.Rule) bool { - for _, e := range rule.Entropies { - if len(groups) > e.Group { - entropy := shannonEntropy(groups[e.Group]) - if entropy >= e.Min && entropy <= e.Max { - return true - } - } - } - return false -} +// Checks if the given rule has a regex func ruleContainRegex(rule config.Rule) bool { if rule.Regex == nil { return false @@ -114,103 +110,147 @@ func ruleContainRegex(rule config.Rule) bool { return true } -// InspectString accepts a string, commit object, repo, and filename. This function iterates over -// all the rules set by the gitleaks config. If the rule contains entropy checks then entropy will be checked first. -// Next, if the rule contains a regular expression then that will be checked. -func InspectString(content string, c *object.Commit, repo *Repo, filename string) { +// Checks if the given rule has a file name regex +func ruleContainFileNameRegex(rule config.Rule) bool { + if rule.FileNameRegex == nil { + return false + } + if rule.FileNameRegex.String() == "" { + return false + } + return true +} + +// Checks if the given rule has a file path regex +func ruleContainFilePathRegex(rule config.Rule) bool { + if rule.FilePathRegex == nil { + return false + } + if rule.FilePathRegex.String() == "" { + return false + } + return true +} + +func sendLeak(offender string, line string, filename string, rule config.Rule, c *object.Commit, repo *Repo) { + if repo.Manager.Opts.Redact { + line = strings.ReplaceAll(line, offender, "REDACTED") + offender = "REDACTED" + } + + repo.Manager.SendLeaks(manager.Leak{ + Line: line, + Offender: offender, + Commit: c.Hash.String(), + Repo: repo.Name, + Message: c.Message, + Rule: rule.Description, + Author: c.Author.Name, + Email: c.Author.Email, + Date: c.Author.When, + Tags: strings.Join(rule.Tags, ", "), + File: filename, + }) +} + +// InspectFile accepts a file content, fullpath of file, commit and repo. If the file is +// binary OR if a file is matched on whitelisted files set in the configuration, then gitleaks +// will skip auditing that file. It will check first if rules apply to this file comparing filename +// and path to their respective rule regexes and inspect file content with inspectFileContents after. +func InspectFile(content string, fullpath string, c *object.Commit, repo *Repo) { + + filename := getFileName(fullpath) + path := getFilePath(fullpath) + + // We want to check if there is a whitelist for this file + if len(repo.config.Whitelist.Files) != 0 { + for _, reFileName := range repo.config.Whitelist.Files { + if fileMatched(filename, reFileName) { + log.Debugf("whitelisted file found, skipping audit of file: %s", filename) + return + } + } + } + + // We want to check if there is a whitelist for this path + if len(repo.config.Whitelist.Paths) != 0 { + for _, reFilePath := range repo.config.Whitelist.Paths { + if fileMatched(path, reFilePath) { + log.Debugf("file in whitelisted path found, skipping audit of file: %s", filename) + return + } + } + } + for _, rule := range repo.config.Rules { - if rule.Regex.String() == "" { + start := time.Now() + + // For each rule we want to check filename whitelists + if isFileNameWhiteListed(filename, rule.Whitelist) || isFilePathWhiteListed(path, rule.Whitelist) { + continue + } + + // If it has fileNameRegex and it doesnt match we continue to next rule + if ruleContainFileNameRegex(rule) && !fileMatched(filename, rule.FileNameRegex) { continue } - if repo.timeoutReached() { - return + // If it has filePathRegex and it doesnt match we continue to next rule + if ruleContainFilePathRegex(rule) && !fileMatched(path, rule.FilePathRegex) { + continue } - start := time.Now() - locs := rule.Regex.FindAllIndex([]byte(content), -1) - if len(locs) != 0 { - // check if any rules are whitelisting this leak - if len(rule.Whitelist) != 0 { - for _, wl := range rule.Whitelist { - if fileMatched(filename, wl.File) { - // if matched, go to next rule - goto NEXT - } - } - } - for _, loc := range locs { - start := loc[0] - end := loc[1] - for start != 0 && content[start] != '\n' { - start = start - 1 - } - if start != 0 { - // skip newline - start = start + 1 - } - for end < len(content)-1 && content[end] != '\n' { - end = end + 1 - } - - line := content[start:end] - offender := content[loc[0]:loc[1]] - groups := rule.Regex.FindStringSubmatch(offender) - - if len(rule.Whitelist) != 0 { - for _, wl := range rule.Whitelist { - if wl.Regex.FindString(offender) != "" { - goto NEXT - } - } - } - - if len(rule.Entropies) != 0 { - if trippedEntropy(groups, rule) { - if repo.Manager.Opts.Redact { - line = strings.ReplaceAll(line, offender, "REDACTED") - offender = "REDACTED" - } - repo.Manager.SendLeaks(manager.Leak{ - Line: line, - Offender: offender, - Commit: c.Hash.String(), - Repo: repo.Name, - Message: c.Message, - Rule: rule.Description, - Author: c.Author.Name, - Email: c.Author.Email, - Date: c.Author.When, - Tags: strings.Join(rule.Tags, ", "), - File: filename, - }) - } - } else { - if repo.Manager.Opts.Redact { - line = strings.ReplaceAll(line, offender, "REDACTED") - offender = "REDACTED" - } - repo.Manager.SendLeaks(manager.Leak{ - Line: line, - Offender: offender, - Commit: c.Hash.String(), - Message: c.Message, - Repo: repo.Name, - Rule: rule.Description, - Author: c.Author.Name, - Email: c.Author.Email, - Date: c.Author.When, - Tags: strings.Join(rule.Tags, ", "), - File: filename, - }) - } - } + // If it doesnt contain a content regex then it is a filename regex match + if !ruleContainRegex(rule) { + sendLeak("Filename/path offender: "+filename, "N/A", fullpath, rule, c, repo) + } else { + //otherwise we check if it matches content regex + inspectFileContents(content, fullpath, rule, c, repo) } + + // TODO should return filenameRegex if only file rule repo.Manager.RecordTime(manager.RegexTime{ - Time: time.Now().Sub(start).Nanoseconds(), + Time: howLong(start), Regex: rule.Regex.String(), }) - NEXT: + } +} + +// InspectString accepts a string, commit object, repo, and filename. This function iterates over +// all the rules set by the gitleaks config. If the rule contains entropy checks then entropy will be checked first. +// Next, if the rule contains a regular expression then that will be checked. +func inspectFileContents(content string, path string, rule config.Rule, c *object.Commit, repo *Repo) { + locs := rule.Regex.FindAllIndex([]byte(content), -1) + if len(locs) != 0 { + for _, loc := range locs { + start := loc[0] + end := loc[1] + for start != 0 && content[start] != '\n' { + start = start - 1 + } + if start != 0 { + // skip newline + start = start + 1 + } + + for end < len(content)-1 && content[end] != '\n' { + end = end + 1 + } + + line := content[start:end] + offender := content[loc[0]:loc[1]] + groups := rule.Regex.FindStringSubmatch(offender) + + if isOffenderWhiteListed(offender, rule.Whitelist) { + continue + } + + if len(rule.Entropies) != 0 && !trippedEntropy(groups, rule) { + continue + } + + sendLeak(offender, line, path, rule, c, repo) + } } } @@ -281,30 +321,13 @@ func inspectFilesAtCommit(c *object.Commit, repo *Repo) error { } else if err != nil { return err } - if fileMatched(f, repo.config.Whitelist.File) { - log.Debugf("whitelisted file found, skipping audit of file: %s", f.Name) - return nil - } - if fileMatched(f.Name, repo.config.FileRegex) { - repo.Manager.SendLeaks(manager.Leak{ - Line: "N/A", - Offender: f.Name, - Commit: c.Hash.String(), - Repo: repo.Name, - Rule: "file regex matched" + repo.config.FileRegex.String(), - Author: c.Author.Name, - Email: c.Author.Email, - Date: c.Author.When, - File: f.Name, - }) - } content, err := f.Contents() if err != nil { return err } - InspectString(content, c, repo, f.Name) + InspectFile(content, f.Name, c, repo) return nil }) @@ -333,6 +356,39 @@ func isCommitWhiteListed(commitHash string, whitelistedCommits []string) bool { return false } +func isOffenderWhiteListed(offender string, whitelist []config.Whitelist) bool { + if len(whitelist) != 0 { + for _, wl := range whitelist { + if wl.Regex.FindString(offender) != "" { + return true + } + } + } + return false +} + +func isFileNameWhiteListed(filename string, whitelist []config.Whitelist) bool { + if len(whitelist) != 0 { + for _, wl := range whitelist { + if fileMatched(filename, wl.File) { + return true + } + } + } + return false +} + +func isFilePathWhiteListed(filepath string, whitelist []config.Whitelist) bool { + if len(whitelist) != 0 { + for _, wl := range whitelist { + if fileMatched(filepath, wl.Path) { + return true + } + } + } + return false +} + func fileMatched(f interface{}, re *regexp.Regexp) bool { if re == nil { return false diff --git a/config/config.go b/config/config.go index 355d72fb..62a8aa7c 100644 --- a/config/config.go +++ b/config/config.go @@ -16,9 +16,10 @@ type Whitelist struct { Description string Regex *regexp.Regexp File *regexp.Regexp + Path *regexp.Regexp } -// entropy represents an entropy range +// Entropy represents an entropy range type Entropy struct { Min float64 Max float64 @@ -31,23 +32,24 @@ type Entropy struct { // that match is not whitelisted (globally or locally), then a leak will be appended // to the final audit report. type Rule struct { - Description string - Regex *regexp.Regexp - Tags []string - Whitelist []Whitelist - Entropies []Entropy + Description string + Regex *regexp.Regexp + FileNameRegex *regexp.Regexp + FilePathRegex *regexp.Regexp + Tags []string + Whitelist []Whitelist + Entropies []Entropy } // Config is a composite struct of Rules and Whitelists // Each Rule contains a description, regular expression, tags, and whitelists if available type Config struct { - FileRegex *regexp.Regexp - Message *regexp.Regexp Rules []Rule Whitelist struct { Description string Commits []string - File *regexp.Regexp + Files []*regexp.Regexp + Paths []*regexp.Regexp } } @@ -55,20 +57,19 @@ type Config struct { // see the config in config/defaults.go for an example. TomlLoader is used // to generate Config values (compiling regexes, etc). type TomlLoader struct { - Global struct { - File string - Message string - } Whitelist struct { Description string Commits []string - File string + Files []string + Paths []string } Rules []struct { - Description string - Regex string - Tags []string - Entropies []struct { + Description string + Regex string + FileNameRegex string + FilePathRegex string + Tags []string + Entropies []struct { Min string Max string Group string @@ -77,6 +78,7 @@ type TomlLoader struct { Description string Regex string File string + Path string } } } @@ -116,22 +118,35 @@ func (tomlLoader TomlLoader) Parse() (Config, error) { if err != nil { return cfg, fmt.Errorf("problem loading config: %v", err) } + fileNameRe, err := regexp.Compile(rule.FileNameRegex) + if err != nil { + return cfg, fmt.Errorf("problem loading config: %v", err) + } + filePathRe, err := regexp.Compile(rule.FilePathRegex) + if err != nil { + return cfg, fmt.Errorf("problem loading config: %v", err) + } // rule specific whitelists var whitelists []Whitelist for _, wl := range rule.Whitelist { - re, err := regexp.Compile(wl.Regex) + wlRe, err := regexp.Compile(wl.Regex) if err != nil { return cfg, fmt.Errorf("problem loading config: %v", err) } - fileRe, err := regexp.Compile(wl.File) + wlFileNameRe, err := regexp.Compile(wl.File) + if err != nil { + return cfg, fmt.Errorf("problem loading config: %v", err) + } + wlFilePathRe, err := regexp.Compile(wl.Path) if err != nil { return cfg, fmt.Errorf("problem loading config: %v", err) } whitelists = append(whitelists, Whitelist{ Description: wl.Description, - File: fileRe, - Regex: re, + File: wlFileNameRe, + Path: wlFilePathRe, + Regex: wlRe, }) } @@ -165,37 +180,32 @@ func (tomlLoader TomlLoader) Parse() (Config, error) { } cfg.Rules = append(cfg.Rules, Rule{ - Description: rule.Description, - Regex: re, - Tags: rule.Tags, - Whitelist: whitelists, - Entropies: entropies, + Description: rule.Description, + Regex: re, + FileNameRegex: fileNameRe, + FilePathRegex: filePathRe, + Tags: rule.Tags, + Whitelist: whitelists, + Entropies: entropies, }) } - // global leaks - if tomlLoader.Global.File != "" { - re, err := regexp.Compile(tomlLoader.Global.File) + // global file name whitelists + for _, wlFileName := range tomlLoader.Whitelist.Files { + re, err := regexp.Compile(wlFileName) if err != nil { return cfg, fmt.Errorf("problem loading config: %v", err) } - cfg.FileRegex = re - } - if tomlLoader.Global.Message != "" { - re, err := regexp.Compile(tomlLoader.Global.Message) - if err != nil { - return cfg, fmt.Errorf("problem loading config: %v", err) - } - cfg.Message = re + cfg.Whitelist.Files = append(cfg.Whitelist.Files, re) } - // global whitelists - if tomlLoader.Whitelist.File != "" { - re, err := regexp.Compile(tomlLoader.Whitelist.File) + // global file path whitelists + for _, wlFilePath := range tomlLoader.Whitelist.Paths { + re, err := regexp.Compile(wlFilePath) if err != nil { return cfg, fmt.Errorf("problem loading config: %v", err) } - cfg.Whitelist.File = re + cfg.Whitelist.Paths = append(cfg.Whitelist.Paths, re) } cfg.Whitelist.Commits = tomlLoader.Whitelist.Commits cfg.Whitelist.Description = tomlLoader.Whitelist.Description diff --git a/config/config_test.go b/config/config_test.go index 5150d935..48b2084a 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -54,13 +54,6 @@ func TestParse(t *testing.T) { }, wantErr: fmt.Errorf("problem loading config: error parsing regexp: missing argument to repetition operator: `??`"), }, - { - description: "test bad global message regex", - opts: options.Options{ - Config: "../test_data/test_configs/bad_aws_key_message_regex.toml", - }, - wantErr: fmt.Errorf("problem loading config: error parsing regexp: missing argument to repetition operator: `??`"), - }, { description: "test successful load big ol thing", opts: options.Options{ diff --git a/examples/leaky-repo.toml b/examples/leaky-repo.toml index db80933e..0f70ca2f 100644 --- a/examples/leaky-repo.toml +++ b/examples/leaky-repo.toml @@ -160,7 +160,8 @@ title = "gitleaks config" Min = "5.2" Max = "5.5" -[Global] +[[rules]] + description = "Files with keys and credentials" file = '''(?i)(id_rsa|passwd|id_rsa.pub|pgpass|pem|key|shadow)''' [whitelist] diff --git a/examples/regex_and_file.toml b/examples/regex_and_file.toml index f5ee271c..243da8e7 100644 --- a/examples/regex_and_file.toml +++ b/examples/regex_and_file.toml @@ -6,5 +6,7 @@ regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}''' tags = ["key", "AWS"] -[Global] +[[rules]] + description = "PEM Files" file = '''(.*)?pem$''' + tags = ["key", "PEM"] diff --git a/hosts/github.go b/hosts/github.go index 6d50b469..713b1526 100644 --- a/hosts/github.go +++ b/hosts/github.go @@ -161,7 +161,7 @@ func (g *Github) AuditPR() { if f.Patch == nil { continue } - audit.InspectString(*f.Patch, &commitObj, repo, *f.Filename) + audit.InspectFile(*f.Patch, *f.Filename, &commitObj, repo) } } page = resp.NextPage diff --git a/test_data/test_configs/aws_key_file_regex.toml b/test_data/test_configs/aws_key_file_regex.toml index 8cfc22f2..81b40e4f 100644 --- a/test_data/test_configs/aws_key_file_regex.toml +++ b/test_data/test_configs/aws_key_file_regex.toml @@ -8,6 +8,6 @@ regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}''' tags = ["key", "AWS"] -[Global] - file = '''(.*)?py$''' - +[[rules]] + description = "Python files" + fileRegex = '''(.*)?py$''' diff --git a/test_data/test_configs/aws_key_global_whitelist_file.toml b/test_data/test_configs/aws_key_global_whitelist_file.toml index 02d22f9a..dfc4b7ea 100644 --- a/test_data/test_configs/aws_key_global_whitelist_file.toml +++ b/test_data/test_configs/aws_key_global_whitelist_file.toml @@ -5,4 +5,6 @@ [whitelist] description = "ignore md files" - file = '''(.*)?md$''' \ No newline at end of file + files = [ + '''(.*)?md$''' + ] \ No newline at end of file diff --git a/test_data/test_configs/aws_key_global_whitelist_path.toml b/test_data/test_configs/aws_key_global_whitelist_path.toml new file mode 100644 index 00000000..0b84c5ea --- /dev/null +++ b/test_data/test_configs/aws_key_global_whitelist_path.toml @@ -0,0 +1,10 @@ +[[rules]] + description = "AWS Manager ID" + regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}''' + tags = ["key", "AWS"] + +[whitelist] + description = "ignore config folders" + paths = [ + '''config(uration)?''' + ] \ No newline at end of file diff --git a/test_data/test_configs/bad_aws_key_global_whitelist_file.toml b/test_data/test_configs/bad_aws_key_global_whitelist_file.toml index 5a8fdad5..10a6aba0 100644 --- a/test_data/test_configs/bad_aws_key_global_whitelist_file.toml +++ b/test_data/test_configs/bad_aws_key_global_whitelist_file.toml @@ -5,4 +5,4 @@ [whitelist] description = "ignore md files" - file = '''???????''' \ No newline at end of file + files = ['''???????'''] \ No newline at end of file diff --git a/test_data/test_configs/bad_aws_key_message_regex.toml b/test_data/test_configs/bad_aws_key_message_regex.toml deleted file mode 100644 index 863ce088..00000000 --- a/test_data/test_configs/bad_aws_key_message_regex.toml +++ /dev/null @@ -1,13 +0,0 @@ -[[rules]] - description = "AWS Secret Key" - regex = '''(?i)aws(.{0,20})?(?-i)['\"][0-9a-zA-Z\/+]{40}['\"]''' - tags = ["key", "AWS"] - -[[rules]] - description = "AWS Manager ID" - regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}''' - tags = ["key", "AWS"] - -[Global] - message = '''?????????????''' - diff --git a/test_data/test_configs/large.toml b/test_data/test_configs/large.toml index 7cd23c55..15d1bee7 100644 --- a/test_data/test_configs/large.toml +++ b/test_data/test_configs/large.toml @@ -135,11 +135,14 @@ title = "gitleaks config" file = '''(.*)?Jenkinsfile$''' # Global rules. This instructs gitleaks to ignore all .pem files or if a message with -[Global] - file = '''(.*?)(pem)''' - message = '''somethingbad''' +[[rules]] + description = "Files with keys and credentials" + fileRegex = '''(.*?)(pem)''' [whitelist] - description = "image whitelists" - file = '''(.*?)(jpg|gif|doc|pdf|bin)$''' + description = "File whitelists" + files = [ + '''(.*?)(jpg|gif)$''', + '''(.*?)(doc|pdf|bin)$''' + ] diff --git a/test_data/test_configs/regex_filename.toml b/test_data/test_configs/regex_filename.toml new file mode 100644 index 00000000..eab1877e --- /dev/null +++ b/test_data/test_configs/regex_filename.toml @@ -0,0 +1,6 @@ + +[[rules]] + description = "Generic password" + regex = '''(?i)(password|token).{0,20}?\s*[:|=]\s*?(?-i)([0-9a-zA-Z\/+]{4,40})''' + fileNameRegex = '''.*\.ya?ml''' + tags = ["key", "Yml", "Yaml"] diff --git a/test_data/test_configs/regex_filepath.toml b/test_data/test_configs/regex_filepath.toml new file mode 100644 index 00000000..0252df84 --- /dev/null +++ b/test_data/test_configs/regex_filepath.toml @@ -0,0 +1,6 @@ + +[[rules]] + description = "AWS Manager ID" + regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}''' + filePathRegex = '''config(guration)?''' + tags = ["key", "AWS"] diff --git a/test_data/test_configs/regex_filepath_filename.toml b/test_data/test_configs/regex_filepath_filename.toml new file mode 100644 index 00000000..f0ca3022 --- /dev/null +++ b/test_data/test_configs/regex_filepath_filename.toml @@ -0,0 +1,7 @@ + +[[rules]] + description = "Generic password" + regex = '''(?i)(password|token).{0,20}?\s*[:|=]\s*?(?-i)([0-9a-zA-Z\/+]{4,40})''' + fileNameRegex = '''.*\.properties''' + filePathRegex = '''config(guration)?''' + tags = ["key", "Yml", "Yaml"] diff --git a/test_data/test_local_owner_aws_leak.json b/test_data/test_local_owner_aws_leak.json index 5b68494d..7b06075c 100644 --- a/test_data/test_local_owner_aws_leak.json +++ b/test_data/test_local_owner_aws_leak.json @@ -271,5 +271,18 @@ "file": "secrets.py", "date": "2020-02-01T10:07:34-05:00", "tags": "key, AWS" + }, + { + "line": "aws_access_key_id=AKIAIO5FODNN7EXAMPLE", + "offender": "AKIAIO5FODNN7EXAMPLE", + "commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247", + "repo": "test_repo_6", + "rule": "AWS Manager ID", + "commitMessage": "Adding some secrets in config folder\n\n", + "author": "Noel Algora", + "email": "noealgigu@gmail.com", + "file": "config/application.properties", + "date": "2020-02-24T14:13:15-05:00", + "tags": "key, AWS" } ] diff --git a/test_data/test_local_owner_aws_leak_depth_2.json b/test_data/test_local_owner_aws_leak_depth_2.json index 1d5b326d..ac786490 100644 --- a/test_data/test_local_owner_aws_leak_depth_2.json +++ b/test_data/test_local_owner_aws_leak_depth_2.json @@ -141,5 +141,18 @@ "file": "secrets.py", "date": "2020-02-01T10:08:04-05:00", "tags": "key, AWS" + }, + { + "line": "aws_access_key_id=AKIAIO5FODNN7EXAMPLE", + "offender": "AKIAIO5FODNN7EXAMPLE", + "commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247", + "repo": "test_repo_6", + "rule": "AWS Manager ID", + "commitMessage": "Adding some secrets in config folder\n\n", + "author": "Noel Algora", + "email": "noealgigu@gmail.com", + "file": "config/application.properties", + "date": "2020-02-24T14:13:15-05:00", + "tags": "key, AWS" } ] diff --git a/test_data/test_local_repo_one_aws_leak_and_file_leak.json b/test_data/test_local_repo_one_aws_leak_and_file_leak.json index edae0d97..f715fc51 100644 --- a/test_data/test_local_repo_one_aws_leak_and_file_leak.json +++ b/test_data/test_local_repo_one_aws_leak_and_file_leak.json @@ -1,30 +1,17 @@ [ { "line": "N/A", - "offender": "server.test.py", + "offender": "Filename/path offender: server.test.py", "commit": "d274003914c707212cbe84e3e466a00013ccb639", "repo": "test_repo_1", - "rule": "file regex matched(.*)?py$", - "commitMessage": "", + "rule": "Python files", + "commitMessage": "comment\n", "author": "zach rice", "email": "zricer@protonmail.com", "file": "server.test.py", "date": "2019-10-24T10:03:38-04:00", "tags": "" }, - { - "line": "N/A", - "offender": "server.test.py", - "commit": "6557c92612d3b35979bd426d429255b3bf9fab74", - "repo": "test_repo_1", - "rule": "file regex matched(.*)?py$", - "commitMessage": "", - "author": "zach rice", - "email": "zricer@protonmail.com", - "file": "server.test.py", - "date": "2019-10-24T09:29:27-04:00", - "tags": "" - }, { "line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',", "offender": "AKIAIO5FODNN7EXAMPLE", @@ -37,5 +24,18 @@ "file": "server.test.py", "date": "2019-10-24T09:29:27-04:00", "tags": "key, AWS" + }, + { + "line": "N/A", + "offender": "Filename/path offender: server.test.py", + "commit": "6557c92612d3b35979bd426d429255b3bf9fab74", + "repo": "test_repo_1", + "rule": "Python files", + "commitMessage": "commit 1 with secrets\n", + "author": "zach rice", + "email": "zricer@protonmail.com", + "file": "server.test.py", + "date": "2019-10-24T09:29:27-04:00", + "tags": "" } ] diff --git a/test_data/test_local_repo_six.json b/test_data/test_local_repo_six.json new file mode 100644 index 00000000..8c0cf9d7 --- /dev/null +++ b/test_data/test_local_repo_six.json @@ -0,0 +1,44 @@ +[ + { + "line": "api_token: exampleSecretPassword", + "lineNumber": 3, + "offender": "token: exampleSecretPassword", + "commit": "e7bf376f855ae9bc6e3bb27b5f9d65c57eba799d", + "repo": "test_repo_6", + "rule": "Generic password", + "commitMessage": "More secrets\n\n", + "author": "Noel Algora", + "email": "noealgigu@gmail.com", + "file": "config/config.yaml", + "date": "2020-02-19T04:08:26-05:00", + "tags": "key, Yml, Yaml" + }, + { + "line": "db_password_token: exampleSecretPassword", + "lineNumber": 3, + "offender": "password_token: exampleSecretPassword", + "commit": "e7bf376f855ae9bc6e3bb27b5f9d65c57eba799d", + "repo": "test_repo_6", + "rule": "Generic password", + "commitMessage": "More secrets\n\n", + "author": "Noel Algora", + "email": "noealgigu@gmail.com", + "file": "config/config.yaml", + "date": "2020-02-19T04:08:26-05:00", + "tags": "key, Yml, Yaml" + }, + { + "line": "aws_access_key_id=AKIAIO5FODNN7EXAMPLE", + "lineNumber": 1, + "offender": "AKIAIO5FODNN7EXAMPLE", + "commit": "95cf0237f8cdfc0686a29df08260d8635f46c9b0", + "repo": "test_repo_6", + "rule": "AWS Manager ID", + "commitMessage": "AWS Key in properties\n\n", + "author": "Noel Algora", + "email": "noealgigu@gmail.com", + "file": "config/application.properties", + "date": "2020-02-19T04:04:15-05:00", + "tags": "key, AWS" + } +] diff --git a/test_data/test_local_repo_six_filename.json b/test_data/test_local_repo_six_filename.json new file mode 100644 index 00000000..94002854 --- /dev/null +++ b/test_data/test_local_repo_six_filename.json @@ -0,0 +1,28 @@ +[ + { + "line": "api_token: exampleSecretPassword", + "offender": "token: exampleSecretPassword", + "commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247", + "repo": "test_repo_6", + "rule": "Generic password", + "commitMessage": "Adding some secrets in config folder\n\n", + "author": "Noel Algora", + "email": "noealgigu@gmail.com", + "file": "application.yaml", + "date": "2020-02-24T14:13:15-05:00", + "tags": "key, Yml, Yaml" + }, + { + "line": "db_password: verySecretProductionPassword", + "offender": "password: verySecretProductionPassword", + "commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247", + "repo": "test_repo_6", + "rule": "Generic password", + "commitMessage": "Adding some secrets in config folder\n\n", + "author": "Noel Algora", + "email": "noealgigu@gmail.com", + "file": "application.yaml", + "date": "2020-02-24T14:13:15-05:00", + "tags": "key, Yml, Yaml" + } +] diff --git a/test_data/test_local_repo_six_filepath.json b/test_data/test_local_repo_six_filepath.json new file mode 100644 index 00000000..005c7270 --- /dev/null +++ b/test_data/test_local_repo_six_filepath.json @@ -0,0 +1,15 @@ +[ + { + "line": "aws_access_key_id=AKIAIO5FODNN7EXAMPLE", + "offender": "AKIAIO5FODNN7EXAMPLE", + "commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247", + "repo": "test_repo_6", + "rule": "AWS Manager ID", + "commitMessage": "Adding some secrets in config folder\n\n", + "author": "Noel Algora", + "email": "noealgigu@gmail.com", + "file": "config/application.properties", + "date": "2020-02-24T14:13:15-05:00", + "tags": "key, AWS" + } +] diff --git a/test_data/test_local_repo_six_filepath_filename.json b/test_data/test_local_repo_six_filepath_filename.json new file mode 100644 index 00000000..f06fb5c6 --- /dev/null +++ b/test_data/test_local_repo_six_filepath_filename.json @@ -0,0 +1,15 @@ +[ + { + "line": "apiToken=d41d8cd98f00b204e9800998ecf8427e", + "offender": "Token=d41d8cd98f00b204e9800998ecf8427e", + "commit": "98b6c7cb3fb29a5993c4c95c56a2dc53050b9247", + "repo": "test_repo_6", + "rule": "Generic password", + "commitMessage": "Adding some secrets in config folder\n\n", + "author": "Noel Algora", + "email": "noealgigu@gmail.com", + "file": "config/application.properties", + "date": "2020-02-24T14:13:15-05:00", + "tags": "key, Yml, Yaml" + } +] diff --git a/test_data/test_local_repo_six_path_globally_whitelisted.json b/test_data/test_local_repo_six_path_globally_whitelisted.json new file mode 100644 index 00000000..988e26c1 --- /dev/null +++ b/test_data/test_local_repo_six_path_globally_whitelisted.json @@ -0,0 +1,15 @@ +[ + { + "line": " aws_access_key_id='AKIAIO5FODNN7EXAMPLE',", + "offender": "AKIAIO5FODNN7EXAMPLE", + "commit": "6557c92612d3b35979bd426d429255b3bf9fab74", + "repo": "test_repo_6", + "rule": "AWS Manager ID", + "commitMessage": "commit 1 with secrets\n", + "author": "zach rice", + "email": "zricer@protonmail.com", + "file": "server.test.py", + "date": "2019-10-24T09:29:27-04:00", + "tags": "key, AWS" + } +] diff --git a/test_data/test_repos/test_repo_6/application.yaml b/test_data/test_repos/test_repo_6/application.yaml new file mode 100644 index 00000000..dd6e8207 --- /dev/null +++ b/test_data/test_repos/test_repo_6/application.yaml @@ -0,0 +1,3 @@ +appName: "Gitleaks-Testing-App" +api_token: exampleSecretPassword +db_password: verySecretProductionPassword \ No newline at end of file diff --git a/test_data/test_repos/test_repo_6/config/application.properties b/test_data/test_repos/test_repo_6/config/application.properties new file mode 100644 index 00000000..5cb000d0 --- /dev/null +++ b/test_data/test_repos/test_repo_6/config/application.properties @@ -0,0 +1,3 @@ +language=en_EN +apiToken=d41d8cd98f00b204e9800998ecf8427e +aws_access_key_id=AKIAIO5FODNN7EXAMPLE \ No newline at end of file diff --git a/test_data/test_repos/test_repo_6/dotGit/COMMIT_EDITMSG b/test_data/test_repos/test_repo_6/dotGit/COMMIT_EDITMSG new file mode 100644 index 00000000..60c9e47f --- /dev/null +++ b/test_data/test_repos/test_repo_6/dotGit/COMMIT_EDITMSG @@ -0,0 +1 @@ +comment diff --git a/test_data/test_repos/test_repo_6/dotGit/HEAD b/test_data/test_repos/test_repo_6/dotGit/HEAD new file mode 100644 index 00000000..cb089cd8 --- /dev/null +++ b/test_data/test_repos/test_repo_6/dotGit/HEAD @@ -0,0 +1 @@ +ref: refs/heads/master diff --git a/test_data/test_repos/test_repo_6/dotGit/config b/test_data/test_repos/test_repo_6/dotGit/config new file mode 100644 index 00000000..6c9406b7 --- /dev/null +++ b/test_data/test_repos/test_repo_6/dotGit/config @@ -0,0 +1,7 @@ +[core] + repositoryformatversion = 0 + filemode = true + bare = false + logallrefupdates = true + ignorecase = true + precomposeunicode = true diff --git a/test_data/test_repos/test_repo_6/dotGit/description b/test_data/test_repos/test_repo_6/dotGit/description new file mode 100644 index 00000000..498b267a --- /dev/null +++ b/test_data/test_repos/test_repo_6/dotGit/description @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/test_data/test_repos/test_repo_6/dotGit/index b/test_data/test_repos/test_repo_6/dotGit/index new file mode 100644 index 00000000..9a4f995b Binary files /dev/null and b/test_data/test_repos/test_repo_6/dotGit/index differ diff --git a/test_data/test_repos/test_repo_6/dotGit/info/exclude b/test_data/test_repos/test_repo_6/dotGit/info/exclude new file mode 100644 index 00000000..a5196d1b --- /dev/null +++ b/test_data/test_repos/test_repo_6/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_6/dotGit/logs/HEAD b/test_data/test_repos/test_repo_6/dotGit/logs/HEAD new file mode 100644 index 00000000..1dee1f5f --- /dev/null +++ b/test_data/test_repos/test_repo_6/dotGit/logs/HEAD @@ -0,0 +1,4 @@ +0000000000000000000000000000000000000000 6557c92612d3b35979bd426d429255b3bf9fab74 zach rice 1571923767 -0400 commit (initial): commit 1 with secrets +6557c92612d3b35979bd426d429255b3bf9fab74 d274003914c707212cbe84e3e466a00013ccb639 zach rice 1571925818 -0400 commit: comment +d274003914c707212cbe84e3e466a00013ccb639 98b6c7cb3fb29a5993c4c95c56a2dc53050b9247 Noel Algora 1582571595 -0500 commit: Adding some secrets in config folder +98b6c7cb3fb29a5993c4c95c56a2dc53050b9247 98b6c7cb3fb29a5993c4c95c56a2dc53050b9247 Noel Algora 1582571636 -0500 discard: [bc379e22c22a97ca5ffc871c1449af854f6f26c4] diff --git a/test_data/test_repos/test_repo_6/dotGit/logs/refs/heads/master b/test_data/test_repos/test_repo_6/dotGit/logs/refs/heads/master new file mode 100644 index 00000000..1112c7db --- /dev/null +++ b/test_data/test_repos/test_repo_6/dotGit/logs/refs/heads/master @@ -0,0 +1,3 @@ +0000000000000000000000000000000000000000 6557c92612d3b35979bd426d429255b3bf9fab74 zach rice 1571923767 -0400 commit (initial): commit 1 with secrets +6557c92612d3b35979bd426d429255b3bf9fab74 d274003914c707212cbe84e3e466a00013ccb639 zach rice 1571925818 -0400 commit: comment +d274003914c707212cbe84e3e466a00013ccb639 98b6c7cb3fb29a5993c4c95c56a2dc53050b9247 Noel Algora 1582571595 -0500 commit: Adding some secrets in config folder diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/10/fa14c5ab0134436e2ae435138bf921eb477c60 b/test_data/test_repos/test_repo_6/dotGit/objects/10/fa14c5ab0134436e2ae435138bf921eb477c60 new file mode 100644 index 00000000..c32cf91d Binary files /dev/null and b/test_data/test_repos/test_repo_6/dotGit/objects/10/fa14c5ab0134436e2ae435138bf921eb477c60 differ diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/3a/76f3781306faf5612017bf18a4b4bdb9f927bf b/test_data/test_repos/test_repo_6/dotGit/objects/3a/76f3781306faf5612017bf18a4b4bdb9f927bf new file mode 100644 index 00000000..0bd54d2c Binary files /dev/null and b/test_data/test_repos/test_repo_6/dotGit/objects/3a/76f3781306faf5612017bf18a4b4bdb9f927bf differ diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/41/42082bcb939bbc17985a69ba748491ac6b62a5 b/test_data/test_repos/test_repo_6/dotGit/objects/41/42082bcb939bbc17985a69ba748491ac6b62a5 new file mode 100644 index 00000000..dba98289 Binary files /dev/null and b/test_data/test_repos/test_repo_6/dotGit/objects/41/42082bcb939bbc17985a69ba748491ac6b62a5 differ diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/49/8b267a8c7812490d6479839c5577eaaec79d62 b/test_data/test_repos/test_repo_6/dotGit/objects/49/8b267a8c7812490d6479839c5577eaaec79d62 new file mode 100644 index 00000000..b558235f Binary files /dev/null and b/test_data/test_repos/test_repo_6/dotGit/objects/49/8b267a8c7812490d6479839c5577eaaec79d62 differ diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/5c/b000d0f4965e9b0c080814478dbf4e87c114c7 b/test_data/test_repos/test_repo_6/dotGit/objects/5c/b000d0f4965e9b0c080814478dbf4e87c114c7 new file mode 100644 index 00000000..8226e026 Binary files /dev/null and b/test_data/test_repos/test_repo_6/dotGit/objects/5c/b000d0f4965e9b0c080814478dbf4e87c114c7 differ diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/60/c9e47f150a6b713e247e6105b77f1b961f844f b/test_data/test_repos/test_repo_6/dotGit/objects/60/c9e47f150a6b713e247e6105b77f1b961f844f new file mode 100644 index 00000000..e212d90f Binary files /dev/null and b/test_data/test_repos/test_repo_6/dotGit/objects/60/c9e47f150a6b713e247e6105b77f1b961f844f differ diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/61/87dbf4390fc6e28445dd3d988aefb9d1111988 b/test_data/test_repos/test_repo_6/dotGit/objects/61/87dbf4390fc6e28445dd3d988aefb9d1111988 new file mode 100644 index 00000000..eb42e868 Binary files /dev/null and b/test_data/test_repos/test_repo_6/dotGit/objects/61/87dbf4390fc6e28445dd3d988aefb9d1111988 differ diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/65/57c92612d3b35979bd426d429255b3bf9fab74 b/test_data/test_repos/test_repo_6/dotGit/objects/65/57c92612d3b35979bd426d429255b3bf9fab74 new file mode 100644 index 00000000..edf7d2fb Binary files /dev/null and b/test_data/test_repos/test_repo_6/dotGit/objects/65/57c92612d3b35979bd426d429255b3bf9fab74 differ diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/69/465772e5c3a14379da6c369cdb46edbaa6d097 b/test_data/test_repos/test_repo_6/dotGit/objects/69/465772e5c3a14379da6c369cdb46edbaa6d097 new file mode 100644 index 00000000..e59352e9 Binary files /dev/null and b/test_data/test_repos/test_repo_6/dotGit/objects/69/465772e5c3a14379da6c369cdb46edbaa6d097 differ diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/6a/756416384c210ada2631f17862f5c01fffa478 b/test_data/test_repos/test_repo_6/dotGit/objects/6a/756416384c210ada2631f17862f5c01fffa478 new file mode 100644 index 00000000..072ee533 Binary files /dev/null and b/test_data/test_repos/test_repo_6/dotGit/objects/6a/756416384c210ada2631f17862f5c01fffa478 differ diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/6c/9406b7d9320db083eca69b3f8bee9a6c7b50d4 b/test_data/test_repos/test_repo_6/dotGit/objects/6c/9406b7d9320db083eca69b3f8bee9a6c7b50d4 new file mode 100644 index 00000000..0d57232e Binary files /dev/null and b/test_data/test_repos/test_repo_6/dotGit/objects/6c/9406b7d9320db083eca69b3f8bee9a6c7b50d4 differ diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/6c/bef5c370d8c3486ca85423dd70440c5e0a2aa2 b/test_data/test_repos/test_repo_6/dotGit/objects/6c/bef5c370d8c3486ca85423dd70440c5e0a2aa2 new file mode 100644 index 00000000..b098b0b6 Binary files /dev/null and b/test_data/test_repos/test_repo_6/dotGit/objects/6c/bef5c370d8c3486ca85423dd70440c5e0a2aa2 differ diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/80/8b12c5ca4b142367932e7045d555a639fc148c b/test_data/test_repos/test_repo_6/dotGit/objects/80/8b12c5ca4b142367932e7045d555a639fc148c new file mode 100644 index 00000000..9cd8d694 Binary files /dev/null and b/test_data/test_repos/test_repo_6/dotGit/objects/80/8b12c5ca4b142367932e7045d555a639fc148c differ diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/80/ba94135cc378364af9d3cb2450df48e51faf2c b/test_data/test_repos/test_repo_6/dotGit/objects/80/ba94135cc378364af9d3cb2450df48e51faf2c new file mode 100644 index 00000000..86d326dd Binary files /dev/null and b/test_data/test_repos/test_repo_6/dotGit/objects/80/ba94135cc378364af9d3cb2450df48e51faf2c differ diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/98/b6c7cb3fb29a5993c4c95c56a2dc53050b9247 b/test_data/test_repos/test_repo_6/dotGit/objects/98/b6c7cb3fb29a5993c4c95c56a2dc53050b9247 new file mode 100644 index 00000000..f3467bbd Binary files /dev/null and b/test_data/test_repos/test_repo_6/dotGit/objects/98/b6c7cb3fb29a5993c4c95c56a2dc53050b9247 differ diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/9e/523225b31add24e72f2feb0b2645cfb36542dc b/test_data/test_repos/test_repo_6/dotGit/objects/9e/523225b31add24e72f2feb0b2645cfb36542dc new file mode 100644 index 00000000..2103921e --- /dev/null +++ b/test_data/test_repos/test_repo_6/dotGit/objects/9e/523225b31add24e72f2feb0b2645cfb36542dc @@ -0,0 +1,3 @@ +xMŽO ‚@Å;ï§è`‘%:XjE ¢<ɺ;˜¤»°³~ûÌ +z§÷`~ïMVê Fþ´Ó…PƒÒnÜHZ"ƒ•-xIL”Eca™¶Ú÷>±Ç ‘C¾ã¶® «,�¬)TNÀé¿Èm7 +]U¨$J¯%ù“R.¥w¬ÓBΜ`³Ö‡q|÷ûIt vÇmôÝy_6ïÙ?¨!æ‹0Šb´�ÔW\>ε9æ …êr:-†Aò+a}Æ^K§N$ \ No newline at end of file diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/a1/ddd32febf3bde66331218f877ff637c85c5f92 b/test_data/test_repos/test_repo_6/dotGit/objects/a1/ddd32febf3bde66331218f877ff637c85c5f92 new file mode 100644 index 00000000..0867e75c Binary files /dev/null and b/test_data/test_repos/test_repo_6/dotGit/objects/a1/ddd32febf3bde66331218f877ff637c85c5f92 differ diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/a1/fd29ec14823d8bc4a8d1a2cfe35451580f5118 b/test_data/test_repos/test_repo_6/dotGit/objects/a1/fd29ec14823d8bc4a8d1a2cfe35451580f5118 new file mode 100644 index 00000000..b72c5f77 --- /dev/null +++ b/test_data/test_repos/test_repo_6/dotGit/objects/a1/fd29ec14823d8bc4a8d1a2cfe35451580f5118 @@ -0,0 +1,3 @@ +xuPMOÃ0 åÚüŠGV1lc.LEB`†Ä¸!Miç*a]R5!þ;N‡øââÄö{ÏÏÎ+—ãìôt§³;Ì�z-:¢ƒK zQ«º"hç–ðEcê€à°RKÂÚ\‰zí5\Œ³~À¬™¦/š7Ì~Ú‘‡ªª_h­|PMÀÆ�næªXf]Rv�†ž¨ßTVÙh²Ì$ÈmSþÔ„ñÑׂ�D+dUÎþƒæF\âˆ%­Z}VJ{²n¨ßPAæ™ä@S"�è[Èôz2›ß=Üß̧w³Éôv~5}¸�IÁ¬HLv,’�nu"C¦F¢_ÅÏ?¼dáD’гª 9¬){üeÆŠ/,Ó$axZòu ƒgm +‹(·jÏòc•~Üøé[+Ñ9ÈÞ%.öN"s<æ¸=àVéŌ⯠+~L–îïbÔãþÂY¥eMª$ \ No newline at end of file diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/a4/fa2187727281aea78d7c3aaebdb4b924fc4e4d b/test_data/test_repos/test_repo_6/dotGit/objects/a4/fa2187727281aea78d7c3aaebdb4b924fc4e4d new file mode 100644 index 00000000..0aabdd40 Binary files /dev/null and b/test_data/test_repos/test_repo_6/dotGit/objects/a4/fa2187727281aea78d7c3aaebdb4b924fc4e4d differ diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/a5/196d1be8fb59edf8062bef36d3a602e0812139 b/test_data/test_repos/test_repo_6/dotGit/objects/a5/196d1be8fb59edf8062bef36d3a602e0812139 new file mode 100644 index 00000000..62de872c --- /dev/null +++ b/test_data/test_repos/test_repo_6/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_6/dotGit/objects/a5/d7b84a673458d14d9aab082183a1968c2c7492 b/test_data/test_repos/test_repo_6/dotGit/objects/a5/d7b84a673458d14d9aab082183a1968c2c7492 new file mode 100644 index 00000000..cafdfdb1 Binary files /dev/null and b/test_data/test_repos/test_repo_6/dotGit/objects/a5/d7b84a673458d14d9aab082183a1968c2c7492 differ diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/b5/8d1184a9d43a39c0d95f32453efc78581877d6 b/test_data/test_repos/test_repo_6/dotGit/objects/b5/8d1184a9d43a39c0d95f32453efc78581877d6 new file mode 100644 index 00000000..043d9c54 Binary files /dev/null and b/test_data/test_repos/test_repo_6/dotGit/objects/b5/8d1184a9d43a39c0d95f32453efc78581877d6 differ diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/bc/379e22c22a97ca5ffc871c1449af854f6f26c4 b/test_data/test_repos/test_repo_6/dotGit/objects/bc/379e22c22a97ca5ffc871c1449af854f6f26c4 new file mode 100644 index 00000000..ad8ee05b Binary files /dev/null and b/test_data/test_repos/test_repo_6/dotGit/objects/bc/379e22c22a97ca5ffc871c1449af854f6f26c4 differ diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/c9/8e6c52cbd1f50de572ff12a3441271fccff705 b/test_data/test_repos/test_repo_6/dotGit/objects/c9/8e6c52cbd1f50de572ff12a3441271fccff705 new file mode 100644 index 00000000..14206b0b Binary files /dev/null and b/test_data/test_repos/test_repo_6/dotGit/objects/c9/8e6c52cbd1f50de572ff12a3441271fccff705 differ diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/cb/089cd89a7d7686d284d8761201649346b5aa1c b/test_data/test_repos/test_repo_6/dotGit/objects/cb/089cd89a7d7686d284d8761201649346b5aa1c new file mode 100644 index 00000000..17c8d93c Binary files /dev/null and b/test_data/test_repos/test_repo_6/dotGit/objects/cb/089cd89a7d7686d284d8761201649346b5aa1c differ diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/cb/19a50e8cdeb7011eccdb13f3b739f00d775bab b/test_data/test_repos/test_repo_6/dotGit/objects/cb/19a50e8cdeb7011eccdb13f3b739f00d775bab new file mode 100644 index 00000000..692983a5 --- /dev/null +++ b/test_data/test_repos/test_repo_6/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_6/dotGit/objects/d2/74003914c707212cbe84e3e466a00013ccb639 b/test_data/test_repos/test_repo_6/dotGit/objects/d2/74003914c707212cbe84e3e466a00013ccb639 new file mode 100644 index 00000000..142e1a6d Binary files /dev/null and b/test_data/test_repos/test_repo_6/dotGit/objects/d2/74003914c707212cbe84e3e466a00013ccb639 differ diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/db/4ccd6cc9ef282e9bf2f8c5f7877f0d40520724 b/test_data/test_repos/test_repo_6/dotGit/objects/db/4ccd6cc9ef282e9bf2f8c5f7877f0d40520724 new file mode 100644 index 00000000..7f843177 Binary files /dev/null and b/test_data/test_repos/test_repo_6/dotGit/objects/db/4ccd6cc9ef282e9bf2f8c5f7877f0d40520724 differ diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/dd/6e8207f130e113c97f5ed15238e7901290ee42 b/test_data/test_repos/test_repo_6/dotGit/objects/dd/6e8207f130e113c97f5ed15238e7901290ee42 new file mode 100644 index 00000000..db5b596e Binary files /dev/null and b/test_data/test_repos/test_repo_6/dotGit/objects/dd/6e8207f130e113c97f5ed15238e7901290ee42 differ diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/dd/cd9ac6904950dcc48e4c04ba043707e9e0117f b/test_data/test_repos/test_repo_6/dotGit/objects/dd/cd9ac6904950dcc48e4c04ba043707e9e0117f new file mode 100644 index 00000000..44c4916c Binary files /dev/null and b/test_data/test_repos/test_repo_6/dotGit/objects/dd/cd9ac6904950dcc48e4c04ba043707e9e0117f differ diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/e6/73bb3980f3c286291809e05f80873852bc3e9c b/test_data/test_repos/test_repo_6/dotGit/objects/e6/73bb3980f3c286291809e05f80873852bc3e9c new file mode 100644 index 00000000..144d4077 Binary files /dev/null and b/test_data/test_repos/test_repo_6/dotGit/objects/e6/73bb3980f3c286291809e05f80873852bc3e9c differ diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/e9/e5396f7e52aa48de485b4836ebb041cc7f7c46 b/test_data/test_repos/test_repo_6/dotGit/objects/e9/e5396f7e52aa48de485b4836ebb041cc7f7c46 new file mode 100644 index 00000000..da7e1c7c Binary files /dev/null and b/test_data/test_repos/test_repo_6/dotGit/objects/e9/e5396f7e52aa48de485b4836ebb041cc7f7c46 differ diff --git a/test_data/test_repos/test_repo_6/dotGit/objects/ec/17ec1939b7c3e86b7cb6c0c4de6b0818a7e75e b/test_data/test_repos/test_repo_6/dotGit/objects/ec/17ec1939b7c3e86b7cb6c0c4de6b0818a7e75e new file mode 100644 index 00000000..d7558de5 --- /dev/null +++ b/test_data/test_repos/test_repo_6/dotGit/objects/ec/17ec1939b7c3e86b7cb6c0c4de6b0818a7e75e @@ -0,0 +1,2 @@ +x-ÍK‚0P×9E [�r§Kïà&0H +Ȥ&ƒ…·7~–Ý]õÚ/âq¾\õ±ó!vyrµ«q‹à�Ö´0&‘¹×� &Hʉ”AHÔÏ< dÉÁD_E±e†