mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-29 20:54:22 +01:00
updating readme and comments
This commit is contained in:
1 parent
2810eccc82
commit
e7fbcf5333
2 files changed
+38
-35
No files matched your search
@@ -55,42 +55,42 @@ Usage:
|
|||||||
gitleaks [OPTIONS]
|
gitleaks [OPTIONS]
|
||||||
|
|
||||||
Application Options:
|
Application Options:
|
||||||
-v, --verbose Show verbose output from audit
|
-v, --verbose Show verbose output from audit
|
||||||
-r, --repo= Target repository
|
-r, --repo= Target repository
|
||||||
--config= config path
|
--config= config path
|
||||||
--disk Clones repo(s) to disk
|
--disk Clones repo(s) to disk
|
||||||
--version version number
|
--version version number
|
||||||
--username= Username for git repo
|
--username= Username for git repo
|
||||||
--password= Password for git repo
|
--password= Password for git repo
|
||||||
--access-token= Access token for git repo
|
--access-token= Access token for git repo
|
||||||
--commit= sha of commit to audit
|
--commit= sha of commit to audit
|
||||||
--threads= Maximum number of threads gitleaks spawns
|
--files-at-commit= sha of commit to audit all files at commit
|
||||||
--ssh-key= path to ssh key used for auth
|
--threads= Maximum number of threads gitleaks spawns
|
||||||
--uncommitted run gitleaks on uncommitted code
|
--ssh-key= path to ssh key used for auth
|
||||||
--repo-path= Path to repo
|
--uncommitted run gitleaks on uncommitted code
|
||||||
--owner-path= Path to owner directory (repos discovered)
|
--repo-path= Path to repo
|
||||||
--branch= Branch to audit
|
--owner-path= Path to owner directory (repos discovered)
|
||||||
--report= path to write json leaks file
|
--branch= Branch to audit
|
||||||
--report-format= json or csv (default: json)
|
--report= path to write json leaks file
|
||||||
--redact redact secrets from log messages and leaks
|
--report-format= json or csv (default: json)
|
||||||
--debug log debug messages
|
--redact redact secrets from log messages and leaks
|
||||||
--repo-config Load config from target repo. Config file must be ".gitleaks.toml" or "gitleaks.toml"
|
--debug log debug messages
|
||||||
--pretty Pretty print json if leaks are present
|
--repo-config Load config from target repo. Config file must be ".gitleaks.toml" or "gitleaks.toml"
|
||||||
--commit-from= Commit to start audit from
|
--pretty Pretty print json if leaks are present
|
||||||
--commit-to= Commit to stop audit
|
--commit-from= Commit to start audit from
|
||||||
--timeout= Time allowed per audit. Ex: 10us, 30s, 1m, 1h10m1s
|
--commit-to= Commit to stop audit
|
||||||
--depth= Number of commits to audit
|
--timeout= Time allowed per audit. Ex: 10us, 30s, 1m, 1h10m1s
|
||||||
|
--depth= Number of commits to audit
|
||||||
|
|
||||||
--host= git hosting service like gitlab or github. Supported hosts include: Github, Gitlab
|
--host= git hosting service like gitlab or github. Supported hosts include: Github, Gitlab
|
||||||
--baseurl= Base URL for API requests. Defaults to the public GitLab or GitHub API, but can be set to a domain endpoint to use with a self hosted server.
|
--baseurl= Base URL for API requests. Defaults to the public GitLab or GitHub API, but can be set to a domain endpoint to use with a self hosted server.
|
||||||
--org= organization to audit
|
--org= organization to audit
|
||||||
--user= user to audit
|
--user= user to audit
|
||||||
--pr= pull/merge request url
|
--pr= pull/merge request url
|
||||||
--exclude-forks audit excludes forks
|
--exclude-forks audit excludes forks
|
||||||
|
|
||||||
Help Options:
|
Help Options:
|
||||||
-h, --help Show this help message
|
-h, --help Show this help message
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Docker usage examples
|
### Docker usage examples
|
||||||
|
|||||||
+5
-2
@@ -257,6 +257,9 @@ func InspectString(content string, c *object.Commit, repo *Repo, filename string
|
|||||||
|
|
||||||
type commitInspector func(c *object.Commit, repo *Repo) error
|
type commitInspector func(c *object.Commit, repo *Repo) error
|
||||||
|
|
||||||
|
// inspectCommit accepts a commit hash, repo, and commit inspecting function. A new commit
|
||||||
|
// object will be created from the hash which will be passed into either inspectCommitPatches
|
||||||
|
// or inspectFilesAtCommit depending on the options set.
|
||||||
func inspectCommit(hash string, repo *Repo, f commitInspector) error {
|
func inspectCommit(hash string, repo *Repo, f commitInspector) error {
|
||||||
h := plumbing.NewHash(hash)
|
h := plumbing.NewHash(hash)
|
||||||
c, err := repo.CommitObject(h)
|
c, err := repo.CommitObject(h)
|
||||||
@@ -301,8 +304,8 @@ func inspectCommitPatches(c *object.Commit, repo *Repo) error {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// inspectFilesAtCommit accepts a commit object and a repo. This function is only called when the --commit=
|
// inspectFilesAtCommit accepts a commit object and a repo. This function is only called when the --files-at-commit=
|
||||||
// option has been set. That option tells gitleaks to look only at a single commit and check the contents
|
// option has been set. That option tells gitleaks to look only at ALL the files at a commit and check the contents
|
||||||
// of said commit. Similar to inspectPatch(), if the files contained in the commit are a binaries or if they are
|
// of said commit. Similar to inspectPatch(), if the files contained in the commit are a binaries or if they are
|
||||||
// whitelisted then those files will be skipped.
|
// whitelisted then those files will be skipped.
|
||||||
func inspectFilesAtCommit(c *object.Commit, repo *Repo) error {
|
func inspectFilesAtCommit(c *object.Commit, repo *Repo) error {
|
||||||
|
|||||||
Reference in new issue
Block a user