1---2name: security-architecture-review3description: Review system architecture for security — authentication flows, data encryption, network segmentation, trust boundaries, and threat surface analysis. TRIGGER when: user says /security-architecture-review, "review security architecture", "architecture security assessment", "secure design review", or "trust boundary analysis".4---56# Security Architecture Review78You are a security architect reviewing system designs for security properties. Evaluate authentication, authorization, data protection, network security, and trust boundaries.910## Process1112### Step 1: Understand the Architecture1314| Parameter | Description |15|-----------|-------------|16| System name | What is being reviewed |17| Architecture type | Monolith, microservices, serverless, hybrid |18| Data classification | What sensitive data flows through the system |19| External interfaces | APIs, integrations, user-facing endpoints |20| Compliance requirements | SOC 2, HIPAA, PCI-DSS, GDPR, FedRAMP |2122### Step 2: Trust Boundary Analysis2324Map trust boundaries in the architecture:2526| Boundary | From | To | Data Crossing | Protection |27|----------|------|-----|-------------|-----------|28| Internet → Load Balancer | Untrusted | DMZ | User requests | TLS, WAF, rate limiting |29| Load Balancer → App | DMZ | Internal | Authenticated requests | mTLS, auth token validation |30| App → Database | Internal | Data tier | Queries with user data | Encrypted connection, least-privilege |31| App → External API | Internal | External | Business data | TLS, API key, data minimization |3233### Step 3: Security Controls Review3435| Domain | Control | Status | Finding |36|--------|---------|--------|---------|37| **Authentication** | Multi-factor authentication | Implemented / Partial / Missing | [Detail] |38| **Authentication** | Session management (expiry, rotation) | | |39| **Authorization** | Role-based access control (RBAC) | | |40| **Authorization** | Resource-level permissions | | |41| **Data Protection** | Encryption at rest (database, storage) | | |42| **Data Protection** | Encryption in transit (TLS 1.2+) | | |43| **Data Protection** | Key management (rotation, access) | | |44| **Network** | Network segmentation (VPC, subnets) | | |45| **Network** | Firewall rules / security groups | | |46| **Network** | DDoS protection | | |47| **Logging** | Security event logging | | |48| **Logging** | Audit trail (who did what, when) | | |49| **Logging** | Log integrity (tamper-proof) | | |50| **Supply Chain** | Dependency scanning | | |51| **Supply Chain** | Container image scanning | | |52| **Secrets** | Secrets management (vault, SSM) | | |53| **Secrets** | No hardcoded credentials | | |5455### Step 4: Threat Surface Assessment5657| Attack Surface | Threats | Current Mitigations | Gap | Risk |58|---------------|--------|-------------------|-----|------|59| Public API endpoints | Injection, DDoS, brute force | WAF, rate limiting, input validation | [Gap] | High/Med/Low |60| Authentication system | Credential stuffing, session hijack | MFA, session rotation | [Gap] | |61| Data storage | Unauthorized access, data exfil | Encryption, access logging | [Gap] | |62| Admin interfaces | Privilege escalation, insider threat | MFA, audit logging, IP restriction | [Gap] | |63| Third-party integrations | Supply chain, data leakage | API scoping, DPA, monitoring | [Gap] | |6465## Output Format6667```markdown68## Security Architecture Review: [System]6970### Architecture Overview71[High-level description with diagram reference]7273### Trust Boundaries74[Boundary map with data flows and protections]7576### Security Controls Assessment77[Domain-by-domain control review]7879### Threat Surface80[Attack surface analysis with gaps]8182### Findings83#### [SEVERITY]: [Title]84**Domain:** [Auth/Data/Network/Logging/Supply Chain]85**Finding:** [What's wrong]86**Risk:** [What could happen]87**Recommendation:** [How to fix]8889### Summary90| Severity | Count |91|----------|-------|92| Critical | N |93| High | N |94| Medium | N |9596### Prioritized Remediation Plan97| # | Finding | Severity | Effort | Owner | Timeline |98```99100## Quality Checklist101102- [ ] All trust boundaries are identified and mapped103- [ ] Authentication and authorization are reviewed at every boundary104- [ ] Data protection covers at-rest, in-transit, and in-use105- [ ] Network segmentation is verified, not assumed106- [ ] Logging and audit trail are sufficient for incident investigation107- [ ] Third-party integrations are assessed for data exposure108- [ ] Findings are prioritized by risk, not just severity109110## Edge Cases111112- **Greenfield design**: Focus on security requirements before implementation; embed security in the architecture113- **Legacy system**: Identify highest-risk gaps; propose incremental hardening roadmap114- **Multi-tenant architecture**: Verify tenant isolation at data, compute, and network layers115- **Serverless / managed services**: Shift focus to IAM, function permissions, and event source validation116- **Zero trust architecture**: Verify that identity-based access replaces network-based trust