How it decides.
A firewall reads each connection: where it comes from, where it is going, on which port and, for recent models, which application is carrying it. It compares it against its list of rules, from top to bottom, and applies the first one that matches: allow, block, or log.
The right starting rule is default deny: anything not explicitly allowed is blocked. This applies to incoming traffic and to outgoing traffic too: a computer with no reason to reach an unknown server on an unusual port should not be able to.
An SME’s four firewalls.
| Type | What it protects | What it does not do |
|---|---|---|
| Router firewall | The network entrance, by refusing unsolicited connections from the internet | Few logs, no zones, no filtering of outgoing traffic |
| Next-generation hardware firewall | The whole network: separate zones, application recognition, web filtering, remote access | Nothing for remote workers off the VPN, or for online services |
| Windows or macOS firewall | Each computer, including against other computers on the same network | An overall view: it is set computer by computer, or from a central console |
| Web application firewall, or WAF | A website or web application, against malicious requests | The internal network and computers |
Common hardware firewall brands among SMEs include Stormshield, designed in France, Fortinet, Sophos and WatchGuard.
The workstation firewall.
The Windows firewall, called Windows Defender Firewall, is on by default. It is sometimes switched off to fix a problem and then forgotten. Yet it is what stops a compromised computer from attacking another: ransomware often spreads from machine to machine through Windows file sharing or remote administration.
The useful setting is simple: workstations accept no incoming connections from other workstations, and only identified servers and administration tools are allowed in. You set it once and for all through a Group Policy or Microsoft Intune. On a Mac, the built-in firewall is off by default and is turned on in System Settings, under Network.
The WAF, in front of your website.
A website must, by definition, accept connections from everyone, so a traditional firewall lets that traffic through. A WAF, short for web application firewall, reads the content of requests and blocks those that look like an attack: code injected into a form, rapid-fire login attempts on the admin page, bots looking for a vulnerable plugin.
It is offered by hosting providers, by services placed in front of the site such as Cloudflare, or as a WordPress plugin. It does not replace updates: it buys time between a flaw being published and being fixed. To find out what an attacker could still do, see the web penetration test.
What it cannot see.
A firewall judges connections, not their intent. A malicious email arrives via the mail service, an authorised connection. A stolen password used on Microsoft 365 never even passes through your premises. Malware communicating over HTTPS with an ordinary-looking site resembles normal browsing.
The firewall is therefore one layer among others, alongside two-factor authentication, EDR on computers and offline backups, following the principle of defence in depth. Practical network settings, port forwarding, zones and Wi-Fi, are on the network security page.
Bonbay. Updated 15 November 2026.