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
ControlApplies toStateRules
Security groupA resource (an instance's network interface)Stateful: replies to allowed traffic are allowed automaticallyAllow only
Network ACLA whole subnetStateless: return traffic needs its own ruleAllow and deny, numbered order
Route tableA 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.

Practice challenge 03: tighten a security group

1. Describe the security group's inbound rules.

learner@sandbox:~$

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
0 of 4 answered

Check your understanding0 of 2 correct

Question 1

1.Is a security group stateful?

Question 2

2.A teammate opens all ports to 0.0.0.0/0 to fix a connection problem. What's the better approach?

Quiz score: 0 of 2

Tip: answer every quiz question correctly first.

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.