Skip to content
This repository was archived by the owner on Apr 27, 2026. It is now read-only.

aptratcn/skill-git-secret-sweep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Git Secret Sweep 🔍

License: MIT Skill

2.3 million secrets are sitting in public git repos right now. Make sure yours aren't among them.

The Problem

Stat Number
Secrets in public GitHub repos 2.3M+ (2025)
Average time to rotation after leak 27 days
Cost of single API key compromise $10K-$500K+
Most common cause Hardcoded keys in config files

Quick Scan (No Install Required)

# Search current files for common secret patterns
grep -rn -E "(AKIA[0-9A-Z]{16}|ghp_[0-9a-zA-Z]{36}|BEGIN.*PRIVATE KEY)" . \
  --exclude-dir=node_modules --exclude-dir=.git

What It Detects

Category Patterns
🔑 AWS Keys AKIA[0-9A-Z]{16}, aws_secret_access_key
🐙 GitHub Tokens ghp_, gho_, ghu_, ghs_
🔐 Private Keys BEGIN RSA/EC/DSA PRIVATE KEY
🔗 Database URLs postgres://, mongodb:// with credentials
🤖 JWT Tokens eyJ... encoded tokens
📢 Webhooks Slack/Discord webhook URLs
💳 API Keys Generic api_key = "..." patterns

Quick Start

  1. Copy SKILL.md to your agent's skills directory
  2. Run a basic scan with the copy-paste commands in SKILL.md
  3. Set up pre-commit hooks to prevent future leaks
  4. Add CI/CD scanning with TruffleHog or Gitleaks

What To Do When You Find Secrets

1. ROTATE  — Generate new credentials immediately
2. REMOVE  — Use git-filter-repo to purge from history
3. PREVENT — Add .gitignore + pre-commit hooks
4. MONITOR — Set up GitHub secret scanning alerts

Use Cases

  • Pre-commit checks — Catch secrets before they enter git
  • CI/CD pipelines — Automated scanning on every push
  • Repository audits — Full history scan for existing leaks
  • Agent code review — Flag secrets during code generation
  • Compliance — SOC2, HIPAA, PCI-DSS requirements

CI/CD Integration

# GitHub Actions - add to your workflow
- name: Secret Scan
  uses: trufflesecurity/trufflehog@main
  with:
    extra_args: --only-verified

Related Skills

License

MIT - Use freely, scan everything.


Every secret in git history is a ticking time bomb. Sweep them before they explode.

About

Scan git repositories for leaked secrets, API keys, tokens, and credentials. Zero dependencies, copy-paste ready.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors