VPC Security Fundamentals: Architecture and Implementation
Understanding security in a VPC (for example, network ACLs, security groups, Amazon Inspector)
VPC Security Fundamentals: Architecture and Implementation
This curriculum overview covers the essential security layers within an Amazon Virtual Private Cloud (VPC), focusing on the defense-in-depth strategy provided by Security Groups, Network Access Control Lists (NACLs), and automated security assessments.
Prerequisites
Before beginning this module, learners should have a foundational understanding of the following concepts:
- Cloud Computing Basics: Familiarity with the AWS Global Infrastructure (Regions and Availability Zones).
- Networking Fundamentals: Basic knowledge of IP addressing, CIDR notation (e.g., $10.0.0.0/16$), and the OSI model (specifically Layer 3 and Layer 4).
- VPC Components: A high-level understanding of subnets, Route Tables, and Internet Gateways.
Module Breakdown
| Module ID | Topic | Difficulty | Focus Area |
|---|---|---|---|
| SEC-01 | Security Groups (SG) | Beginner | Instance-level protection; Stateful rules |
| SEC-02 | Network ACLs (NACL) | Intermediate | Subnet-level protection; Stateless rules |
| SEC-03 | Advanced Protection (WAF & Shield) | Intermediate | Layer 7 protection and DDoS mitigation |
| SEC-04 | Amazon Inspector | Beginner | Automated vulnerability and compliance scanning |
| SEC-05 | Centralized Management | Advanced | AWS Firewall Manager and Network Firewall |
Learning Objectives per Module
SEC-01: Security Groups
- Define the role of a Security Group as a virtual firewall for EC2 instances.
- Explain Stateful behavior: If an inbound request is allowed, the outbound response is automatically allowed.
- Configure inbound and outbound rules based on protocol, port range, and source/destination IP.
SEC-02: Network ACLs
- Identify NACLs as a second layer of defense operating at the subnet level.
- Contrast Stateless behavior: Inbound and outbound traffic must be explicitly allowed in both directions.
- Utilize rule numbering to determine the order of evaluation (lowest number evaluated first).
SEC-03: Amazon Inspector & Higher-Level Security
- Describe how Amazon Inspector automatically assesses applications for exposure, vulnerabilities, and deviations from best practices.
- Distinguish between AWS WAF (Web Application Firewall) for Layer 7 attacks and AWS Shield for DDoS protection.
Visual Anchors
VPC Traffic Flow Logic
Comparison Table: Security Groups vs. NACLs
| Feature | Security Group (SG) | Network ACL (NACL) |
|---|---|---|
| Level | Instance (vNIC) | Subnet |
| State | Stateful (Return traffic allowed) | Stateless (Return traffic must be explicitly allowed) |
| Rules | Supports "Allow" rules only | Supports "Allow" and "Deny" rules |
| Evaluation | All rules evaluated before decision | Rules evaluated in number order (Top-down) |
| Default | Denies all inbound; Allows all outbound | Allows all inbound and outbound (Default NACL) |
Examples & Scenarios
[!TIP] Scenario 1: Web Server Protection To protect a public web server, you apply a Security Group that allows Inbound HTTP (Port 80) and HTTPS (Port 443) from $0.0.0.0/0$. Because SGs are stateful, you do not need to configure an outbound rule for the server to reply to the user.
[!IMPORTANT] Scenario 2: Blocking a Malicious IP Security Groups cannot "Deny" a specific IP—they can only "Allow." To block a known malicious IP address ($1.2.3.4/32) from entering your entire subnet, you must use a Network ACL with a Deny rule numbered lower than your Allow rules.
The Math of Subnets
Subnet sizing is determined by the CIDR suffix n$. The number of available IP addresses is calculated as: (Note: AWS reserves 5 IP addresses in every subnet for networking overhead.)
Success Metrics
To demonstrate mastery of this curriculum, the learner must:
- Architect a 3-tier VPC: Successfully place EC2 instances in private and public subnets with appropriate SG and NACL configurations.
- Troubleshoot Connectivity: Identify if a connection failure is due to a stateless NACL missing a return rule or an SG misconfiguration.
- Vulnerability Reporting: Interpret an Amazon Inspector report and remediate at least one identified security finding.
- Score 80%+: On the AWS Certified Cloud Practitioner practice exam sections regarding VPC Security.
Real-World Application
In a professional environment, these tools form the "Defense in Depth" strategy:
- Financial Services: Use NACLs to provide a hard boundary between processing subnets and database subnets, ensuring no accidental lateral movement occurs.
- E-commerce: Deploy AWS WAF in front of an Application Load Balancer to stop SQL Injection attacks while using Security Groups to ensure only the Load Balancer can talk to the backend web servers.
- Compliance: Use Amazon Inspector to provide audit logs proving that all production servers are patched against the latest CVEs (Common Vulnerabilities and Exposures).