security-and-hardening
Use when the change touches auth, secrets, audited state, audit trails, infrastructure, or external inputs — treat security as a design constraint, not final polish.
SKILL.md.claude/skills/security-and-hardening/SKILL.md
GitHubSecurity And Hardening
Active Stack
echo "--- Tech Stack ---"
cat .claude/tech-stack 2>/dev/null || echo "(not set)"
Overview
Treat security and compliance as design constraints, not final review polish. Changes to serious software must preserve confidentiality, integrity, auditability, and least privilege.
When To Use
- Auth or authorization changes; secrets or configuration changes
- Audited state mutations (e.g. financial state, patient records, legal documents — see domain supplement)
- New endpoints, external integrations, infrastructure, or IAM changes
When NOT To Use
- Purely internal non-sensitive refactors with no new data flow or boundary change
Workflow
- Read the domain and security supplement (
.claude/references/domain-finance.md, or the team'sdomain-<name>.md) for regulated state, sensitive data, audit invariants and review questions. - Read the stack skill's
## Framework Patternsfor framework-level auth and validation idioms. - Identify trust boundaries:
- user input
- external service input
- internal privileged operations
- Check auth and authorization requirements.
- Check PII, secrets, and logging behavior.
- Check audit requirements for state changes that require an audit trail.
- Check query safety, transaction boundaries, and error exposure.
- For infra, check least privilege, blast radius, and secret access scope.
- Supply chain — dependency intake. If the diff adds or replaces a third-party dep (any of
package.json,*.csproj,Directory.Packages.props,requirements.txt,pyproject.toml,Pipfile,go.mod,Cargo.toml,Gemfile,composer.json), walk the new dep through.claude/references/dependency-intake-checklist.md— scope, maintenance, size, security, license. TwoPoorratings block; onePoorrequires written override. Cite concrete evidence (CVE id, last-release date, license SPDX) per Poor rating. - If a requirement is unclear, stop and ask rather than guessing.
Rules
- No secrets in code or logs.
- No unaudited state mutation where the domain requires audit trails.
- No trust in external input without validation.
- No wildcard IAM/resource access without explicit justification.
- No new third-party dep that fails the six-criteria intake gate (
.claude/references/dependency-intake-checklist.md).
Verification
- Trust boundaries were identified
- Auth/authz expectations were checked
- Audit requirements were checked (domain supplement consulted if present)
- No secrets or PII leakage is introduced
- Infra permissions remain least-privilege
- Any new third-party dep cleared the intake checklist (or has documented override)