From 6789ec99a893dcbc2a5871f30baf2fb01daf4cbc Mon Sep 17 00:00:00 2001 From: pacy Date: Thu, 25 Apr 2024 06:31:17 +0900 Subject: [PATCH] gitleaks: add page (#12653) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: K.B.Dharun Krishna Co-authored-by: VĂ­tor Henrique <87824454+vitorhcl@users.noreply.github.com> --- pages/common/gitleaks.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 pages/common/gitleaks.md diff --git a/pages/common/gitleaks.md b/pages/common/gitleaks.md new file mode 100644 index 0000000000..e8f619eb0c --- /dev/null +++ b/pages/common/gitleaks.md @@ -0,0 +1,32 @@ +# gitleaks + +> Detect secrets and API keys leaked in Git repositories. +> More information: . + +- Scan a remote repository: + +`gitleaks detect --repo-url {{https://github.com/username/repository.git}}` + +- Scan a local directory: + +`gitleaks detect --source {{path/to/repository}}` + +- Output scan results to a JSON file: + +`gitleaks detect --source {{path/to/repository}} --report {{path/to/report.json}}` + +- Use a custom rules file: + +`gitleaks detect --source {{path/to/repository}} --config-path {{path/to/config.toml}}` + +- Start scanning from a specific commit: + +`gitleaks detect --source {{path/to/repository}} --log-opts {{--since=commit_id}}` + +- Scan uncommitted changes before a commit: + +`gitleaks protect --staged` + +- Display verbose output indicating which parts were identified as leaks during the scan: + +`gitleaks protect --staged --verbose`