Open to everyone Reading, lesson 35 of 100, 2 min read
Firewalls and segmentation
Firewalls
A firewall allows or blocks traffic according to rules. Rules usually look at the protocol, source and destination addresses, and destination port.
Key ideas, which the firewall lab lets you practise:
- Rules are read from the top; the first match decides.
- The default policy at the bottom should be deny.
- Allow only what is needed, only from who needs it (least privilege).
Kinds of firewall
| Kind | What it understands |
|---|---|
| Packet filter | Individual packets: addresses, ports, protocol |
| Stateful firewall | Connections: it remembers that a reply belongs to a conversation started from inside |
| Next-generation firewall | Applications and users, with intrusion prevention built in |
| Web application firewall (WAF) | HTTP requests to websites, blocking common attacks such as injection |
| Host firewall | Runs on each computer, protecting that machine alone |
Segmentation
Segmentation splits a network into zones so that a problem in one does not spread to all. A school might have:
| Zone | Who is there | Can reach |
|---|---|---|
| Staff | Staff laptops | Staff servers, internet |
| Students | Lab PCs and student Wi-Fi | Internet and the learning platform only |
| Guests | Visitors' phones | Internet only |
| Servers | Records, finance | Only from specific staff systems |
| Devices | CCTV, printers, smart boards | Only their management systems |
Zones are separated with VLANs on switches and firewall rules between them. The DMZ (demilitarised zone) is a zone for servers that must be reachable from the internet, such as a public website, kept apart from internal systems.
Egress filtering
Most rules control what comes in. Controlling what goes out (egress) also helps: a server that only needs to reach the update service should not be able to connect anywhere on the internet, which makes it harder for malware to send data out.
Tip
Draw your network's zones on paper before writing any rules. Rules written without a picture tend to grow into an unreadable list that allows far too much.