Security Architecture

Security Architecture Overview — Defense in Depth and Zero Trust

Security Architecture Overview — Defense in Depth and Zero Trust

About this article

This article is the first article in the “Security Architecture” category of the Architecture Crash Course for the Generative-AI Era series. It covers the big picture of security architecture.

Security is a design domain that cannot be bolted on later. This article surveys the CIA triad, the major domains (auth, authorization, encryption, network, secrets management, audit), the shift from perimeter defense to Zero Trust, and the AI-era stance: delegate security.

What is security architecture in the first place

Imagine home security. Door locks, anti-burglary window film, security cameras, fire alarms — no single measure is enough; defending in multiple layers is the foundation of security. What’s more, adding foundational security after the house is built is extremely difficult.

Security architecture is the domain of designing authentication, authorization, encryption, network defense, secrets management, and audit logging in multiple layers. It must be built in from the start of design, not bolted on later.

Without security architecture, all data leaks through a single hole, and leaked data never goes back to “private.” The damage goes beyond any apology.

Once leaked, data never goes back to “private”

Traditionally “firewalls protect the perimeter” was the central model, but the proliferation of remote work, cloud, and SaaS has blurred the perimeter, and Zero Trust (trust nothing, always verify) became the dominant philosophy.

Security is a design domain that cannot be bolted on later. Once data leaks, no apology brings it back.

Why treat it as a separate architecture

1. Impact reaches every system

Auth foundation, encryption methods, permission model — changing them later affects every application. Without deciding upstream, you face a total replacement later.

2. Compliance is mandatory

GDPR (EU’s General Data Protection Regulation), data protection laws, PCI DSS (credit card handling standard), SOC2 (cloud-provider internal control standard), etc. — depending on the data your system handles, specific regulations apply. Violations carry criminal penalties and massive damages.

3. Specialized; cannot be a side gig

Encryption, vulnerability assessment, SOC (Security Operation Center) operations are specialist fields and cannot be done casually. Many orgs now have a dedicated security team (CSIRT — Computer Security Incident Response Team).

The three things to protect (CIA)

The most-used framework in security architecture is CIA. Which of the three you prioritize most shifts the design axis.

ElementMeaningTypical countermeasures
ConfidentialityOnly authorized people see itAuth, authorization, encryption
IntegrityData is not tampered withHashes, signatures, audit logs
AvailabilityAvailable when neededDDoS (Distributed Denial of Service) defense, redundancy, backups

Finance prioritizes confidentiality; public services prioritize availability. The weight changes by business characteristic — that’s the key point.

Domain taxonomy

flowchart TB
    subgraph PERIM[Perimeter defense]
        NW[Network<br/>FW / WAF / VPC]
    end
    subgraph IDENTITY[Identity & permissions]
        AUTH[AuthN<br/>Passkey / MFA / IDaaS]
        AUTHZ[AuthZ<br/>RBAC / ABAC / IAM]
    end
    subgraph DATA[Data protection]
        ENC[Encryption<br/>TLS / AES / KMS]
        SEC[Secrets<br/>Vault / Secrets Manager]
    end
    subgraph DETECT[Audit & detect]
        AUDIT[Audit & detect<br/>SIEM / CloudTrail / WAF logs]
    end
    USER([User]) --> NW --> AUTH --> AUTHZ --> APP([App])
    APP --> ENC --> DB[(DB)]
    APP --> SEC
    PERIM -.logs.-> AUDIT
    IDENTITY -.logs.-> AUDIT
    DATA -.logs.-> AUDIT
    classDef perim fill:#fee2e2,stroke:#dc2626;
    classDef ident fill:#fef3c7,stroke:#d97706;
    classDef data fill:#dbeafe,stroke:#2563eb;
    classDef detect fill:#f1f5f9,stroke:#64748b;
    class NW perim;
    class AUTH,AUTHZ ident;
    class ENC,SEC data;
    class AUDIT detect;
