Security

What is Firewall?

Definition

A network security device or software that monitors and controls incoming and outgoing traffic based on predetermined security rules, acting as a barrier between trusted and untrusted networks.

A firewall is a network security system that enforces access control policies by examining packets and deciding whether to forward or drop them. It sits at the boundary between internal networks (trusted) and external networks (untrusted, such as the internet). Firewalls can be implemented as hardware appliances, software running on general-purpose servers, or virtual instances in cloud environments.

The most common type is the stateful firewall, which tracks the state of active connections. When a packet arrives, the firewall checks not only its source and destination addresses and ports (stateless filtering) but also whether it belongs to an established session. This prevents attackers from injecting unsolicited packets that mimic legitimate traffic. Stateless firewalls, also known as packet filters, inspect each packet in isolation without session awareness. Next-generation firewalls (NGFWs) add application-layer inspection, intrusion prevention, and identity-based rules. Firewalls operate at Layers 3 and 4 of the OSI model, and NGFWs also operate at Layer 7.

Firewalls are fundamental to network security architecture, often deployed at network perimeters, between internal segments (east-west traffic), and on individual hosts (personal firewalls). They are complementary to other security controls like intrusion detection systems and VPNs. Configuration requires careful rule ordering to avoid accidental bypass or performance degradation. Common examples include iptables/nftables (Linux), Windows Defender Firewall, pfSense, Cisco ASA, and cloud security groups (AWS, Azure, GCP).

Key facts

  • First firewalls appeared in the late 1980s; packet filtering was introduced in RFC 1122.
  • Stateful firewalls maintain a connection table to track session state; stateless firewalls do not.
  • Default rule most firewalls use is deny-all, with explicit allow rules for permitted traffic.
  • Next-generation firewalls (NGFW) integrate application control, SSL inspection, and IPS.
  • Firewalls cannot protect against internal threats if traffic bypasses them or if rules are misconfigured.

How it works in practice

A company deploys a stateful firewall at its internet edge. Staff in the office must access a web-based CRM hosted at a SaaS provider. The firewall allows outbound TCP/443 (HTTPS) traffic from internal IPs to the CRM's public IP range. Inbound traffic is blocked by default except for a specific port forwarding rule to a public web server. The firewall tracks each HTTPS session: it permits return packets only if they match an established connection. An attacker sends unsolicited SYN packets to random internal ports; the firewall drops them because no corresponding outbound session exists. This example shows how stateful filtering blocks typical reconnaissance scans.

Related terms

Intrusion Detection System (IDS) Intrusion Prevention System (IPS) Virtual Private Network (VPN) Packet Filter Demilitarized Zone (DMZ) Access Control List (ACL)

References

More in Security

2FA

Two-factor authentication (2FA) is a security method that requires a user to present two distinct types of evidence to verify their identity, typically a password and a time-based one-time code from an authenticator app or hardware key.

Bot Management

Bot management detects automated web traffic and distinguishes it from human users, using behavioral fingerprinting and other signals to block malicious bots while allowing benign ones.

Credential Stuffing

Credential stuffing is a cyberattack in which automated tools use username-password pairs leaked from one site to try logging into other sites, exploiting password reuse.

DDoS

A DDoS (Distributed Denial of Service) attack overwhelms a target server, service, or network with massive traffic from many compromised computers, making it unavailable to legitimate users.

DDoS Scrubbing

DDoS scrubbing diverts attack traffic to a specialized filtering facility that removes malicious packets and forwards only legitimate traffic to the target network.

IDS

An Intrusion Detection System (IDS) monitors network traffic or host activity for signs of malicious behavior or policy violations and generates alerts for security personnel.

IPS

An Intrusion Prevention System (IPS) is a network security device that monitors traffic inline and actively blocks malicious packets before they reach their target.

OAuth 2.0

OAuth 2.0 is an authorization framework that allows a user to grant a third-party application limited access to their resources on another service without revealing their password.

OpenID Connect

OpenID Connect (OIDC) is an identity authentication layer built on OAuth 2.0 that provides a signed ID token containing verified user identity claims.

Passkey

A passkey is a FIDO2/WebAuthn credential stored on a user's device that replaces passwords with public-key cryptography for authentication.

Who Is Online

In total there are 67 users online: 0 registered, 59 guests and 8 bots.

Most users ever online was 5,555 on 17 Jul 2026, 3:23 am.

Bots: AhrefsBot Applebot Baiduspider Bingbot Other Bot Other Crawler PetalBot SemrushBot

Users active in the past 15 minutes. Total registered members: 369