Security Architecture

[Security Architecture] Network Security - From Perimeter to Zero Trust

[Security Architecture] Network Security - From Perimeter to Zero Trust

About this article

As the fifth installment of the “Security Architecture” category in the series “Architecture Crash Course for the Generative-AI Era,” this article explains network security.

A design that detects and blocks unauthorized external access, suspicious traffic, and internal info leaks at the network layer. This article covers the main elements - FW/VPC/WAF/IDS/IPS/DDoS defense - the migration from perimeter defense to zero trust, and the importance of Egress control in the AI era - presenting guidelines to escape the myth that “safety with just a perimeter”.

What is network security in the first place

In a nutshell, network security is “the set of defenses that detect and block unauthorized access and data leaks on the communication path.”

Picture airport security. Immigration (firewall) screens out suspicious travelers, baggage inspection (IDS/IPS) catches dangerous items, and the boarding gate (security groups) runs a final check. Even if one layer is breached, the next layer stops the threat — this multi-layer structure is the foundation of network security.

Starting only after the myth of “the inside is safe” collapses

Once the perimeter-based idea of “the corporate network is safe, external is dangerous” was mainstream, but in the cloud and remote-work era, perimeters became fuzzy, and the shift to trust nothing, always verify - zero trust - is happening.

The thinking “safe because it’s the corporate LAN” ended in 2015. Perimeter defense alone can’t protect.

Why it’s needed

1. Reduce attack entry points

No matter how robust the app, leaving unnecessary ports open creates breach risk. The most certain is making things “invisible/unreachable” at the network layer.

2. Foundation of multi-layer defense

In preparation for “if the app is vulnerable” or “if a key leaks,” a mechanism that can stop damage at the network layer is needed. The Defense in Depth idea of one breach not breaking the whole.

3. Compliance requirements

PCI DSS, ISO 27001, Personal Information Protection Act - all require network-layer control. Environments without firewalls instantly fail audits.

Firewalls

Filters that allow/deny traffic, the most basic feature of network security. Modern times have evolved from simple port control to next-generation firewalls (NGFW) that look at the application layer.

TypeFunctionality
StatefulDecide by connection state
Packet filterDecide by header (classic)
Next-gen (NGFW)App recognition, IDS/IPS integration
WAFWeb-app-specialized (SQL injection etc.)
Cloud FWSecurity Group, NSG (Network Security Group, Azure network-layer access control), etc.

In cloud, Security Groups (AWS), NSGs (Azure), and firewall rules (GCP) are standard, with fine-grained control per instance.

VPC and network separation

A VPC (Virtual Private Cloud) creates a logically isolated network space. You can build your own dedicated network in cloud, with multi-layering via subnet separation (Public/Private/Intranet).

flowchart TB
    NET([Internet<br/>= includes attackers])
    subgraph VPC["VPC (your dedicated network)"]
        PUB["Public Subnet<br/>Load Balancer / NAT"]
        PRIV["Private Subnet<br/>app servers"]
        ISO["Isolated Subnet<br/>DB / sensitive data"]
        PUB --> PRIV --> ISO
    end
    NET --> PUB
    BAD[Putting DB in Public<br/>= instant leak accident]
    BAD -.|antipattern| ISO
    classDef threat fill:#fee2e2,stroke:#dc2626;
    classDef pub fill:#fef3c7,stroke:#d97706;
    classDef priv fill:#dbeafe,stroke:#2563eb;
    classDef iso fill:#dcfce7,stroke:#16a34a,stroke-width:2px;
    class NET,BAD threat;
    class PUB pub;
    class PRIV priv;
    class ISO iso;

The rule is to always place DBs in Private subnets so they can’t be reached directly from the internet. Accidents of breaking this basic and putting DBs in Public still happen today.

WAF (Web Application Firewall)

A dedicated firewall preventing web-app-specific attacks. SQL injection, XSS, CSRF, bot attacks - detected and blocked by signature- and behavior-based rules. Cloud WAFs are easy to set up, deployable in hours.

ServiceCharacteristics
AWS WAFCloudFront/ALB-integrated
Azure WAFApplication Gateway-integrated
CloudflareIntegrated with CDN, popular
AkamaiEnterprise
ImpervaVeteran, high-feature

Cloudflare offers basic WAF features even on the free plan, easily deployable on small sites.

DDoS countermeasures

Attacks that stop services with massive traffic (DDoS) - botnet-driven attacks of hundreds of Gbps are now standard. Single servers can’t absorb them, so CDN/DDoS-countermeasure services distribute and absorb.

CountermeasureContent
CDN (Cloudflare, CloudFront)Absorb attack traffic
AWS Shield / Cloud ArmorCloud-native
Rate limitPer-IP request limit
CaptchaBot identification
Geographic blockingBlock from unneeded countries

Cloudflare provides basic DDoS countermeasures free, deployable even at small scale. Larger scales need Cloudflare Enterprise or AWS Shield Advanced.

The 2016 Dyn DNS incident (1.2 Tbps DDoS via Mirai botnet stopping Twitter/GitHub/Netflix for hours) drove home to the world that single-server absorption is impossible (details in appendix “Critical Incident Cases”).

