From 476f78d77cbe612ba86259be0712a977b643dd33 Mon Sep 17 00:00:00 2001 From: ivuorinen Date: Thu, 25 Apr 2024 00:14:25 +0000 Subject: [PATCH] Update cheatsheets --- tldr/gitleaks | 37 +++++++++++++++++++++++++++++++++++++ tldr/ps | 4 ++-- 2 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 tldr/gitleaks diff --git a/tldr/gitleaks b/tldr/gitleaks new file mode 100644 index 00000000..22462dd7 --- /dev/null +++ b/tldr/gitleaks @@ -0,0 +1,37 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# 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` diff --git a/tldr/ps b/tldr/ps index 3fa99d23..24f133fd 100644 --- a/tldr/ps +++ b/tldr/ps @@ -16,9 +16,9 @@ source: https://github.com/tldr-pages/tldr.git `ps auxww` -- Search for a process that matches a string: +- Search for a process that matches a string (the brackets will prevent `grep` from matching itself): -`ps aux | grep {{string}}` +`ps aux | grep {{[s]tring}}` - List all processes of the current user in extra full format: