Agent skill
secret-scanner
Scans git repositories for hardcoded secrets, credentials, and API keys using Gitleaks. Returns findings with severity, location, and remediation steps. Use when user asks to "scan for secrets", "detect credentials", "find API keys", "check for leaks", "シークレット検出", "認証情報スキャン".
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/development/secret-scanner
SKILL.md
Secret Scanner
Wrapper for Gitleaks to detect hardcoded secrets in git repositories.
Prerequisites
Gitleaks must be installed:
# macOS
brew install gitleaks
# Go
go install github.com/gitleaks/gitleaks/v8@latest
# Docker
docker pull zricethezav/gitleaks
Usage
# Scan current directory
npx secret-scanner .
# Scan with JSON output
npx secret-scanner . --json
# Scan specific path
npx secret-scanner /path/to/repo
# Check if gitleaks is installed
npx secret-scanner --check
Output Format
{
"tool": "gitleaks",
"scanPath": ".",
"findings": [
{
"id": "aws-access-key-id",
"severity": "critical",
"description": "AWS Access Key ID detected",
"file": "config.js",
"line": 15,
"secret": "AKIA***REDACTED***",
"commit": "abc1234",
"author": "developer@example.com",
"date": "2024-01-15T10:30:00Z"
}
],
"summary": {
"total": 1,
"critical": 1,
"high": 0,
"medium": 0,
"low": 0
}
}
Exit Codes
0: No secrets found1: Secrets detected2: Tool not installed or error
Severity Mapping
| Gitleaks Rule | Severity |
|---|---|
| aws-access-key-id | critical |
| private-key | critical |
| password | high |
| api-key | high |
| token | medium |
| generic-credential | low |
CWE Coverage
- CWE-798: Use of Hard-coded Credentials
- CWE-259: Use of Hard-coded Password
- CWE-321: Use of Hard-coded Cryptographic Key
- CWE-312: Cleartext Storage of Sensitive Information
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?