Network security is the discipline of protecting data in transit and controlling access between systems. The traditional perimeter model (firewall around the trusted inside) has been giving way to zero-trust (don't trust anything; verify everything). Modern networks combine both.
This page covers the fundamentals.
The traditional model:
Pros: simple; cheap to operate. Cons: attacker who gets inside has free rein; doesn't fit cloud or mobile.
For most modern environments, perimeter alone is insufficient.
Don't trust anything based on network location. Authenticate and authorize every request, including internal ones.
Principles:
Implementation:
This is significant work but reduces lateral movement risk after compromise.
Divide the network into segments. Limit lateral movement.
Logical network boundaries. Different VPCs don't see each other unless explicitly peered.
Instance-level firewall rules. "Only the load balancer can talk to the application instances on port 8080."
mTLS + identity-based authorization between services. See ServiceMeshArchitecture.
Database servers in private subnet. Only application servers can connect. No direct internet access.
All traffic should be TLS-encrypted, even internal.
For modern apps, TLS 1.2 minimum; 1.3 preferred. Older versions (SSL, TLS 1.0/1.1) are deprecated and have known vulnerabilities.
Let's Encrypt for public certs (free, automated). AWS Certificate Manager / GCP Certificate Manager for managed renewal.
For internal services: private CA with automated rotation. Cert lifecycle is operational work; automate it.
Mutual TLS: both sides authenticate. The server presents a cert; the client also presents a cert. Both verify.
For service-to-service auth, mTLS is more secure than API keys. Service meshes provide it transparently.
Distributed denial of service: many sources flooding your service.
Defenses:
Attacker intercepts traffic between client and server.
Defenses:
Attacker scans your network for vulnerabilities.
Defenses:
Attacker phishes a user; uses their credentials to access internal network.
Defenses:
Multiple layers of security. Perimeter firewall + segmentation + mTLS + authorization. Compromise of one layer doesn't grant full access.
Each component has the minimum permissions needed. Don't grant broad access "in case it's needed later."
Public subnets: load balancers, bastion hosts. Private subnets: application servers, databases.
Internet traffic enters public; internal traffic stays in private.
Old: bastion host (jump server) for SSH access. Modern: AWS SSM Session Manager — no SSH; session through AWS APIs. More auditable; no port 22 exposed.
Old: VPN to access internal services. Modern: zero-trust apps (each user authenticates per app); no flat internal network.
Instance-level firewall. Stateful. Reference other security groups: "the database SG allows the application SG."
Subnet-level. Stateless. Used for broad rules (block specific IP ranges).
Access AWS services without going through internet. Reduces exposure.
Expose specific services to specific accounts without internet routing.
Web Application Firewall at the edge. See WebApplicationFirewalls.
For a typical web app: