Architecting security

From ancoleman/ai-design-components · View interactive version

Architecting security is an AI agent skill from the GitHub repository ancoleman/ai-design-components. Design comprehensive security architectures using defense-in-depth, zero trust principles, threat modeling (STRIDE, PASTA), and control frameworks (NIST CSF, CIS Controls, ISO 27001). Use when designing security for new systems, auditing existing architectures, or establishing security governance pr

How to use this skill

Skill file

Security Architecture

Design and implement comprehensive security architectures that protect systems, data, and users through layered defense strategies, zero trust principles, and risk-based security controls.

Purpose

Security architecture provides the strategic foundation for building resilient, compliant, and trustworthy systems. This skill guides the design of defense-in-depth layers, zero trust implementations, threat modeling methodologies, and mapping to control frameworks (NIST CSF, CIS Controls, ISO 27001).

Unlike tactical security skills (configuring firewalls, implementing authentication, scanning vulnerabilities), security architecture focuses on strategic planning, comprehensive defense strategies, and governance frameworks.

When to Use This Skill

Use security architecture when:

Core Security Architecture Principles

1. Defense in Depth

Implement multiple independent layers of security controls so that if one layer fails, others continue to protect critical assets.

9 Defense Layers (2025 Model):

  1. Physical Security: Data center access, environmental controls, hardware security modules (HSMs)
  2. Network Perimeter: Next-gen firewalls (NGFW), DDoS protection, web application firewalls (WAF)
  3. Network Segmentation: VLANs, VPCs, security groups, micro-segmentation
  4. Endpoint Protection: EDR, antivirus, device encryption, patch management
  5. Application Layer: Secure coding, WAF, API security, SAST/DAST scanning
  6. Data Layer: Encryption (at-rest, in-transit, in-use), DLP, backup/recovery
  7. Identity & Access Management: MFA, SSO, RBAC/ABAC, privileged access management (PAM)
  8. Behavioral Analytics: UEBA, ML-based anomaly detection, threat intelligence
  9. Security Operations: SIEM, SOAR, incident response, continuous monitoring

Key Principle: Each layer provides independent protection. Failure of one layer does not compromise the entire system.

For detailed layer-by-layer implementation patterns, see references/defense-in-depth.md.

2. Zero Trust Architecture

Implement "never trust, always verify" principles where every access request is authenticated, authorized, and continuously validated.

Core Zero Trust Principles:

  1. Continuous Verification: Authenticate and authorize every access request (no implicit trust)
  2. Least Privilege Access: Grant minimal permissions required, use just-in-time (JIT) access
  3. Assume Breach: Design systems expecting compromise, limit blast radius
  4. Explicit Verification: Verify user identity (MFA), device health, application integrity, context (location, time, behavior)
  5. Micro-Segmentation: Divide networks into small isolated zones, control east-west traffic

Zero Trust Architecture Components:

For zero trust implementation roadmap and reference architecture, see references/zero-trust-architecture.md.

3. Threat Modeling

Systematically identify, prioritize, and mitigate security threats through structured methodologies.

Primary Methodologies:

| Methodology | Purpose | Complexity | Best For |

|-------------|---------|------------|----------|

| STRIDE | Threat identification | Low | Development teams, quick threat analysis |

| PASTA | Risk-centric analysis | High | Enterprise risk management |

| DREAD | Risk scoring | Low | Prioritizing existing threats |

| Attack Trees | Visual threat analysis | Medium | Security architecture reviews |

STRIDE Threat Categories:

STRIDE Application Process:

  1. Model the system using data flow diagrams (DFDs)
  2. Identify threats by applying STRIDE to each component/data flow
  3. Document threats with STRIDE categories
  4. Prioritize threats using DREAD scoring or business impact
  5. Design mitigation controls

For detailed threat modeling methodologies, PASTA process, DREAD scoring, and attack trees, see references/threat-modeling.md. For threat modeling examples, see examples/threat-models/.

Security Control Frameworks

Map security controls to industry frameworks to ensure comprehensive coverage and compliance.

NIST Cybersecurity Framework (CSF) 2.0

6 Core Functions:

  1. GOVERN (GV): Risk management strategy, policies, supply chain risk management
  2. IDENTIFY (ID): Asset inventory, risk assessment, continuous improvement
  3. PROTECT (PR): Access control, data security, platform security, infrastructure resilience
  4. DETECT (DE): Continuous monitoring, anomaly detection, security event analysis
  5. RESPOND (RS): Incident management, analysis, communication, mitigation
  6. RECOVER (RC): Recovery planning, execution, post-incident improvement

Usage: Map security controls to NIST CSF categories to ensure coverage of all security functions. Provides risk-based, flexible framework for security programs.

For detailed NIST CSF category mapping and subcategories, see references/nist-csf-mapping.md.

CIS Critical Security Controls v8

18 Controls organized in 3 Implementation Groups:

