Course contentsShow
← Cloud and Infrastructure
Lesson 201 of 2,9894. Cloud Networking BasicsFree lesson

Security Groups vs Network ACLs Overview

Understand the fundamental differences between stateful security groups and stateless network ACLs in cloud networking.

Security Groups vs Network ACLs Overview

You'll learn: The key difference between stateful security groups and stateless network ACLs, and why it matters for cloud network security.

Two Layers of Network Defense

In cloud networking, you have two complementary firewall mechanisms to control traffic: security groups and network ACLs (Access Control Lists). They both filter traffic, but they work fundamentally differently.

Security Groups: Stateful Protection

Think of a security group like a bouncer with a memory. When you allow traffic in through a rule, the bouncer automatically remembers and allows the response traffic back out—no separate rule needed. This is called stateful behavior.

Security groups:

  • Operate at the instance/resource level
  • Only support "allow" rules (deny by default)
  • Automatically track connection state
  • Evaluate all rules before deciding

Example: You allow inbound HTTPS (port 443). When your instance responds, that outbound traffic is automatically permitted—you don't need an outbound rule for it.

Network ACLs: Stateless Filtering

Network ACLs are like checkpoint guards with no memory. They check every single packet independently, in both directions. If you allow traffic in, you must separately allow the response traffic out. This is stateless behavior.

Network ACLs:

  • Operate at the subnet level (broader scope)
  • Support both "allow" and "deny" rules
  • Process rules in numbered order (lowest first)
  • Don't track connections—each direction needs explicit rules

Example: Allow inbound HTTPS on port 443 and separately allow outbound traffic on ephemeral ports (1024-65535) for responses.

Why Both Exist

Security groups provide convenient, resource-specific protection. Network ACLs add a subnet-wide safety net with explicit deny capabilities—useful for blocking specific IPs or adding regulatory compliance controls.

Key Takeaway: Security groups are stateful (remember connections) and work at the instance level, while network ACLs are stateless (check each packet independently) and protect entire subnets.