Module 2 · Network Controls, Logging and Detection · Lesson 4 of 9
Security groups and NACLs
Stateful versus stateless filtering, and restricting a management port to the one source that needs it.
In this lesson · about 22 minutes
- Compare security groups, NACLs and route tables
- Restrict a management port to a specific source CIDR
- Troubleshoot connectivity without opening everything
| Control | Applies to | State | Rules |
|---|---|---|---|
| Security group | A resource (an instance's network interface) | Stateful: replies to allowed traffic are allowed automatically | Allow only |
| Network ACL | A whole subnet | Stateless: return traffic needs its own rule | Allow and deny, numbered order |
| Route table | A subnet | — | Decides where packets go (internet gateway, NAT, peering…) |
A public IP alone doesn't prove internet reachability: the subnet needs a route to an internet gateway, the security group and NACL must allow the traffic, and a service must be listening.
Management ports
SSH (22) and RDP (3389) open to 0.0.0.0/0 get scanned within minutes. Allow them only from your actual management address (a /32), or better, use a session manager that needs no inbound port at all.
Hands-on lab (simulated terminal)
Practice challenge 03: tighten a security group
Simulated AWS CLI. The sandbox instance uses security group sg-0a1b2c3d4e5f60718. Your management address is 198.51.100.7.
Step 1 of 3. Type each command and press Enter. Nothing runs on your computer.
1. Describe the security group's inbound rules.
Performance-based question (PBQ)
Which layer is blocking?
An instance in a public subnet runs a web server on 443. Each case below has exactly one problem.
Pick the cause.
- The SG has no inbound 443 rule; the NACL allows all
- Inbound 443 is allowed by SG and NACL, but the NACL has no outbound rule for ports 1024–65535
- The subnet's route table has no 0.0.0.0/0 route to an internet gateway
- SG, NACL and routes are fine; on the instance, ss -lnt shows nothing on 443
Check your understanding0 of 2 correct
Quiz score: 0 of 2
Noviq Academy is free and for learning. The AWS command line and console in this course are simulated with a made-up account and dummy data. If you practise in a real AWS account, use a dedicated sandbox, enable MFA and budget notifications, and delete everything when you finish: you are responsible for any charges. AWS and Amazon S3 are trademarks of Amazon.com, Inc.; this course is independent of AWS.