DomainWhat it handles
Authentication (AuthN)Verifying who you are — ID/password, Passkey (passwordless biometric/device auth), MFA
Authorization (AuthZ)Controlling what you can do — RBAC (role-based), ABAC (attribute-based), IAM
EncryptionPreventing eavesdropping / leaks — TLS (transport encryption), AES (symmetric encryption standard), KMS (key management service)
NetworkPerimeter defense, isolation — FW (firewall), WAF (Web Application Firewall), VPC (Virtual Private Cloud)
Secrets managementAPI keys, passwords — Vault, Secrets Manager
Audit & detectRecording and detecting anomalies — SIEM (Security Information and Event Management — log-aggregated monitoring), CloudTrail, WAF logs

What you must decide — what’s your project’s answer?

For each item, articulate your project’s answer in 1-2 sentences.

AuthN / AuthZ / sessions

ItemExamples
AuthenticationPassword+MFA / Passkey / SSO (Single Sign-On) / SAML (XML-based federated auth standard) / OIDC (OpenID Connect, OAuth 2.0-based authentication standard)
Auth platformIn-house / Auth0 / Clerk / Cognito / Entra ID
Authorization modelRBAC / ABAC / ReBAC (relationship-based) / Policy languages (OPA — Open Policy Agent, general-purpose policy engine)
Session methodCookie / JWT (signed token) / Refresh Token
MFA factorTOTP (time-based one-time password) / WebAuthn (browser-standard biometric/device auth) / SMS
Password policyLength, complexity, rotation

Encryption / key management

ItemExamples
Transport encryptionTLS 1.3 / mTLS (mutual TLS, two-way certificate auth)
At-rest encryptionAES-256 / KMS / HSM (Hardware Security Module — dedicated crypto hardware)
Secrets managementAWS Secrets Manager / HashiCorp Vault
Key managementCloud KMS / CMK (Customer Managed Key)
PKIInternal CA (Certificate Authority) / Let’s Encrypt / ACM (AWS Certificate Manager)

Network / audit / compliance

ItemExamples
Network isolationVPC / Subnets / Security Groups
Perimeter defenseWAF / IDS/IPS (Intrusion Detection / Prevention System) / DDoS protection
Zero TrustBeyondCorp / Zscaler / Cloudflare Access
Audit logsCloudTrail / audit-trail retention period
Vulnerability managementSAST (Static Application Security Testing) / DAST (Dynamic) / dependency scanning
ComplianceSOC2 / ISO 27001 (international information-security standard) / PCI DSS

The shift in security philosophy

The migration from “perimeter defense” to Zero Trust is the largest paradigm shift of the cloud era. Perimeter design assumed “the internal network is safe”; remote work, SaaS use, and rising insider threats broke that assumption.

Zero Trust is the philosophy that trusts neither inside nor outside the network and verifies authentication and authorization on every transaction. Google’s BeyondCorp in the 2010s was the precursor. It bypasses VPN reliance and continually verifies user, device, and context.

PerimeterZero Trust
Inside = trust, outside = distrustDistrust everything to start
VPN protects the perimeterAuthN/AuthZ on every transaction
Network-centric designIdentity-centric
Heavy reliance on internal networkSame treatment regardless of location

Phase-by-phase security adoption roadmap

“Everything at once” is unrealistic. Split required vs recommended by phase.

PhaseOrg sizeRequiredNextMonthly cost
1 MVP / individualUp to 3HTTPS + MFA + Dependabot + IAM RolesSecret Scanning$0
2 Early startup3-30+ WAF + CloudTrail + encryptionGuardDuty + SSO~$300
3 Mid-sized SaaS30-300+ SIEM + vulnerability scan in CISOC2 + ISMS + Policy as Code~$3k
4 Enterprise300++ 24/7 SOC + DLP + ZTNAAnnual Red Team / pentest$30k+
5 Regulated industryAll sizesIndustry certifications (FISC / HIPAA / GovCloud)Variable

