🔒Firewall
Also known as Network Firewall, Host Firewall, Firewall Rule
A filter that lets some network traffic through and blocks the rest.
Think of it like
It is like a guard at a gate with a list. Only people on the list may come in.
Example
Jack's web server only needs ports 22, 80 and 443 open. His firewall blocks every other port. So a database left on by mistake cannot be reached from outside.
Why it matters
Every open port is a door. A firewall keeps the doors you did not mean to open shut.
Definition
Example code
bash
sudo ufw default deny incoming
sudo ufw allow 22/tcp
sudo ufw allow 443/tcp
sudo ufw enableCommon mistake
Key takeaways
- 1Rules decide. Allow or block by address, port and direction.
- 2Deny by default. Block all, then open what is needed.
- 3One layer. It does not stop attacks on open ports.