Top Priority Controls (IG1):

  1. Inventory and Control of Enterprise Assets
  2. Inventory and Control of Software Assets
  3. Data Protection
  4. Secure Configuration of Enterprise Assets
  5. Account Management
  6. Access Control Management
  7. Continuous Vulnerability Management
  8. Audit Log Management

Usage: CIS Controls provide prescriptive, measurable security baseline. Start with IG1, progress to IG2/IG3 as security maturity increases.

For detailed CIS Controls implementation guidance, see references/cis-controls.md.

OWASP Top 10 Risk Mitigation

Map OWASP Top 10 application security risks to architectural controls:

| OWASP Risk | Primary Control | Framework Mapping |

|------------|-----------------|-------------------|

| Injection | Parameterized queries, input validation | NIST PR.DS, CIS 16 |

| Broken Authentication | MFA, secure session management | NIST PR.AC, CIS 5, 6 |

| Sensitive Data Exposure | Encryption, key management | NIST PR.DS, CIS 3 |

| XXE | Disable external entities, use JSON | NIST PR.DS, CIS 16 |

| Broken Access Control | Authorization checks, RBAC | NIST PR.AC, CIS 6 |

| Security Misconfiguration | Hardening, minimal configs | NIST PR.IP, CIS 4 |

| XSS | Output encoding, CSP | NIST PR.DS, CIS 16 |

| Insecure Deserialization | Validate objects, safe formats | NIST PR.DS, CIS 16 |

| Known Vulnerabilities | Patch management, SBOM | NIST ID.RA, CIS 7 |

| Logging & Monitoring | SIEM, centralized logging | NIST DE.CM, CIS 8 |

For detailed OWASP Top 10 mitigation strategies and code examples, see references/owasp-top10-mitigation.md.

Architecture Selection Decision Framework

Select appropriate security architecture approach based on system characteristics:

Greenfield (New System):

Brownfield (Existing System):

Compliance-Driven:

Cloud-Native:

Hybrid/Multi-Cloud:

For detailed architecture selection decision trees, see references/defense-in-depth.md and references/zero-trust-architecture.md.

Supply Chain Security

Protect software supply chain from tampering, backdoors, and compromised dependencies.

SLSA Framework

Supply-chain Levels for Software Artifacts (4 levels):

  1. SLSA Level 1 - Provenance: Build process generates provenance metadata (not tamper-proof)
  2. SLSA Level 2 - Hosted Build: Build on trusted platform (GitHub Actions, Cloud Build)
  3. SLSA Level 3 - Hardened Build: Build platform prevents tampering, audit logs
  4. SLSA Level 4 - Hermetic, Reproducible: Fully hermetic builds, reproducible, two-party review

Implementation: Start with Level 1 provenance generation, progress to Level 2 (GitHub Actions), then Level 3 (hardened CI/CD with audit logs).

SBOM (Software Bill of Materials)

Generate and maintain inventory of software components and dependencies.

SBOM Standards:

SBOM Use Cases:

Dependency Management Best Practices:

  1. Generate SBOM automatically in CI/CD pipeline
  2. Continuous scanning with tools (Dependabot, Snyk, Trivy, Grype)
  3. Automated security patch updates
  4. License compliance tracking and approval workflows
  5. Pin dependency versions using lock files
  6. Minimize dependencies to reduce attack surface

For SLSA implementation guide, SBOM generation examples, and dependency scanning automation, see references/supply-chain-security.md.

Cloud Security Architecture Patterns

AWS Security Architecture

Well-Architected Framework - Security Pillar Principles:

  1. Strong identity foundation: Centralize IAM, least privilege, IAM Identity Center (SSO)
  2. Enable traceability: CloudTrail, GuardDuty, Security Hub for comprehensive logging
  3. Apply security at all layers: Defense in depth across VPC, instances, applications, data
  4. Automate security best practices: Infrastructure as Code (Terraform, CloudFormation)
  5. Protect data in transit and at rest: TLS 1.3, AWS KMS, encryption everywhere

Key AWS Security Services:

Multi-Account Strategy: Use AWS Organizations with Security OU (Security Account, Logging Account, Audit Account) and Workload OUs (Production, Non-Production). Apply Service Control Policies (SCPs) for guardrails.

For AWS reference architectures and multi-account security setup, see references/aws-security-architecture.md and examples/architectures/aws-multi-account-security.md.

GCP Security Architecture

Key GCP Security Services:

Organization Hierarchy: Structure with Organization → Folders (Production, Non-Production, Security) → Projects. Apply IAM policies at folder level for inheritance.

For GCP security architecture patterns and organization setup, see references/gcp-security-architecture.md and examples/architectures/gcp-security-hierarchy.md.

Azure Security Architecture

Key Azure Security Services:

Hub-Spoke Landing Zone: Implement hub VNet (shared services: firewall, VPN, Azure Bastion) with spoke VNets (workloads). Use Management Groups for policy hierarchy.

