Day-23: Security Groups & NACLs (Network Access Control Lists)


🔐 1️⃣ What They Are

Both Security Groups (SG) and Network ACLs (NACL) act as firewalls in AWS, but they work at different layers.

Type Layer Protects
Security Group Instance Level EC2 instances
Network ACL (NACL) Subnet Level Entire subnets

🧱 2️⃣ Security Groups (SG)

🔹 Example:

Inbound Rules:
Type: SSH | Port: 22 | Source: My IP
Type: HTTP | Port: 80 | Source: 0.0.0.0/0

🧠 Tip: SGs only support Allow rules, no Deny rules.


🌐 3️⃣ Network ACL (NACL)