offensive-tools/cloud/gitleaks/SKILL.md
Detect hardcoded secrets (API keys, tokens, credentials) in git repos and files. Use when auditing source code, CI pipelines, or commit history for leaked secrets in red-team or pre-engagement recon.
npx skillsauth add aeondave/malskill gitleaksInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Detect hardcoded secrets in git repos, files, and CI pipelines.
# Scan current git repo
gitleaks detect --source . -v
# Scan a remote repo
gitleaks detect --source https://github.com/org/repo
# Scan specific path (non-git)
gitleaks detect --source /path/to/dir --no-git
# Generate report
gitleaks detect --source . -r report.json -f json
| Flag | Purpose |
|------|---------|
| detect | Scan for secrets |
| protect | Pre-commit hook mode |
| --source PATH | Target path or URL |
| --no-git | Scan filesystem (not git history) |
| -r FILE | Report output file |
| -f FORMAT | Output format (json/csv/sarif) |
| -v | Verbose |
| --config FILE | Custom rules config |
| --branch NAME | Scan specific branch |
| --log-opts | Git log options (e.g. --all) |
Full history scan:
gitleaks detect --source . --log-opts="--all" -r leaks.json -f json
CI pipeline integration (fail on leak):
gitleaks detect --source . --exit-code 1
Custom rule for internal tokens:
# .gitleaks.toml
[[rules]]
id = "internal-api-key"
regex = '''MYAPP_[A-Z0-9]{32}'''
| File | When to load |
|------|--------------|
| references/ | Custom rule examples and CI config |
development
Auth/lab ref: Unicorn Engine CPU-only emulation for shellcode, decryptors, custom VM handlers, instruction tracing, memory hooks, and register-level experiments.
development
Auth/lab ref: Renode board and SoC simulation for MCU/RTOS firmware, UART/GPIO/peripheral modeling, GDB remote debugging, REPL platforms, and RESC scripts.
development
Auth/lab ref: Qiling OS-layer binary emulation for PE/ELF/Mach-O/UEFI/shellcode with rootfs, syscall/API hooks, filesystem mapping, and runtime patching.
databases
Auth/lab ref: QEMU user-mode and full-system emulation for cross-arch binaries, firmware, kernels, disks, serial consoles, networking, and GDB stubs.