For Azure security architecture and hub-spoke design, see references/azure-security-architecture.md and examples/architectures/azure-landing-zone.md.

Identity & Access Management Patterns

Authentication Controls

Multi-Factor Authentication (MFA):

Single Sign-On (SSO):

Authorization Controls

Role-Based Access Control (RBAC):

Attribute-Based Access Control (ABAC):

Policy-Based Access Control (PBAC):

Privileged Access Management (PAM)

Just-in-Time (JIT) Access:

Credential Vaulting:

For detailed IAM implementation patterns, MFA configuration, and PAM setup, see references/iam-patterns.md.

Security Monitoring & Operations

SIEM (Security Information & Event Management)

Centralize log aggregation, correlation, and alerting for security events.

Leading SIEM Platforms:

SIEM Architecture:

  1. Log Collection: Ingest logs from all layers (network, endpoints, applications, cloud)
  2. Normalization: Standardize log formats for correlation
  3. Correlation: Apply rules to detect patterns (failed logins → brute force attack)
  4. Alerting: Notify SOC team of high-priority events
  5. Investigation: Provide search and visualization for incident analysis

SOAR (Security Orchestration, Automation & Response)

Automate incident response workflows to reduce mean time to respond (MTTR).

SOAR Capabilities:

Leading SOAR Platforms:

Detection Strategies

UEBA (User & Entity Behavior Analytics):

Threat Intelligence:

For SIEM architecture, SOAR playbook examples, and detection strategies, see references/security-operations.md.

Quick Reference: Control Framework Mapping

Use this table to map risks to appropriate control frameworks:

| Risk/Requirement | Framework | Key Controls |

|------------------|-----------|--------------|

| General security program | NIST CSF 2.0 | All 6 functions (GV, ID, PR, DE, RS, RC) |

| Compliance baseline | CIS Controls v8 | IG1: Controls 1-18 (56 safeguards) |

| ISO certification | ISO 27001/27002 | 114 controls across 14 domains |

| Application security | OWASP ASVS | 286 security requirements (3 levels) |

| Cloud security (AWS) | AWS Well-Architected | Security Pillar: 10 design principles |

| Cloud security (GCP) | GCP Security Best Practices | Security Command Center architecture |

| Cloud security (Azure) | Azure Security Benchmark | Defender for Cloud controls |

| Supply chain security | SLSA + SBOM | Level 2+ SLSA, CycloneDX SBOM |

| Zero trust architecture | NIST SP 800-207 | ZTA tenets, deployment models |

| Privacy/GDPR | NIST Privacy Framework | Privacy engineering objectives |

Integration with Related Skills

Security architecture provides the strategic foundation for tactical security implementations:

Common Security Architecture Patterns

Pattern 1: Zero Trust Network Access (ZTNA)

Replace VPN with identity-based access to applications.

Architecture:

  1. User authenticates to identity provider (Azure AD, Okta)
  2. Device posture check validates device health
  3. Policy engine evaluates access request (user, device, context)
  4. Access granted through secure connector (no network access)

Benefits: Eliminates lateral movement, reduces attack surface, improves user experience

Pattern 2: Defense in Depth for Web Applications

Layer multiple security controls for web application protection.

Layers:

  1. DDoS Protection (Cloudflare, AWS Shield)
  2. WAF (application firewall, OWASP Top 10 rules)
  3. API Gateway (authentication, rate limiting)
  4. Application Security (SAST/DAST, secure coding)
  5. Database Security (encryption, least privilege)
  6. Logging & Monitoring (SIEM, anomaly detection)

Pattern 3: Cloud Security Posture Management (CSPM)

Continuously monitor and enforce security configurations across cloud environments.

Architecture:

  1. Asset Discovery: Inventory all cloud resources
  2. Configuration Assessment: Compare against security baselines (CIS Benchmarks)
  3. Compliance Monitoring: Track regulatory compliance (SOC 2, ISO 27001)
  4. Remediation: Automated fixes or guided workflows
  5. Drift Detection: Alert on configuration changes

Leading CSPM Tools: Wiz, Orca Security, Prisma Cloud, Microsoft Defender for Cloud

Resources and References

Defense in Depth:

Zero Trust Architecture:

Threat Modeling:

Control Frameworks:

Supply Chain Security:

Cloud Security:

IAM & Operations:

Architecture Examples:

Scripts:

Summary

Security architecture requires strategic planning across multiple layers, from physical security to security operations. Implement defense-in-depth for comprehensive protection, adopt zero trust principles for modern cloud environments, use threat modeling to identify risks proactively, and map controls to frameworks for compliance and completeness.

Start with risk assessment to understand threats, select appropriate architecture approach (zero trust for greenfield, hybrid for brownfield), implement layered controls, and continuously monitor and improve security posture.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.