Topics in this domain
- Security Governance and Roles
- Data Classification and Ownership
- Security Policies
- Privacy Principles and GDPR
- Identity Management
- Authentication Factors
- Biometrics
- Access Models: DAC, MAC, RBAC
- Logical and Privileged Access
- Cryptography Basics
- Symmetric Encryption
- Asymmetric Encryption
- Hashing and Integrity
- Digital Signatures
- PKI and Certificates
- Firewalls
- IDS/IPS
- VPN, SSL/TLS, IPsec
- Wireless Security
- Endpoint and Mobile (BYOD)
- Cloud and Virtualization Security
- Zero Trust Architecture
- Physical Access Controls
- Environmental Controls: Fire, Power, HVAC
- Social Engineering
- Malware
- Network Attacks: DoS, Spoofing, Sniffing
- Application Attacks: SQLi, XSS
- Vulnerability Management and Pen Testing
- Incident Response
- Digital Forensics and Chain of Custody
- Security Awareness Training
- Logging, SIEM, and Auditing Security
Firewalls
The security desk
An office security desk checks everyone coming in. A basic one just checks you’re heading for a floor that exists. A better one remembers who signed in, so only their visitors are let back out. The best one opens your bag and reads your paperwork.
A firewall enforces a security policy on traffic between networks or zones: it allows what’s permitted and blocks the rest. It’s a key boundary control, but only one layer of defence.
Types
Firewall types differ in how far up the network stack they look. The diagram shows them from the simplest at the bottom, packet filters that check only addresses and ports, to web application firewalls at the top that understand application attacks. The higher a firewall looks, the more it understands, and the slower it tends to be.
| Type | Open Systems Interconnection (OSI) layer | What it does |
|---|---|---|
| Packet filtering | 3-4 | Checks each packet’s addresses, port and protocol against rules. Fast and simple, but has no memory and can’t see content; vulnerable to spoofing |
| Stateful inspection | 3-4 | Keeps a table of connections, so replies are allowed only for sessions that were legitimately started |
| Circuit-level gateway | 5 | Checks the session handshake, then relays traffic without inspecting it |
| Application-level gateway (proxy) | 7 | Ends the connection and inspects the actual application content. The most secure traditional type, but slower, and needs a proxy per application |
| Next-generation firewall (NGFW) | 3-7 | Stateful inspection plus knowing which application and user is involved, intrusion prevention, and sometimes Transport Layer Security (TLS) inspection |
| Web application firewall (WAF) | 7 | Protects web applications from attacks such as SQL injection and cross-site scripting |
| Host-based firewall | Host | Software firewall on an individual server or laptop |
The DMZ
A screened subnet, or DMZ (demilitarised zone), puts public-facing servers in a separate network between an external and an internal firewall. If the web server is hacked, the attacker still faces a second firewall before reaching anything internal. It’s the most secure of the common designs. Putting a public web server on the internal network is wrong.
Older designs you may meet:
- Screened host: a packet-filtering router allows traffic only to one hardened bastion host.
- Dual-homed host: a host with two network cards and routing switched off, so all traffic must go through its proxy services.
Rule sets
- Default deny: anything not explicitly allowed is blocked.
- Order matters: firewalls usually apply the first rule that matches.
- Least privilege: specific sources, destinations and ports, not “any”.
- Regular review to remove unused and too-broad rules, with business owners confirming each is still needed.
- Change management for every rule change.
- Logging of denied and important allowed traffic, sent to a security information and event management (SIEM) and reviewed. Logs nobody reads detect nothing.
- Harden the firewall itself: patched, restricted admin access, MFA.
Example. A firewall review finds 1,800 rules. 400 haven’t matched any traffic in a year, and one allows any source to reach the database server on any port, added “temporarily” during a migration three years ago. The findings: no periodic rule review, and weak change control over rules.
What firewalls can’t do
The diagram shows four things a firewall can’t protect against. Insiders are already inside the network. Attacks can hide in allowed traffic, such as malware over HTTPS. Bypass routes, such as rogue Wi-Fi or unauthorised VPNs, go around it. And it can’t protect against its own misconfiguration.
Firewalls don’t protect against:
- attacks that start inside the network
- attacks carried in allowed traffic (such as malware over HTTPS, unless it’s inspected)
- connections that bypass them (rogue wireless, personal hotspots, unauthorised VPNs)
- their own misconfiguration
How the exam asks about it
| If the question asks… | The answer is usually… |
|---|---|
| Most secure traditional firewall type | Application-level gateway (proxy) |
| Firewall type that tracks connections | Stateful inspection |
| Where to place a public web server | In a DMZ (screened subnet) |
| Firewall protecting against SQL injection | Web application firewall |
| Best practice for firewall rules | Default deny; least privilege; periodic review |
| Limitation of firewalls | Don’t stop insider attacks or threats in allowed traffic |
In short
- Packet-filtering firewalls check addresses, ports and protocols (layers 3-4); fast but can't see application content.
- Stateful inspection firewalls track connections, allowing only responses to legitimate sessions.
- Application-level gateways (proxies) inspect traffic at layer 7; most secure of the traditional types but slower.
- Next-generation firewalls combine stateful filtering, application awareness, intrusion prevention and user identity.
- A screened subnet (DMZ) between two firewalls is the most secure common architecture for internet-facing servers.
- Rule sets should default-deny, be ordered correctly, be reviewed regularly, and changes should follow change management.
- Firewalls don't stop attacks from inside, attacks in allowed traffic, or threats that bypass them (such as unmanaged connections).
Exam traps
- A web application firewall protects web applications from attacks such as SQL injection; a network firewall doesn't inspect that deeply.
- The most secure firewall type in the traditional list is the application-level gateway.
- Placing a public web server on the internal network is wrong; it belongs in the DMZ.
- Rules allowing 'any any' or unused rules left in place are common findings.
- Firewall logs that aren't reviewed provide no detection.
Check yourself
-
Where should a public web server be placed?
The DMZ isolates internet-facing servers. -
Which traditional firewall type is MOST secure?
Proxies inspect at layer 7. -
Which firewall rule setting is a common finding?
Overly permissive and unused rules are findings.
Slides
Click the slide and use the arrow keys. F toggles full screen.
Turn your phone sideways for a bigger view. Tap any diagram to enlarge it.