|
| 1 | +# CSReview Reference - Compliance & Framework Correlation |
| 2 | + |
| 3 | +**Honesty contract**: the engine maps findings to the frameworks below by CWE |
| 4 | +correlation only (see `COMPLIANCE_MAP` in `src/detector.js`). It does NOT |
| 5 | +compute per-article PASS/FAIL verdicts, ASVS coverage percentages, or SLSA |
| 6 | +levels, and the agent MUST NOT fabricate such numbers in summaries. Per-article |
| 7 | +or per-requirement assessments may appear in a report only when a human or the |
| 8 | +agent explicitly evaluated that requirement against the workspace and says so. |
| 9 | +Compliance output is **indicative correlation, not an audited compliance |
| 10 | +verification**. |
| 11 | + |
| 12 | +## SLSA Supply Chain Review (SLSA Build L3, v1.2) |
| 13 | + |
| 14 | +Checklist for the agent's supply-chain review. Reference requirements with |
| 15 | +track + level + version (e.g. "SLSA Build L3 (v1.2)"). |
| 16 | + |
| 17 | +**Source integrity**: signed commits, branch protection, required reviews, |
| 18 | +CODEOWNERS, repository permission audit, 2FA enforcement. |
| 19 | + |
| 20 | +**Build integrity**: automated CI/CD, reproducible/hermetic builds, hosted build |
| 21 | +service, signed build attestations/provenance, artifact signing |
| 22 | +(Sigstore/cosign/GPG), base image verification. |
| 23 | + |
| 24 | +**Dependency security**: lock files present and committed, exact version |
| 25 | +pinning, integrity hashes, SBOM generation and maintenance, automated |
| 26 | +vulnerability scanning, typosquatting review, license audit. |
| 27 | + |
| 28 | +**Deployment security**: dev/staging/production separation, secrets in a |
| 29 | +vault/manager (not code or committed env files), restricted and audited |
| 30 | +deployment access, rollback capability, audited IaC templates. |
| 31 | + |
| 32 | +## OWASP ASVS 5.0.0 Review Areas |
| 33 | + |
| 34 | +Systematic verification areas from the OWASP Application Security Verification |
| 35 | +Standard 5.0.0 (stable since 2025-05-30). Reference requirements with the |
| 36 | +version, e.g. `v5.0.0-1.2.5`. The engine's `COMPLIANCE_MAP` correlates CWEs to |
| 37 | +ASVS chapters; chapter-by-chapter verification is agent/human work. |
| 38 | + |
| 39 | +- **V1 Architecture**: threat model, security architecture, trust boundaries |
| 40 | +- **V2 Authentication**: password policy, MFA, credential storage |
| 41 | + (bcrypt/scrypt/Argon2 — never MD5/SHA1), lockout, recovery |
| 42 | +- **V3 Session Management**: random session IDs, lifecycle/timeout, cookie |
| 43 | + flags (HttpOnly/Secure/SameSite), session binding |
| 44 | +- **V4 Access Control**: default deny, function-level and data-level checks, |
| 45 | + JWT verification, OAuth scopes |
| 46 | +- **V5 Validation & Encoding**: input validation at every entry point, |
| 47 | + context-aware output encoding, deserialization safety, mass assignment |
| 48 | +- **V6 Stored Cryptography**: key management, modern algorithms (AES-256, |
| 49 | + RSA-2048+; never DES/RC4), CSPRNG, key rotation |
| 50 | +- **V7 Errors & Logging**: no sensitive info in errors, security event logging, |
| 51 | + log integrity, PII redaction, log injection prevention |
| 52 | +- **V8 Data Protection**: classification, encryption at rest and in transit |
| 53 | + (TLS 1.2+), PII minimization, retention/deletion |
| 54 | +- **V9 Communication**: TLS configuration, certificate validation/pinning, HSTS |
| 55 | +- **V10 Malicious Code**: no backdoors/time bombs, anti-tampering |
| 56 | +- **V11 Business Logic**: flow validation, abuse prevention, rate limiting |
| 57 | +- **V12 Files & Resources**: upload restrictions, execution prevention, path |
| 58 | + traversal protection |
| 59 | +- **V13 API & Web Services**: API authn/authz, rate limiting, GraphQL |
| 60 | + introspection off in production, WebSocket security |
| 61 | +- **V14 Configuration**: secure build/deploy, security headers, debug off in |
| 62 | + production |
| 63 | + |
| 64 | +## Regulatory Correlation Checklists |
| 65 | + |
| 66 | +These lists support the agent when the user asks for a privacy/compliance |
| 67 | +review. Many items are process/documentation controls that cannot be verified |
| 68 | +from source code alone — say so explicitly instead of guessing. |
| 69 | + |
| 70 | +### LGPD (Brazil) |
| 71 | + |
| 72 | +Data inventory and classification; documented legal basis; granular consent and |
| 73 | +withdrawal; data subject rights endpoints (access, correction, deletion, |
| 74 | +portability); DPO contact; cross-border transfer safeguards; 72h ANPD breach |
| 75 | +notification plan; privacy by design/default; processor agreements. |
| 76 | + |
| 77 | +### GDPR (EU) |
| 78 | + |
| 79 | +LGPD items plus: DPIA for high-risk processing; records of processing (ROPA); |
| 80 | +right to be forgotten (automated deletion); machine-readable data portability; |
| 81 | +timestamped, versioned consent records; EU representative for non-EU companies; |
| 82 | +SCCs for international transfers. |
| 83 | + |
| 84 | +### SOC 2 Type II |
| 85 | + |
| 86 | +Security (access controls), availability (SLA monitoring, DR), processing |
| 87 | +integrity (validation, error handling), confidentiality (classification, |
| 88 | +encryption), privacy (collection/use/retention/disposal), continuous monitoring |
| 89 | +and audit logging, change management. |
| 90 | + |
| 91 | +### HIPAA (US) |
| 92 | + |
| 93 | +PHI mapping in the codebase; role-based access with minimum-necessary; audit |
| 94 | +logging of PHI access; AES-256 at rest and TLS 1.2+ in transit; BAAs with third |
| 95 | +parties handling PHI; HIPAA-specific breach procedures; de-identification |
| 96 | +methods; integrity controls. (BAA and similar contractual controls are process |
| 97 | +items — not verifiable from code.) |
| 98 | + |
| 99 | +### CCPA/CPRA (California) |
| 100 | + |
| 101 | +Right to know/delete/opt-out/correct/limit; "Do Not Sell" mechanism when |
| 102 | +applicable; opt-in for sensitive personal information; service provider |
| 103 | +agreements; data minimization; documented retention schedules. |
0 commit comments