Security Groups
Stateful firewall on the resources (ENIs) it is associated with.
Official AWS Reference https://docs.aws.amazon.com/vpc/latest/userguide/vpc-security-groups.html ↗// DECISION LOGIC MATRIX
When to Choose
You control which protocols, ports, and sources reach an EC2 instance, ALB, or RDS instance.
When to Avoid
You need an explicit deny or subnet-wide blocking. Use a NACL.
// EXAM TRAPS & SIGNAL KEYWORDS
// OFFICIAL AWS REFERENCE
"A security group controls the traffic allowed to reach and leave the resources it is associated with. Only traffic allowed by its rules reaches the instance."
- Security groups are stateful. Response traffic is allowed regardless of the opposite-direction rules.
- Security groups hold allow rules only. There is no deny rule.
- No charge for security groups. One resource can have multiple security groups.
// SECURITY GROUPS TAKEAWAYS
Role: Stateful firewall on the resources (ENIs) it is associated with.
Choose: You control which protocols, ports, and sources reach an EC2 instance, ALB, or RDS instance.
Avoid: You need an explicit deny or subnet-wide blocking. Use a NACL.
Trap: Watch for exam signals like explicit deny, subnet-level, stateless.
Fact: Security groups are stateful. Response traffic is allowed regardless of the opposite-direction rules.
Fact: Security groups hold allow rules only. There is no deny rule.
Fact: No charge for security groups. One resource can have multiple security groups.
// PRACTICE QUESTIONS
Ready to test your Security Groups knowledge?
30 practice questions cover Security Groups.