Keyboard Shortcuts N Next post
P Previous post
S Save / unsave
R Read aloud
T Toggle theme
/ Focus search
Esc Close panels
🔥
Ready to read...
AWS Cloud Computing Cloud Computing: From Zero to Production Module 5 — Networking Networking security

Security Groups vs NACLs — AWS Firewall Explained

Reviewed & accurate
AI Summary

What You Will Learn

Intermediate

  • The difference between Security Groups and NACLs
  • Stateful vs stateless firewalls
  • How to configure both
AspectSecurity GroupNetwork ACL (NACL)
LevelInstance (ENI)Subnet
Stateful?Yes (return traffic auto-allowed)No (rules for both directions)
RulesAllow onlyAllow + Deny
OrderAll rules evaluatedProcessed in order (lowest number first)
DefaultDeny all inboundAllow 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.
Previously: Lesson 31 covered VPC subnets.
Today: You learned: Security Groups vs NACLs — when to use each.
Next: Lesson 33 covers VPC peering.
Test Your Knowledge
How did you find this?

Comments

Join the discussion! Sign in with your Google or Blogger account, or comment as Anonymous - no account needed. For quick questions, also reach me on Telegram @cytestch.

Comments