BM: Baca dalam Bahasa Melayu
World A3: The Mall's Roads
Security groups and NACLs
You will learn: the two guards, the unit's door and the row's gate, and how to let only the right visitors in.
Checked with AWS 2026-11 on 1 Nov 2026
The problem
Tap each point on the timeline.
One loose rule, and the whole street knocks. Tap the story. Who should guard the door?
Watch
A Security group: The guard at a unit's door. Allow rules only, and it remembers who came in, so replies go out. is the guard at your unit’s door. It has allow rules only. Let shoppers in on 443. Let only your laptop use SSH.
Set the door guard's rules. Only the right visitors get in.
Visitors
- Shoppershould get in
TCP 443from 198.51.100.20Its replies go back to ports 49152–65535. - Your laptop (SSH)should get in
TCP 22from 203.0.113.9Its replies go back to ports 32768–61000. - Stranger (SSH)keep out
TCP 22from 192.0.2.77Its replies go back to ports 32768–61000.
Unit door · security group (the server)
Allow rules only. It remembers who came in, so replies always go out.
In
No In rules yet: nothing gets in.
Out: all traffic (a new group starts this way).
Hint
Port 443 from 0.0.0.0/0. Port 22 from 203.0.113.9/32 only.Watch
A Network ACL: The gate of a whole row. Numbered allow and deny rules, lowest first. It remembers nothing. is the gate of the whole row. It remembers nothing. A shopper got in on 443. Their reply leaves to port 50000. Who needs a rule for it?
Pick one answer.
Try it
This row has a new custom gate. It denies everything. Let shoppers in on 443, and let their replies out.
Set the row gate's list. Right visitors in, their replies out.
Visitors
- Shopper on Windowsshould get in
TCP 443from 198.51.100.20Its replies go back to ports 49152–65535. - Shopper on Linuxshould get in
TCP 443from 203.0.113.50Its replies go back to ports 32768–61000. - Port scannerkeep out
TCP 3389from 192.0.2.66Its replies go back to ports 32768–61000.
Row gate · network ACL (the subnet)
Lowest number first. The first rule that fits decides. It remembers nothing, so replies need an Out rule.
In
| Rule | Traffic | From | Allow/Deny | Remove |
|---|---|---|---|---|
| * | All traffic | 0.0.0.0/0 | DENY |
Out
| Rule | Traffic | To | Allow/Deny | Remove |
|---|---|---|---|---|
| * | All traffic | 0.0.0.0/0 | DENY |
Unit door · security group (the server)
Allow rules only. It remembers who came in, so replies always go out.
In
- TCP 443 · from
0.0.0.0/0
Out: all traffic (a new group starts this way).
Hint
In: TCP 443 from 0.0.0.0/0. Out: TCP 1024-65535 to 0.0.0.0/0.Check
The CLI adds a door rule too. This is the official example’s answer, cut short. Tap the line that says who may come in.
Tap the line that says who may come in.
0 of 1 found
Check
Door guard or row gate? Sort each fact.
Drag a card into a box. Or tap the card, then tap the box.
You did it!
You can now set both guards, so only the right visitors get in.
Go deeper (optional)
The default network ACL allows everything, so most people only tune security groups. A new security group lets nothing in and everything out. Instead of SSH, try Session Manager: it needs no open inbound port at all.
Bahasa Melayu
Satu peraturan longgar, dan seluruh jalan datang mengetuk. Ketik cerita itu. Siapa patut jaga pintu?
Security group (pengawal pintu) ialah pengawal di pintu unit anda. Ia ada peraturan benarkan sahaja. Benarkan pembeli masuk di 443. Benarkan laptop anda sahaja guna SSH.
Network ACL (pagar baris) ialah pagar untuk seluruh baris. Ia tak ingat apa-apa. Pembeli masuk di 443. Jawapan mereka keluar ke port 50000. Siapa perlukan peraturan untuknya?
Baris ini ada pagar khas yang baru. Ia tolak semua. Benarkan pembeli masuk di 443, dan benarkan jawapan mereka keluar.
CLI pun boleh tambah peraturan pintu. Ini jawapan contoh rasmi, dipendekkan. Ketik baris yang sebut siapa boleh masuk.
Pengawal pintu atau pagar baris? Susun setiap fakta.
Kini anda boleh tetapkan kedua-dua pengawal, supaya hanya pelawat yang betul masuk.
You finished this before. Practice is always welcome!
Official docs: Amazon VPC: Security groups · Amazon VPC: Network ACLs · Amazon VPC: Custom network ACLs (ephemeral ports) · AWS CLI: aws ec2 authorize-security-group-ingress
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?