| name | security-audit-standard |
| description | Security audit methodology and checklist for codebases. Use when performing security reviews, auditing a project for vulnerabilities, or hardening an application before deployment. Covers secret scanning, input validation, authentication/authorization, cryptographic practices, dependency auditing, CSP configuration, rate limiting, OWASP Top 10 checks, and audit report format. Derived from production audit work.
|
Security Audit Standard
Methodology derived from production security audits.
Audit Process
Phase 1: Secret Scanning
Scan for hardcoded credentials in tracked source files.
Targets:
- API keys, tokens, passwords in source (not .env)
- Webhook URLs with tokens
- Database connection strings
- Private keys, certificates
- obfstr!() usage (Rust): still in binary, just obfuscated
Check patterns:
grep -rn "sk-" "pk_" "ghp_" "token" "secret" "password" "apikey"
grep -rn "https://discord.com/api/webhooks/"
grep -rn "https://hooks.slack.com/"
grep -rn "mongodb://" "postgresql://" "redis://"
Verify .gitignore covers: .env*, *.pem, *.key, credentials*, secrets*, auth*.json, config.json (if it contains secrets).
Phase 2: Input Validation
For every endpoint/command that accepts user input:
- Where does input enter the system? (HTTP body, query params, WebSocket messages, IPC commands, CLI args, file uploads)
- Is it validated before processing? (type checking, length limits, format validation)
- Is it sanitized before output? (HTML escaping, SQL parameterization)
- Are error messages safe? (no stack traces, no internal paths, no credential hints)
Checklist:
Phase 3: Authentication & Authorization
Phase 4: Data Protection
Phase 5: Dependency Audit
npm audit
pnpm audit
cargo audit
cargo deny check
pip-audit
safety check
govulncheck ./...
Check for:
- Known CVEs in dependencies
- Outdated dependencies (major versions behind)
- Abandoned packages (no commits in 2+ years)
- Typosquat packages (similar names to popular packages)
Phase 5b: Supply Chain
| Check | Command / File | Why |
|---|
| Lockfile committed | package-lock.json, Cargo.lock, go.sum, Package.resolved | Pin transitive dep versions |
| GitHub Actions pinned to SHA | uses: actions/checkout@<sha> | @v4 tag can be moved by attacker |
| Install scripts disabled in CI | npm ci --ignore-scripts | Prevents postinstall RCE |
| Provenance or signing | npm publish --provenance, sigstore for releases | Lets consumers verify origin |
| Allow-list of registries | .npmrc registry=, cargo index | Blocks dependency confusion |
- Typosquat packages (similar names to popular packages)
Phase 6: Infrastructure
OWASP Top 10 Quick Check
| # | Vulnerability | Check |
|---|
| A01 | Broken Access Control | Every endpoint verifies auth + authz? |
| A02 | Cryptographic Failures | Using strong algorithms? Secrets encrypted at rest? |
| A03 | Injection | All inputs parameterized/escaped? |
| A04 | Insecure Design | Threat model exists? Security requirements documented? |
| A05 | Security Misconfiguration | Default creds removed? Error handling configured? |
| A06 | Vulnerable Components | Dependencies audited? No known CVEs? |
| A07 | Auth Failures | Brute force protected? MFA available? |
| A08 | Data Integrity Failures | Updates verified (checksums)? CI/CD secured? |
| A09 | Logging Failures | Security events logged? Logs don't contain secrets? |
| A10 | SSRF | Server-side requests validated? Internal URLs blocked? |
Tauri-Specific Security
Audit Report Format
# Security Audit: [Project Name]
Date: YYYY-MM-DD
## Summary
- Critical: N findings
- High: N findings
- Medium: N findings
- Low: N findings
## Critical Findings
### [CRIT-01] Hardcoded API key in tracked source
- **Location**: `src/config.json:15`
- **Risk**: Key exposure if repo made public or cloned
- **Fix**: Move to .env, add to .gitignore, rotate key
- **Effort**: 5 minutes
## High Findings
...
## Recommendations
1. [Priority-ordered action items]
Severity levels:
- Critical: Immediate exploitation possible, data breach risk
- High: Exploitable with some effort, significant impact
- Medium: Requires specific conditions, moderate impact
- Low: Minor risk, defense-in-depth improvement