IDS / IPS

Mechanisms to detect and prevent intrusions. IDS (Intrusion Detection System) detects only, IPS (Intrusion Prevention System) auto-blocks. Recently, AI/ML enables detecting not just known patterns but also anomalous behavior.

TypeContent
NIDS / NIPSNetwork type
HIDS / HIPSHost type (deployed per server)
XDR (Extended Detection and Response, threat detection across multiple layers)Multi-layer integrated (Endpoint + Network + Cloud)
SIEM (Security Information and Event Management)Log aggregation, correlation analysis

Representative OSS are Snort, Suricata, Zeek, with major commercial players being CrowdStrike, Palo Alto, SentinelOne.

VPN and private connections

Mechanisms to safely connect from outside to inside. Importance grew with remote-work spread, but in an era where the VPN itself becomes an attack target (the 2021 Pulse Secure / Ivanti vulnerability incidents), migration to zero trust is progressing.

Connection methodContent
IPsec VPNSite-to-site traditional
SSL/TLS VPNUser connection, OpenVPN etc.
WireGuardModern, fast, simple
ZTNA (Zero Trust Network Access)VPN replacement, per-app connection
Direct Connect / ExpressRouteCloud dedicated lines

WireGuard is 10x faster than legacy VPNs, the top candidate for new builds. In zero-trust environments, ZTNA (Cloudflare Access, Tailscale, Twingate, etc.) is replacing VPN.

CDN (Content Delivery Network)

A mechanism for delivering static content from edge servers worldwide, providing both performance gains and security features simultaneously. DDoS absorption, WAF integration, and bot countermeasures are standard - required infrastructure for modern web services.

CDNCharacteristics
CloudflareFree tier available, most adopted
AWS CloudFrontAWS-integrated
FastlyDeveloper-oriented, flexible
AkamaiVeteran, enterprise
Vercel / Netlify EdgeFor JAMstack (JavaScript + API + Markup, static site + API composition)

The crucial security effect of CDN is being able to hide the origin IP, so attackers can no longer target the server directly.

Network segmentation and microsegmentation

A design that splits a large network into small segments and narrows inter-segment communication to the minimum necessary. The aim is to prevent lateral movement on breach, so even one server falling doesn’t spread damage company-wide.

LevelExample
VPC separationSeparate VPCs for prod/dev/staging
Subnet separationPublic/Private/Isolated
Security GroupPer instance
Service MeshInter-microservice
mTLSEncryption auth between services

In zero-trust thinking, the goal is encrypting and authenticating all inter-service communication. Service meshes like Istio and Linkerd realize this.

Decision criteria

1. System scale

ScaleRecommended
Small / SaaS-centricCloudflare + cloud SG
Mid / dedicated serversVPC separation + WAF + DDoS countermeasures
Large enterprise / multi-cloudZero trust + SIEM + XDR
Finance / governmentDedicated lines + HSM + 24/7 SOC

2. Threat level

Threat levelCountermeasure
Low (internal use only)SG + VPN
Mid (general public B2C)CDN + WAF + DDoS countermeasures
High (finance, medical)Above + IPS + SIEM + dedicated SOC
Highest (critical infra)All layers + physical isolation + human monitoring

How to choose by case

Small public web service (personal, startup)

Cloudflare free tier + cloud SG + Private Subnet. Cloudflare offers DNS/CDN/WAF/DDoS-countermeasure free, letting personal sites set up commercial-grade defense. Open only minimal ports with AWS/GCP security groups.

B2C service (EC, SNS)

Cloudflare or CloudFront + WAF + Shield + rate limit. Bot attacks and credential stuffing come daily, so combine WAF rules with bot countermeasures (CAPTCHA, challenges). Fully isolate DBs with Private/Public subnets.

B2B SaaS / business systems

ZTNA (Cloudflare Access, Tailscale) + WAF + SIEM. Per-app authorization fits remote-work era better than legacy VPN. Integrate with SSO, aggregate access logs in SIEM.

Finance / medical / government

Dedicated lines (Direct Connect / ExpressRoute) + IPS + 24/7 SOC + microsegmentation. To fully suppress lateral movement, mTLS-ize all communication via service mesh (Istio). Save full packet logs for audit response.

Practical scale x threat matrix

Note: Industry baseline values as of April 2026. Will become outdated as technology and the talent market shift, so requires periodic updates.

Network defense is realistically not “all-in-one” but phased adoption matched to scale and threat level.

Scale/threatMinimum compositionMonthly targetImplementation guideline
Personal/public siteCloudflare free tier + Private Subnet$01 hour
Small SaaSCloudFront + WAF + Security Grouptens of thousands of yen1 week
Mid B2CCloudFront + WAF + Shield Standard + Rate Limithundreds of thousands2 weeks
Large B2BZTNA + CDN + IPS + SIEMmillionsmonths
Finance/medicalAbove + dedicated lines + 24/7 SOC + UEBAtens of millions+1 year+

