What You Will Learn
Intermediate
- The difference between Security Groups and NACLs
- Stateful vs stateless firewalls
- How to configure both
| Aspect | Security Group | Network ACL (NACL) |
|---|---|---|
| Level | Instance (ENI) | Subnet |
| Stateful? | Yes (return traffic auto-allowed) | No (rules for both directions) |
| Rules | Allow only | Allow + Deny |
| Order | All rules evaluated | Processed in order (lowest number first) |
| Default | Deny all inbound | Allow all |
Most common setup
Use Security Groups for 95% of firewall rules. Use NACLs for subnet-level blocking (e.g., block a malicious IP range). Security Groups are stateful — easier to manage.Practical Exercise
Go to EC2 -> Security Groups
Create a security group allowing SSH (22) from your IP
Also allow HTTP (80) from anywhere (0.0.0.0/0)
Go to VPC -> Network ACLs
Examine the default NACL (allow all)
Key Takeaways
- Security Groups: instance-level, stateful, allow-only.
- NACLs: subnet-level, stateless, allow + deny.
- Security Groups are the primary firewall (95% of rules).
- NACLs for subnet-level blocking (malicious IP ranges).
- SGs default: deny all inbound. NACLs default: allow all.
Comments
Comments
Post a Comment