secret-detection-scanner
Detect secrets, credentials, and sensitive data in code and configurations. Scan git history for secrets, detect API keys, tokens, passwords, check environment files, monitor CI/CD logs for exposure, generate remediation steps, and track secret rotation status.
What this skill does
# secret-detection-scanner
You are **secret-detection-scanner** - a specialized skill for detecting secrets, credentials, and sensitive data in code, configurations, and git history. This skill provides comprehensive capabilities for preventing secret exposure and managing credential security.
## Overview
This skill enables AI-powered secret detection including:
- Gitleaks secret scanning in code and git history
- TruffleHog deep commit scanning
- detect-secrets baseline management
- API key, token, and password detection
- Pre-commit hook integration
- CI/CD pipeline secret monitoring
- Remediation guidance and rotation tracking
## Prerequisites
- Git repository to scan
- CLI tools: gitleaks, trufflehog, detect-secrets (as needed)
- Git for history scanning
- Pre-commit framework (optional)
## Capabilities
### 1. Gitleaks Secret Scanning
Fast and comprehensive secret detection:
```bash
# Scan current directory
gitleaks detect --source . --report-format json --report-path gitleaks-report.json
# Scan with verbose output
gitleaks detect --source . -v --report-format json --report-path gitleaks-report.json
# Scan git history
gitleaks detect --source . --log-opts="--all" --report-format json
# Scan specific commits
gitleaks detect --source . --log-opts="HEAD~10..HEAD" --report-format json
# Scan with custom config
gitleaks detect --source . --config .gitleaks.toml --report-format json
# Scan staged files only (pre-commit)
gitleaks protect --source . --staged --report-format json
# Scan specific branch
gitleaks detect --source . --log-opts="origin/main..HEAD" --report-format json
# Generate SARIF output for GitHub
gitleaks detect --source . --report-format sarif --report-path gitleaks.sarif
```
#### Gitleaks Configuration
```toml
# .gitleaks.toml
[extend]
useDefault = true
[allowlist]
description = "Global allowlist"
paths = [
'''\.gitleaks\.toml$''',
'''(.*?)(test|spec|mock)(.*)''',
'''vendor/''',
'''node_modules/''',
]
# Custom rule for internal API keys
[[rules]]
id = "internal-api-key"
description = "Internal API Key"
regex = '''INTERNAL_API_KEY\s*=\s*['"]([a-zA-Z0-9]{32})['"]'''
tags = ["internal", "api-key"]
keywords = ["INTERNAL_API_KEY"]
# Allowlist specific findings
[[rules.allowlist]]
regexes = ['''test-api-key-12345''']
```
### 2. TruffleHog Deep Scanning
Comprehensive entropy and pattern-based detection:
```bash
# Scan filesystem
trufflehog filesystem . --json > trufflehog-results.json
# Scan git repository
trufflehog git file://. --json > trufflehog-git.json
# Scan remote git repository
trufflehog git https://github.com/org/repo.git --json
# Scan specific branch
trufflehog git file://. --branch main --json
# Scan with only verified results
trufflehog git file://. --only-verified --json
# Scan GitHub organization
trufflehog github --org myorg --json
# Scan S3 bucket
trufflehog s3 --bucket mybucket --json
# Include archived repos
trufflehog github --org myorg --include-archived --json
```
#### TruffleHog Detectors
| Category | Secrets Detected |
|----------|------------------|
| Cloud Providers | AWS, GCP, Azure credentials |
| Version Control | GitHub, GitLab tokens |
| Communication | Slack, Discord, Twilio |
| Payment | Stripe, PayPal, Square |
| Database | MongoDB, PostgreSQL, Redis |
| AI/ML | OpenAI, Anthropic, HuggingFace |
| General | Private keys, JWT, OAuth |
### 3. detect-secrets Baseline Management
Baseline-driven secret detection with audit trail:
```bash
# Create baseline
detect-secrets scan > .secrets.baseline
# Scan with existing baseline
detect-secrets scan --baseline .secrets.baseline
# Audit baseline (interactive)
detect-secrets audit .secrets.baseline
# Update baseline
detect-secrets scan --baseline .secrets.baseline --update
# Scan specific files
detect-secrets scan src/ tests/ --baseline .secrets.baseline
# Use specific plugins
detect-secrets scan --list-all-plugins
detect-secrets scan --no-keyword-scan --no-base64-string-scan
```
#### Baseline File Schema
```json
{
"version": "1.4.0",
"plugins_used": [
{"name": "AWSKeyDetector"},
{"name": "ArtifactoryDetector"},
{"name": "Base64HighEntropyString", "limit": 4.5},
{"name": "BasicAuthDetector"},
{"name": "PrivateKeyDetector"}
],
"filters_used": [
{"path": "detect_secrets.filters.allowlist.is_line_allowlisted"},
{"path": "detect_secrets.filters.common.is_ignored_due_to_verification_policies"}
],
"results": {
"config/settings.py": [
{
"type": "Secret Keyword",
"filename": "config/settings.py",
"hashed_secret": "abc123...",
"is_verified": false,
"line_number": 42
}
]
}
}
```
### 4. Pre-commit Integration
```yaml
# .pre-commit-config.yaml
repos:
- repo: https://github.com/gitleaks/gitleaks
rev: v8.18.0
hooks:
- id: gitleaks
- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
hooks:
- id: detect-secrets
args: ['--baseline', '.secrets.baseline']
- repo: https://github.com/trufflesecurity/trufflehog
rev: v3.63.0
hooks:
- id: trufflehog
```
Install and run:
```bash
# Install pre-commit
pip install pre-commit
# Install hooks
pre-commit install
# Run manually on all files
pre-commit run --all-files
```
### 5. CI/CD Integration
#### GitHub Actions
```yaml
name: Secret Scan
on: [push, pull_request]
jobs:
gitleaks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Gitleaks
uses: gitleaks/gitleaks-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE }}
trufflehog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: TruffleHog
uses: trufflesecurity/trufflehog@main
with:
extra_args: --only-verified
```
#### GitLab CI
```yaml
secret-scan:
image: zricethezav/gitleaks:latest
script:
- gitleaks detect --source . --report-format json --report-path gitleaks-report.json
artifacts:
reports:
secret_detection: gitleaks-report.json
```
### 6. Secret Categories and Patterns
| Category | Examples | Risk Level |
|----------|----------|------------|
| Cloud Credentials | AWS_SECRET_ACCESS_KEY, GCP service account | Critical |
| API Keys | OpenAI, Stripe, SendGrid | High |
| Database | Connection strings, passwords | Critical |
| Private Keys | RSA, SSH, PGP | Critical |
| OAuth/JWT | Bearer tokens, refresh tokens | High |
| Internal | Internal API keys, service tokens | Medium |
| Generic | High-entropy strings | Low-Medium |
### 7. Remediation Workflow
When a secret is detected:
```bash
# 1. Identify affected commits
gitleaks detect --source . --log-opts="--all" -v
# 2. Revoke the secret immediately
# (Provider-specific - AWS console, GitHub settings, etc.)
# 3. Remove from git history (if needed)
# Option A: BFG Repo Cleaner
bfg --delete-files secrets.txt
bfg --replace-text passwords.txt
# Option B: git filter-repo
git filter-repo --path secrets.txt --invert-paths
# 4. Force push (with team coordination)
git push origin --force --all
# 5. Generate new credentials
# (Provider-specific)
# 6. Update deployment
# Update environment variables, secrets managers, etc.
# 7. Add to allowlist if false positive
# Update .gitleaks.toml or .secrets.baseline
```
### 8. Secret Rotation Tracking
```json
{
"secrets_inventory": [
{
"id": "aws-prod-key",
"type": "AWS_ACCESS_KEY",
"environment": "production",
"created_at": "2025-07-01T00:00:00Z",
"last_rotated": "2025-12-01T00:00:00Z",
"rotation_policy_days": 90,
"next_rotation": "2026-03-01T00:00:00Z",
"status": "valid",
"storage": "AWS Secrets Manager"
}
],
"rotation_schedule": {
"critical": 30,
"high": 60,
"medium": 90,
"low": 180
}
}
```
## MCP ServerRelated in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.