Jeffallan/claude-skills / skills/security-reviewer
security-reviewer
FlaggedIdentifies security vulnerabilities, generates structured audit reports with severity ratings, and provides actionable remediation guidance. Use when conducting security audits, reviewing code for vulnerabilities, or analyzing infrastructure security. Invoke for SAST scans, penetration testing, DevSecOps practices, cloud security reviews, dependency audits, secrets scanning, or compliance checks. Produces vulnerability reports, prioritized recommendations, and compliance checklists.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 4.9 KB |
| references/infrastructure-security.md | markdown | 5.8 KB |
| references/penetration-testing.md | markdown | 5.8 KB |
| references/report-template.md | markdown | 3.7 KB |
| references/sast-tools.md | markdown | 2.4 KB |
| references/secret-scanning.md | markdown | 2.9 KB |
| references/vulnerability-patterns.md | markdown | 3.8 KB |
references/secret-scanning.md
View on GitHub# Secret Scanning
## Gitleaks
```bash
# Install
brew install gitleaks
# Scan current directory
gitleaks detect --source . --verbose
# Scan with report
gitleaks detect --source . -f json -r gitleaks-report.json
# Scan git history
gitleaks detect --source . --log-opts="--all"
# Use baseline (ignore known)
gitleaks detect --baseline-path .gitleaks-baseline.json
```
## TruffleHog
```bash
# Install
pip install trufflehog
# Scan filesystem
trufflehog filesystem .
# Scan git repo
trufflehog git file://. --since-commit HEAD~100
# Scan with JSON output
trufflehog filesystem . --json > trufflehog-report.json
```
## Manual Grep Patterns
```bash
# Common secret patterns
grep -rn "api_key\|apikey\|api-key" --include="*.{ts,js,py}" .
grep -rn "secret\|password\|passwd" --include="*.{ts,js,py}" .
grep -rn "private_key\|privatekey" --include="*.{ts,js,py}" .
grep -rn "access_token\|accesstoken" --include="*.{ts,js,py}" .
# AWS credentials
grep -rn "AKIA[0-9A-Z]{16}" .
grep -rn "aws_secret_access_key" .
# Base64 encoded (potential secrets)
grep -rn "[A-Za-z0-9+/]{40,}=" .
# JWT tokens
grep -rn "eyJ[A-Za-z0-9_-]*\.eyJ[A-Za-z0-9_-]*\." .
```
## Common Secret Patterns
| Type | Pattern | Example |
|------|---------|---------|
| AWS Access Key | `AKIA[0-9A-Z]{16}` | `<aws-access-key-id>` |
| AWS Secret Key | 40 char base64 | `<aws-secret-access-key>` |
| GitHub Token | `ghp_[A-Za-z0-9]{36}` | `<github-token>` |
| Slack Token | `xox[baprs]-` | `<slack-bot-token>` |
| Stripe Key | `sk_live_[A-Za-z0-9]{24}` | `<stripe-secret-key>` |
| Private Key | `-----BEGIN.*PRIVATE KEY-----` | RSA/EC keys |
| JWT | `eyJ[A-Za-z0-9_-]*\.eyJ` | Encoded tokens |
## Pre-commit Hook
```yaml
# .pre-commit-config.yaml
repos:
- repo: https://github.com/gitleaks/gitleaks
rev: v8.18.0
hooks:
- id: gitleaks
```
## CI/CD Integration
```yaml
# GitHub Actions
- name: Gitleaks
uses: gitleaks/gitleaks-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# GitLab CI
secret_detection:
image: zricethezav/gitleaks
script:
- gitleaks detect --source . -f sarif -r gl-secret-detection-report.sarif
artifacts:
reports:
secret_detection: gl-secret-detection-report.sarif
```
## Remediation Steps
1. **Rotate immediately** - Consider secret compromised
2. **Remove from history** - Use git filter-branch or BFG
3. **Add to .gitignore** - Prevent future commits
4. **Use env variables** - Move to environment
5. **Use secret manager** - AWS Secrets Manager, Vault
```bash
# Remove from git history (BFG)
bfg --replace-text passwords.txt repo.git
# Or git filter-branch
git filter-branch --force --index-filter \
"git rm --cached --ignore-unmatch path/to/secret" \
--prune-empty --tag-name-filter cat -- --all
```
## Quick Reference
| Tool | Best For | Speed |
|------|----------|-------|
| Gitleaks | Git history | Fast |
| TruffleHog | Deep scanning | Medium |
| grep | Quick checks | Fast |
| GitHub Secret Scanning | GitHub repos | Auto |
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |