mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-29 12:44:22 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
08498600d1 | ||
|
|
88c0c7779b |
No files matched your search
@@ -1,6 +1,10 @@
|
|||||||
CHANGELOG
|
CHANGELOG
|
||||||
=========
|
=========
|
||||||
|
|
||||||
|
1.9.0
|
||||||
|
-----
|
||||||
|
- exclude fork option
|
||||||
|
|
||||||
1.8.0
|
1.8.0
|
||||||
-----
|
-----
|
||||||
- whitelist repos
|
- whitelist repos
|
||||||
|
|||||||
+10
-1
@@ -279,11 +279,20 @@ func TestRun(t *testing.T) {
|
|||||||
testOpts: Options{
|
testOpts: Options{
|
||||||
GithubOrg: "gitleakstestorg",
|
GithubOrg: "gitleakstestorg",
|
||||||
},
|
},
|
||||||
description: "test github org",
|
description: "test github org, whitelist repo",
|
||||||
numLeaks: 0,
|
numLeaks: 0,
|
||||||
expectedErrMsg: "",
|
expectedErrMsg: "",
|
||||||
configPath: path.Join(configsDir, "repo"),
|
configPath: path.Join(configsDir, "repo"),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
testOpts: Options{
|
||||||
|
GithubOrg: "gitleakstestorg",
|
||||||
|
ExcludeForks: true,
|
||||||
|
},
|
||||||
|
description: "test github org, exclude forks",
|
||||||
|
numLeaks: 0,
|
||||||
|
expectedErrMsg: "",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
g := goblin.Goblin(t)
|
g := goblin.Goblin(t)
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ type Options struct {
|
|||||||
SingleSearch string `long:"single-search" description:"single regular expression to search for"`
|
SingleSearch string `long:"single-search" description:"single regular expression to search for"`
|
||||||
ConfigPath string `long:"config" description:"path to gitleaks config"`
|
ConfigPath string `long:"config" description:"path to gitleaks config"`
|
||||||
SSHKey string `long:"ssh-key" description:"path to ssh key"`
|
SSHKey string `long:"ssh-key" description:"path to ssh key"`
|
||||||
|
ExcludeForks bool `long:"exclude-forks" description:"exclude forks for organization/user audits"`
|
||||||
// TODO: IncludeMessages string `long:"messages" description:"include commit messages in audit"`
|
// TODO: IncludeMessages string `long:"messages" description:"include commit messages in audit"`
|
||||||
|
|
||||||
// Output options
|
// Output options
|
||||||
@@ -123,7 +124,7 @@ type gitDiff struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const defaultGithubURL = "https://api.github.com/"
|
const defaultGithubURL = "https://api.github.com/"
|
||||||
const version = "1.8.0"
|
const version = "1.9.0"
|
||||||
const errExit = 2
|
const errExit = 2
|
||||||
const leakExit = 1
|
const leakExit = 1
|
||||||
const defaultConfig = `
|
const defaultConfig = `
|
||||||
@@ -715,6 +716,9 @@ func cloneGithubRepo(githubRepo *github.Repository) (*RepoDescriptor, error) {
|
|||||||
repo *git.Repository
|
repo *git.Repository
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
|
if opts.ExcludeForks && githubRepo.GetFork() {
|
||||||
|
return nil, fmt.Errorf("skipping %s, excluding forks", *githubRepo.Name)
|
||||||
|
}
|
||||||
for _, repoName := range whiteListRepos {
|
for _, repoName := range whiteListRepos {
|
||||||
if repoName == *githubRepo.Name {
|
if repoName == *githubRepo.Name {
|
||||||
return nil, fmt.Errorf("skipping %s, whitelisted", repoName)
|
return nil, fmt.Errorf("skipping %s, whitelisted", repoName)
|
||||||
|
|||||||
Reference in new issue
Block a user