secret-hygiene — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited secret-hygiene (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
A practical workflow for credential management: detecting leaks, rotating cleanly, and preventing recurrence.
You cannot rotate secrets you cannot enumerate. Build a list, even a rough one.
- Hosting panel: <provider> creds in: 1Password vault X
- DB user: <name> creds in: server .env, 1Password
- API keys:
- Stripe live + test creds in: backend .env, Stripe dashboard
- Mailgun creds in: backend .env
- GitHub PAT creds in: ~/.gitconfig (BAD — move to keychain)
- SSH keys: ~/.ssh/id_* on machines: workstation, CI, VPS
- CI secrets: GitHub Actions visible at: repo/settings/secretsKeep this in a password manager or a private repo — never in plaintext on disk.
# Files commonly containing secrets
find ~/Code -maxdepth 4 -type f \( -name '.env*' -o -name 'credentials*' -o -name 'secrets*' \) -not -path '*/node_modules/*' 2>/dev/null
# Permissions check — .env should be 600
find ~/Code -name '.env*' -not -path '*/node_modules/*' -exec stat -f '%Lp %N' {} \; 2>/dev/null
# Did you commit a .env by accident?
cd ~/Code/<repo>
git log --all --full-history -- '.env*' 2>/dev/null# Quick grep across all history for high-signal patterns
git log -p --all -S 'AKIA' # AWS access key
git log -p --all -S 'sk-' # OpenAI / many SaaS
git log -p --all -S 'ghp_' # GitHub PAT
git log -p --all -S 'xoxb-' # Slack bot token
git log -p --all -S 'BEGIN RSA PRIVATE KEY'
git log -p --all -S 'BEGIN OPENSSH PRIVATE KEY'
# Better: dedicated scanners
gitleaks detect --source . --report-format json --report-path gitleaks.json
trufflehog git file://. --jsonGitHub runs secret scanning for public repos automatically. For private repos with paid tiers, enable it. Push protection blocks future leaks at git push time — turn it on.
When a secret leaks, rotate outward from the access it grants. Common order:
.env leaked, assume every value in that .env leaked.For each rotation, log: what, when, by whom, who was notified.
Rewriting history is disruptive — every collaborator must re-clone, and tags/CI references may break. Do it only if a high-value secret is in history and rotating is genuinely insufficient (rare; usually rotation is enough).
git-filter-repo# Install once: brew install git-filter-repo
# Backup first
git clone --mirror [email protected]:owner/repo.git repo-backup.git
# Remove a specific file from all history
cd repo-clone
git filter-repo --invert-paths --path .env
git filter-repo --invert-paths --path config/secrets.yml
# Or replace a literal string everywhere
echo 'AKIAIOSFODNN7EXAMPLE==>REDACTED' > replace.txt
git filter-repo --replace-text replace.txt
# Force-push (coordinate with the team — everyone re-clones after this)
git push --force --all
git push --force --tagsAfter force-push:
git clone fresh; rebasing existing forks is fragileInstall once per workstation:
# Option A: gitleaks pre-commit hook
brew install gitleaks
gitleaks protect --staged --no-bannerOr via pre-commit framework — example .pre-commit-config.yaml:
repos:
- repo: https://github.com/gitleaks/gitleaks
rev: v8.18.0
hooks:
- id: gitleaks.gitignore baseline# Never commit these
.env
.env.*
!.env.example
*.pem
*.key
*.p12
id_rsa
id_ed25519
credentials.json
config/secrets.yml.env.example conventionCommit a placeholder file with the keys but not the values:
# .env.example
DATABASE_URL=postgresql://user:password@localhost:5432/dbname
STRIPE_SECRET_KEY=sk_test_REPLACE_ME
GITHUB_TOKEN=ghp_REPLACE_ME.env permissions: chmod 600 .env, owned by the app userUseful for grep-based scans:
| Prefix | Provider |
|---|---|
AKIA, ASIA | AWS access key |
ghp_, gho_, ghu_, ghs_, ghr_ | GitHub tokens |
xoxb-, xoxp-, xoxa- | Slack tokens |
sk_live_, sk_test_ | Stripe |
key- (Mailgun), re_ (Resend) | Mail providers |
sk-, sk-proj- | OpenAI / Anthropic-style |
glpat- | GitLab PAT |
dckr_pat_ | Docker Hub PAT |
npm_ | npm tokens |
-----BEGIN OPENSSH PRIVATE KEY----- | SSH private key |
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.