A firewall is a network security control that inspects traffic against a rule set and blocks or allows it based on source, destination, port and protocol. It operates at a boundary between networks or network segments, stopping unauthorised connections while allowing legitimate traffic through. Firewalls range from simple packet filters to next generation appliances with deep application inspection.
Every network that touches the internet needs a boundary that decides what gets in and what gets out. That decision point, applied automatically and continuously, is what a firewall does.
What does a firewall actually do?
A firewall inspects network traffic as it attempts to cross a boundary and compares it against a set of rules. Each rule typically specifies a source address, a destination address, a port, a protocol and an action, allow or deny. Traffic that matches an allow rule passes through. Traffic that does not match any allow rule, or matches an explicit deny rule, is dropped or rejected.
The boundary a firewall protects can be the edge of a corporate network facing the internet, the line between a public facing web server and an internal database, or the interface of a single laptop. Firewalls exist at every layer: perimeter appliances protecting an entire office, host based software firewalls built into operating systems, and cloud native constructs like security groups and network access control lists that filter traffic between cloud resources.
The default posture matters as much as the rules themselves. A well configured firewall follows default deny, blocking everything that has not been explicitly permitted, rather than default allow, which blocks only what has been explicitly identified as bad. Default deny is harder to set up because every legitimate flow must be identified, but it is far more resistant to unknown or emerging threats.
What types of firewalls exist?
Packet filtering firewalls, the earliest type, examine each packet in isolation against rules based on IP address, port and protocol, without tracking whether the packet belongs to a legitimate ongoing connection.
Stateful inspection firewalls improved on this by tracking the state of each connection. A stateful firewall knows that a reply packet is part of a session that was initiated from inside the network, and permits it, while an unsolicited packet claiming to be a reply is rejected. Most firewalls in production today are at least stateful.
Next generation firewalls (NGFWs) combine stateful inspection with application awareness, intrusion prevention capability, and often the ability to decrypt and inspect TLS traffic. An NGFW can distinguish traffic belonging to a specific application even when it uses a common port, and can enforce policy based on user identity rather than just network address.
Web application firewalls (WAFs) are a distinct category that filters HTTP and HTTPS traffic specifically, looking for attack patterns targeting web applications rather than general network traffic. A WAF operates at a different layer and solves a different problem to a network firewall.
Cloud native firewalls, such as security groups in AWS or Azure network security groups, apply the same filtering logic without dedicated hardware, defined instead as configuration attached to cloud resources.
Where does a firewall fit in a broader security architecture?
A firewall is a boundary control, not a complete security programme. It reduces the attack surface that is reachable from outside, but it does nothing to stop a threat that has legitimate access to enter, such as a phishing email or a compromised credential, or to stop lateral movement once an attacker is inside a permitted segment.
This is why firewalls are typically paired with an intrusion detection system or intrusion prevention system that watches for malicious patterns in traffic the firewall has allowed, endpoint detection and response that monitors activity on the device itself, and network segmentation that uses internal firewalls to limit how far an attacker can move after an initial compromise. This layered approach is the basis of defence in depth, where no single control is expected to stop every threat on its own.
Firewalls are also central to the idea of zero trust architecture, where internal network segments are treated with the same scepticism as the internet, and firewalls enforce granular rules between segments rather than assuming everything inside the perimeter is trusted.
What makes a firewall configuration weak?
Most firewall failures are configuration failures, not product failures. Common weaknesses include overly broad rules, such as allowing an entire address range or all ports when only a specific service is needed; rules left in place after they are no longer needed, gradually expanding the allowed surface over time; permissive default allow rules instead of default deny; unrestricted or poorly authenticated remote management access to the firewall itself, which turns the control into a target; and a lack of logging or log review, meaning blocked and allowed traffic is never actually looked at.
Firewall rule sets also drift. A rule added for a short term project or a one off vendor connection often outlives its purpose because removing rules feels riskier than leaving them. Periodic rule review, removing anything that cannot be justified against a current business need, keeps the rule set aligned with what the network actually requires.
How does firewall configuration fit Australian guidance?
The ASD’s Information Security Manual (ISM) sets out specific guidance on gateway and firewall configuration, including default deny for both inbound and outbound traffic, restricting administrative access to firewalls to dedicated management networks, and logging firewall events for security monitoring. Organisations working towards Essential Eight maturity rely on correctly configured firewalls and network segmentation to support application control and to limit the blast radius of a compromise, even though firewalls are not one of the eight strategies by name.
For organisations pursuing an IRAP assessment or aligning with government security requirements, firewall and gateway configuration is one of the areas an assessor will examine closely, checking rule sets against the ISM’s specific requirements rather than general best practice alone.
Cybernion’s penetration testing services routinely test firewall configuration as part of an external assessment, looking for rules that expose more than intended and management interfaces reachable from untrusted networks.
Frequently asked questions
What is a firewall in simple terms?
A firewall is a network security control that inspects traffic passing through it and blocks or allows connections based on a defined rule set. It operates at a boundary, such as between an internal network and the internet, and decides what is permitted to cross that boundary based on factors like source address, destination address, port and protocol. Firewalls exist as dedicated hardware appliances, software running on a host, and cloud native services.
What is the difference between a firewall and antivirus software?
A firewall controls network connections, deciding what traffic is allowed in or out based on addresses, ports and protocols. Antivirus software inspects files and running processes on a device for known malicious code or behaviour. They address different layers of the same problem. A firewall can stop an attacker from reaching a vulnerable service in the first place, while antivirus catches malicious code that has already arrived, such as through an email attachment or download.
What is the difference between a stateful and next generation firewall?
A stateful firewall tracks the state of active connections and filters based on IP address, port and protocol, understanding whether traffic is part of an established, legitimate session. A next generation firewall (NGFW) adds deeper inspection, including application awareness, intrusion prevention, and the ability to decrypt and inspect encrypted traffic. NGFWs can enforce rules based on the specific application generating traffic, not just the port it uses, and often include integrated threat intelligence feeds.
Do small businesses need a firewall?
Yes. Every internet connected network needs a firewall as a baseline control, whether that is the firewall built into a home or small office router, a dedicated appliance, or a cloud provider’s security group and network firewall service. For a small business, correctly configuring what already exists, default deny outbound and inbound rules, restricted management access, and logging, matters more than buying additional hardware.
How does a firewall relate to the Essential Eight?
The Essential Eight does not name firewalls as one of its eight mitigation strategies directly, but network segmentation and application control, both encouraged by ASD guidance, depend on firewalls for enforcement. The ASD Information Security Manual (ISM) sets out detailed guidance for firewall and gateway configuration, including default deny rules and restricting administrative access, that organisations pursuing Essential Eight maturity are expected to follow as part of their broader network security posture.
Sources:
- Guidelines for Networking, Information Security Manual, Australian Signals Directorate, 2026
- Understanding Firewalls for Home and Small Office Use, Cybersecurity and Infrastructure Security Agency, 2025
- Guide to General Server Security, National Institute of Standards and Technology, 2008
Last updated: 30 August, 2026
