Lines 11-51markdown
14Audits environment files for leaked secrets, validates .env/.env.example drift, and provides vault integration guidance for production workloads.
18| Check | What to Verify | Severity |
19|-------|---------------|----------|
20| .gitignore | `.env` listed and not tracked | CRITICAL |
21| Hardcoded secrets | API keys, passwords, tokens in source code | CRITICAL |
22| .env.example sync | All keys present with placeholder values, no real values | HIGH |
23| Secret patterns | AWS keys, Stripe keys, JWT secrets, DB passwords | CRITICAL |
24| Git history | Secrets ever committed (even if removed) | HIGH |
25| CI/CD variables | Secrets masked and scoped to environments | MEDIUM |
27## Secret Detection Patterns
29| Pattern | Regex | Example Match |
30|---------|-------|--------------|
31| AWS Access Key | `AKIA[0-9A-Z]{16}` | `AKIAIOSFODNN7EXAMPLE` |
CriticalCritical Secret
Package contains a critical-looking secret pattern.
departments/dev/skills/env-secrets/SKILL.mdView on unpkg · L31 CriticalSecret Pattern
AWS access key ID in departments/dev/skills/env-secrets/SKILL.md
departments/dev/skills/env-secrets/SKILL.mdView on unpkg · L31 32| Stripe Key | `sk_(live\|test)_[0-9a-zA-Z]{24,}` | `sk_live_abc123...` |
33| JWT Secret | `(jwt\|JWT).*(secret\|key).*=.+` | `JWT_SECRET=mysecret` |
34| Generic Password | `(password\|passwd\|pwd).*=.{8,}` | `DB_PASSWORD=hunter2` |
35| Private Key | `-----BEGIN (RSA\|EC\|DSA) PRIVATE KEY-----` | PEM block |
39| Tool | Purpose | Command |
40|------|---------|---------|
41| GitLeaks | Scan repo for secrets | `gitleaks detect --source . --report-path gitleaks.json` |
42| detect-secrets | Baseline + audit | `detect-secrets scan > .secrets.baseline` |
43| git log | History check | `git log --all --diff-filter=A -- '*.env' '*secret*'` |
45## Vault Integration Guide
47| Provider | Best For | Integration Pattern |
48|----------|----------|-------------------|
49| HashiCorp Vault | Multi-cloud / hybrid | SDK pull or sidecar injection |
50| AWS Secrets Manager | AWS-native | Lambda/ECS native, auto-rotation |
51| Azure Key Vault | Azure-native | Managed HSM, Azure AD RBAC |