“The substantive lower bound for DDoS countermeasures is delivery via CDN.” Direct origin exposure ends instantly when hit by 1.2 Tbps-class attacks (the 2016 Mirai/Dyn incident). Even Cloudflare’s free tier alone gets DDoS absorption, WAF, and bot countermeasures, freeing you in one go from the state of having no defense at all.

Public IPs are scanned by bots 24/7. CDN front-placement is the minimum defense.

Network-operation pitfalls and forbidden moves

Here are the typical accidents in network security. All of them maximize damage range on breach.

Forbidden moveWhy it’s bad
Place DB / Redis / Elasticsearch in Public SubnetSame landmine as the 2017 MongoDB / Redis ransomware. Isolated required
0.0.0.0/0:22 in Security Group (SSH wide open)Thousands of SSH brute-force + miner-injection attempts in hours
Run prod and dev in same VPCDev mistakes propagate to prod. Separate per VPC
Trust VPN as the final defense lineThe 2021 Pulse Secure incident made the VPN itself the entry. Migrate to ZTNA
Direct origin exposure without CDNTake a 2016 Dyn DDoS (1.2 Tbps) and you’re done. Cloudflare free is enough
Satisfied just with WAF installedSkipping SQL-injection countermeasures app-side is out of the question
Run internal communication plaintextLateral movement makes everything visible. Encrypt all communication with mTLS
Manage firewall rules by hand in GUINo change history, audit response impossible. Code-ize with Terraform
Run AI agents without Egress controlAI leaks info to external APIs, data exfiltration risk
Leave unneeded ports/servicesAttack surface widens. Minimum-Ingress-rules only
No CDN-failure fallback designedThe 2021 Fastly and 2019 Cloudflare outages turn a single CDN into SPOF
”No encryption needed because it’s the corporate LAN” — complacencyInternal breaches do more damage; mTLS is the standard
”Safe with VPN” — full trustVPN itself is an attack target; migration to ZTNA is required

The October 2016 Dyn DNS attack (1.2 Tbps DDoS via IoT-stepped Mirai botnet, stopping Twitter/GitHub/Netflix/Spotify for hours), the 2021 Pulse Secure VPN vulnerability (VPN itself the entry, US government breach) - the reality that perimeter defense alone can’t protect is repeatedly shown.

The perimeter myth ended in 2015. CDN + ZTNA + Egress control are the three modern pillars.

AI decision axes

AI-era favorableAI-era unfavorable
Egress control (outbound communication restriction)Outbound free
Zero trust, microsegmentationFlat corporate LAN
Cloud-native WAFOn-prem heavy appliances
Centralized audit logs (SIEM)Siloed logs
  1. Zero trust as starting point — don’t trust corporate LAN either, authenticate and encrypt all communication
  2. CDN + WAF + DDoS countermeasures — reduce attack surface and hide origin IP with Cloudflare/CloudFront
  3. VPC + Private subnets — always isolate DBs, ban direct Public placement
  4. Narrow AI’s destinations with Egress control — limit external API connections via allow-list

Author’s note - cases of being sunk by complacency that “large-scale attacks won’t reach us”

Cases where social-infrastructure-class systems went down due to DDoS or VPN vulnerabilities have become a perennial industry talking point.

The 2016 Dyn DNS incident (1.2 Tbps DDoS via IoT-stepped Mirai, stopping Twitter/GitHub/Netflix for hours) became the trigger that made delegation to CDN/DDoS-countermeasure services the standard rule (details in appendix “Critical Incident Cases”).

Another, the April 2021 Pulse Secure VPN vulnerability (CVE-2021-22893), where the VPN itself became the entry and US government agencies and major defense industries were breached. A case told as the event that broke the “safe with VPN” premise and rapidly accelerated migration to ZTNA (Zero Trust Network Access).

I myself once left a test EC2’s Security Group at 0.0.0.0/0 for a few hours, and the next morning found auth logs lined with thousands of SSH brute-force entries and Bitcoin-miner-injection attempts. Both are cases where the premise of “safe with just a perimeter” was the lethal blow, and ones that decided the migration to multi-layer defense and zero trust.

Brace yourself thinking public IPs get attacked the moment they open. Test environments at production-grade.

What to decide - what is your project’s answer?

For each of the following, try to articulate your project’s answer in 1-2 sentences. Starting work with these vague always invites later questions like “why did we decide this again?”

  • Network separation (VPC, subnet design)
  • Firewall rules (Security Group, NSG)
  • WAF adoption (Cloudflare, AWS WAF, etc.)
  • DDoS countermeasures (CDN, Shield, etc.)
  • Remote-connection method (VPN / ZTNA)
  • IDS/IPS / SIEM adoption (depends on scale)
  • Egress control (allow-list for outbound communication)

Summary

This article covered network security, including main elements like firewalls, VPC, WAF, DDoS countermeasures, IDS/IPS, VPN/ZTNA, and CDN, the scale-x-threat matrix, and AI-era Egress control.

Zero trust as starting point, reduce attack surface with CDN+WAF+DDoS countermeasures, isolate DBs in Private, narrow AI’s destinations with Egress control. That is the practical answer for network security in 2026.

Next time we’ll cover zero trust (BeyondCorp, ZTNA, continuous verification).

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.