repo-hardening-workflow
Skill1 starsChanged 34 days agoMITView on GitHub
Audit repository configuration, authentication, secrets, dependencies, containers and CI; document evidence, remediation and readiness limits.
- Reads credentials
In this repository43 other files it gives its agents.
- ansible-hardeningSkill
- cavetechSkill
- ci-cdSkill
- claude-to-cursorSkill
- code-consistencySkill
- code-qualitySkill
- config-auditorSkill
- container-sandboxSkill
- cpa-tax-specialistSkill
- database-designSkill
- definition-of-doneSkill
- differential-reviewSkill
- exact-head-reviewSkill
- fast-ciSkill
- grill-meSkill
- inbound-syncSkill
- infosec-architectSkill
- insecure-defaultsSkill
- lonely-sysadminSkill
- mcp-createSkill
- mcp-hardeningSkill
- model-evaluationSkill
- modern-pythonSkill
- ms-office-suiteSkill
- mutation-checkSkill
- plan-to-execution-handoffSkill
- prd-to-planSkill
- property-based-testingSkill
- pr-truth-triageSkill
- resume-writerSkill
- skill-updaterSkill
- software-developerSkill
- software-development-lifecycleSkill
- solutions-architectSkill
- stay-readySkill
- supply-chain-risk-auditorSkill
- systematic-debuggingSkill
- tax-reference-currencySkill
- tddSkill
- token-miserSkill
- triage-issueSkill
- verification-before-completionSkill
- write-a-prdSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
18 rules. About 0 are common, 11 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
If no path is specified, default to current working directory.
- Very specific: line 23
Check for existing .gitleaks.toml, .pre-commit-config.yaml, trivy.yaml — note gaps
- Very specific: line 31
Default fallback secrets: secret = "changeme", password = "password", key = "dev", empty string defaults
- Very specific: line 43
Pass criteria: No hardcoded fallback secrets.
- Distinctive: line 63
Pass criteria: All non-public operations enforce the declared authentication and authorization policy.
- Very specific: line 92
Pass criteria: No detected secrets within the inspected scope.
- Distinctive: line 117
Pass criteria: No Critical or High CVEs unmitigated.
- Distinctive: line 180
Pass criteria: No PII in log statements. TLS enforced in production config.
- Distinctive: line 197
No Critical CVEs; High CVEs mitigated or accepted with documented rationale
- Distinctive: line 198
No secrets in git history
- Distinctive: line 205
All internal-hardened criteria, plus:
- Very specific: line 251
Run after insecure-defaults skill for deeper per-pattern analysis
- Very specific: line 252
Run supply-chain-risk-auditor skill in parallel with Phase 4 for SBOM-level review
- Very specific: line 253
Use infosec-architect persona for architectural findings that need design guidance
- Distinctive: line 259
Do NOT produce generic advice ("use HTTPS") — always reference actual files and line numbers found
- Distinctive: line 260
Do NOT mark phase as PASS if tools were unavailable — mark as SKIPPED with reason
- Distinctive: line 261
Do NOT skip Phase 8 gate — the maturity verdict is the primary deliverable
- Distinctive: line 262
Do NOT accept "will fix later" — findings stay open until verified remediated
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
repo-hardening-workflow
Repeatable 8-phase security hardening workflow. Run against any repo to produce a structured findings report with severity ratings and a maturity gate verdict.
Invocation
Trigger phrases: "harden this repo", "security audit", "production readiness review", "repo audit [path]"
If no path is specified, default to current working directory.
Pre-Flight
- Identify repo root — check for
pyproject.toml,package.json,go.mod,Cargo.toml - Note language(s), framework(s), and deployment target (Docker, K3s, bare metal, etc.)
- Check for existing
.gitleaks.toml,.pre-commit-config.yaml,trivy.yaml— note gaps
Phase 1: Config Scan
What to check:
- Hardcoded
localhostinstead of127.0.0.1(IPv6 resolution bug surface) - Default fallback secrets:
secret = "changeme",password = "password",key = "dev", empty string defaults - Debug flags that default to
Trueor1 CORS_ORIGINS = ["*"]or equivalent open CORS- Unguarded admin endpoints (no auth decorator)
Tools:
grep -r "changeme\|password123\|secret123\|localhost" --include="*.py" --include="*.js" --include="*.ts" --include="*.yaml" .
grep -r "DEBUG.*=.*True\|debug.*=.*true" --include="*.py" --include="*.env*" .
grep -rn "CORS.*\*\|allow_origins.*\*" .Pass criteria: No hardcoded fallback secrets. Debug off by default. CORS locked to explicit origins. All bind addresses use 127.0.0.1 or 0.0.0.0 with intent documented.
Phase 2: Auth Review
What to check:
- Fail-open vs fail-closed: missing auth check defaults to allow?
- JWT: algorithm pinned (reject
alg: none)? Secret loaded from env, not hardcoded? - Auth bypass paths: unauthenticated health/metrics endpoints accessible externally?
- API key rotation: is there a mechanism, or is it baked into config?
- RBAC: is authorization checked after authentication?
Tools:
grep -rn "jwt\|JWT\|bearer\|Bearer\|api_key\|API_KEY" --include="*.py" --include="*.ts" .
grep -rn "verify.*=.*False\|verify_ssl.*False\|check_expiration.*False" .
grep -rn "@app.route\|router\.\|app\.get\|app\.post" . | grep -v "auth\|require\|protect\|secure"Pass criteria: All non-public operations enforce the declared authentication and authorization policy. JWT algorithm explicitly pinned. Auth secrets loaded from an approved secret mechanism. No verify=False in production paths.
Phase 3: Secret Scan
What to check:
- Tracked
.envfiles — rungit log --oneline --all -- "*.env"to check history - Inline credentials in source (
sk-,ghp_,AKIA, private key blocks) - Secrets in Docker/K8s manifests
.gitignorecompleteness:.env,*.pem,*.key,credentials.jsonall excluded?
Tools:
# Check git history for .env files
git log --oneline --all -- "*.env" ".env*"
# Gitleaks (if installed)
gitleaks detect --source . --no-git
# Trufflehog (if installed)
trufflehog filesystem . --only-verified
# Manual grep
grep -rn "AKIA[A-Z0-9]\|sk-[a-zA-Z0-9]\|ghp_[a-zA-Z0-9]\|-----BEGIN.*PRIVATE" .Record scanner availability separately from its exit status. Nonzero results can be findings or tool failures; inspect them rather than reporting a missing tool. Filesystem scans do not cover history; scan history explicitly before claiming it clean.
Pass criteria: No detected secrets within the inspected scope. .gitignore covers all secret file patterns. Gitleaks/Trufflehog return clean. .env.example present with placeholder values only.
Phase 4: Dependency Audit
What to check:
- Python: known CVEs in
requirements.txtorpyproject.toml - Node: known CVEs in
package.json - Unpinned dependencies (floating
>=or*versions in production) - Abandoned packages (last release > 2 years, no maintainer activity)
Tools:
# Python
pip-audit --requirement requirements.txt
safety check
# Node
npm audit --audit-level=high
# Trivy (covers all)
trivy fs . --scanners vuln --severity HIGH,CRITICALPass criteria: No Critical or High CVEs unmitigated. All production dependencies pinned to exact versions. Audit tool integrated into CI.
Phase 5: Compose / Docker Review
What to check:
- Services bound to
0.0.0.0without firewall context documented - Credentials in
environment:blocks (use secrets references instead) - Images unpinned (
latesttag in production) - Containers running as root (no
user:directive) - Volumes with overly broad host mounts (
/:/hostpattern) privileged: truewithout documented justification
Tools:
find . -name "docker-compose*.yml" -o -name "docker-compose*.yaml" | xargs grep -l "."
grep -n "image:.*:latest\|image:.*[^:]$" docker-compose*.yml 2>/dev/null
grep -n "privileged.*true\|user: root" docker-compose*.yml 2>/dev/null
grep -n "POSTGRES_PASSWORD\|DB_PASSWORD\|SECRET_KEY" docker-compose*.yml 2>/dev/nullPass criteria: Images pinned to digest or semver. No credentials in compose environment blocks. Non-root user specified. No privileged: true without documented need.
Phase 6: CI Review
What to check:
- Secret scanning in pipeline (gitleaks, trufflehog, or GitHub secret scanning)
- SAST tool present (bandit for Python, eslint-security for JS, semgrep)
- Dependency audit in pipeline (pip-audit, npm audit, trivy)
- Pinned GitHub Actions versions (use commit SHA, not
@v3) - Workflow permissions:
permissions: read-allas default?
Tools:
ls .github/workflows/ 2>/dev/null || echo "no GitHub Actions"
grep -rn "gitleaks\|trufflehog\|secret-scan" .github/ 2>/dev/null
grep -rn "bandit\|semgrep\|eslint" .github/ 2>/dev/null
grep -rn "uses:.*@[a-f0-9]\{40\}" .github/ 2>/dev/null # pinned SHAsPass criteria: Secret scan runs on every PR. SAST runs on every PR. Dependency audit in pipeline. Actions pinned to SHA (not floating tags).
Phase 7: Data Governance
What to check:
- Encryption at rest: database encryption, file storage encryption configured?
- Encryption in transit: TLS enforced, no plain HTTP in production paths?
- PII handling: is PII logged? Masked in logs?
- Data retention: is there a retention/purge policy?
- Audit trails: sensitive operations logged with actor + timestamp?
Tools:
grep -rn "logging\.\(info\|debug\|warning\).*password\|logging.*email\|logging.*ssn" .
grep -rn "print.*password\|console\.log.*token" .
grep -rn "ssl.*False\|tls.*False\|verify.*False" .Pass criteria: No PII in log statements. TLS enforced in production config. Retention policy documented. Sensitive operations produce audit log entries.
Phase 8: Maturity Gate Assessment
Assign one of three tiers based on findings:
DEV (not safe for any real data)
Any one of:
- Critical or High severity findings unmitigated
- Secrets tracked in git history
- Auth fail-open (unauthenticated access to non-public endpoints)
DEBUG=Truein production config
INTERNAL-CONTROLS-CHECKED (not a safety certification)
All of:
- No Critical CVEs; High CVEs mitigated or accepted with documented rationale
- No secrets in git history
- Auth fail-closed
- Dependency audit passing
.envproperly gitignored- Compose/Docker review passing
PRODUCTION-CONTROLS-CHECKED (further system assessment required)
All internal-hardened criteria, plus:
- Secret scanning in CI
- SAST in CI
- Dependencies pinned to exact versions
- PII not logged
- Encryption at rest configured
- TLS enforced
- Audit trails on sensitive operations
- Data retention policy documented
Output Format
Produce a structured report:
## Security Hardening Report — [repo-name] — [date]
**Maturity Gate: [DEV / INTERNAL-CONTROLS-CHECKED / PRODUCTION-CONTROLS-CHECKED]**
### Critical Findings
- [Phase] [file:line] — [description] — Fix: [specific action]
### High Findings
- ...
### Medium Findings
- ...
### Low / Informational
- ...
### Passing Checks
- Phase 1: Config scan — PASS
- ...
### Recommended Next Steps (priority order)
1. ...Integration
- Feed Critical/High findings to
triage-issueskill to create GitHub issues - Run after
insecure-defaultsskill for deeper per-pattern analysis - Run
supply-chain-risk-auditorskill in parallel with Phase 4 for SBOM-level review - Use
infosec-architectpersona for architectural findings that need design guidance
Anti-Patterns
- Do NOT produce generic advice ("use HTTPS") — always reference actual files and line numbers found
- Do NOT mark phase as PASS if tools were unavailable — mark as SKIPPED with reason
- Do NOT skip Phase 8 gate — the maturity verdict is the primary deliverable
- Do NOT accept "will fix later" — findings stay open until verified remediated
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

