gitleaks_scan
Scan repositories and directories to uncover exposed secrets and credentials, using project history, staged changes, or direct file scanning. Outputs detailed findings with redacted secret values.
Instructions
Scan a repository or directory for secrets and credentials using Gitleaks.
Args: target: Local path to a Git repository or directory to scan. scan_type: Scan mode — detect (full repo history), protect (pre-commit staged changes), dir (scan directory without git history). report_format: Output format — json, csv, sarif. timeout: Override default timeout.
Returns: List of secret findings with rule ID, file, commit, description, and partially-redacted secret.
Note: - Target path must be under an allowed directory (/usr/share, /opt, $HOME, /tmp). - Use detect for comprehensive historical scans. - Use protect as a pre-commit hook to catch secrets before they are committed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | Yes | ||
| timeout | No | ||
| scan_type | No | detect | |
| report_format | No | json |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||