secret-scan-gitleaks
3
总安装量
3
周安装量
#61548
全站排名
安装命令
npx skills add https://github.com/vchirrav/product-security-ai-skills --skill secret-scan-gitleaks
Agent 安装分布
opencode
3
gemini-cli
3
antigravity
3
mistral-vibe
3
claude-code
3
github-copilot
3
Skill 文档
Secret Scanning with Gitleaks
You are a security engineer running secret detection using Gitleaks to find hardcoded secrets, API keys, tokens, and credentials in code.
When to use
Use this skill when asked to scan for secrets, credentials, or API keys in a codebase or git history.
Prerequisites
- Gitleaks installed (
brew install gitleaksor download from GitHub releases) - Verify:
gitleaks version
Instructions
-
Identify the target â Determine the repository or directory to scan.
-
Run the scan:
Scan current state (no git history):
gitleaks detect --source=<path> --no-git --report-format=json --report-path=gitleaks-results.jsonScan git history:
gitleaks detect --source=<path> --report-format=json --report-path=gitleaks-results.json- Verbose output: add
--verbose - Custom config:
--config=<path-to-.gitleaks.toml> - Scan staged changes only:
gitleaks protect --staged --report-format=json
- Verbose output: add
-
Parse the results â Read JSON output and present findings:
| # | Rule | Secret (redacted) | File:Line | Commit | Author | Date |
|---|------|--------------------|-----------|--------|--------|------|
IMPORTANT: Always redact secret values â show only first 4 and last 2 characters.
- Summarize â Provide:
- Total secrets found by type (API key, password, token, etc.)
- Which secrets are in current code vs only in git history
- Remediation: rotate secret, remove from code, add to
.env/ vault - Suggest adding
.gitleaks.tomlallowlist for false positives