“Even at MVP, MFA + Dependabot + Secret Scanning + HTTPS are mandatory.” Postpone these and within hours of public launch you face IAM key leaks and intrusion via dependencies. The 2021 Log4Shell and 2022 Okta / LastPass incidents demonstrated the cost.

Even at MVP, install the minimum 4 on day one. “Later” does not exist in security.

Architecture-level traps

Forbidden moveWhy
Custom authDelegate to Clerk / Auth0 / Firebase Auth — DIY is full of holes
Storing JWT in localStorageSingle XSS leaks every user; httpOnly Cookie required
Relying solely on SMS MFASIM-swap defeats it; TOTP / FIDO2 required
Leaving Critical patches 2+ weeksThe Equifax 2017 pattern ($700M settlement); 72-hour SLA
”Inside is safe” perimeter defensePulse Secure 2021 incident; migrate to ZTNA
Persistent API keys in productionSwitch to OIDC + short-lived tokens
Logging PII without maskingThe GitHub 2018 plaintext-password pattern
No SBOMLog4Shell created “unknown if we’re affected” chaos
Security configuration via GUI by handNo change history; switch to IaC + Policy as Code
SHA-256 alone for password hashingArgon2id required; defense against GPU brute force
”Internal network is safe” — believing itPerimeter defense premise collapsed; Zero Trust is the standard
”We can build auth ourselves” — DIY implementationBug and vulnerability factory; delegate to standard protocols + SaaS

Security is the three-set: “don’t write it, borrow it, watch it.” Custom implementation is the largest source of incidents.

AI decision axes

AI-era favorableAI-era unfavorable
Standard protocols (OIDC, OAuth, SAML)Custom authentication / encryption
Dedicated SaaS (Clerk, Auth0, Entra ID)Hand-written auth systems
IaC-described IAM and security configurationGUI-set, tribal-knowledge permissions
Policy languages (OPA, Cedar) for authorizationIf-statements scattered through code
  1. Delegate to standard protocols and dedicated SaaS — don’t DIY auth, authorization, or encryption
  2. Design for defense in depth — stack network, auth, and encryption rather than relying on a single measure
  3. Start from Zero Trust — drop “inside is safe” and verify auth/authz on every transaction
  4. Express in IaC, keep it reviewable — avoid GUI-set tribal permissions; leave a Git audit trail

Author’s note — incidents that toppled companies via “should-have-prevented” hits

You hear repeatedly that security incidents come from neglecting basics rather than fancy attacks.

A major US credit bureau in 2017 took 2 months to apply the patch for a known Apache Struts vulnerability (CVE-2017-5638), and that delay caused 147 million records to leak. Settlements and fines from that one incident eventually reached around $700M. It’s the canonical reminder of how lethal a boring “patch delay” can be.

In 2019, a major US financial services company had a SSRF (Server-Side Request Forgery) caused by a WAF misconfiguration”, leaking ~100M customer records from S3 buckets. The attacker, a former cloud engineer, exploited a single line of carelessness. The fine was on the order of $80M.

I’ve personally had the experience of noticing a small misconfiguration in logs only six months after the fact. Both the public cases above weren’t sophisticated zero-days — they were the result of “basic operations breaking.” Boring basics are the strongest defense.

Security incidents come from basics neglected, not fancy attacks. Patch, MFA, and config review are the strongest defenses.

Summary

This article covered the big picture of security architecture — the CIA basics, major domains, perimeter-to-Zero-Trust shift, phase-by-phase roadmap, and the AI-era delegation stance.

Delegate to standard protocols and dedicated SaaS, design for defense in depth, start from Zero Trust, keep everything IaC-described and reviewable. The realistic answer for 2026.

The next article covers authentication design (MFA, Passkey, SSO, IDaaS selection).

Back to series TOC -> ‘Architecture Crash Course for the Generative-AI Era’: How to Read This Book

I hope you’ll read the next article as well.