Firewall in Cybersecurity — Quick Answer
A firewall is a network security device (hardware or software) that monitors and filters incoming and outgoing traffic based on predefined security rules. It establishes a barrier between a trusted internal network and untrusted external networks (typically the internet). Modern firewalls (NGFW) combine traditional filtering with deep packet inspection, intrusion prevention, and application awareness.
Types of Firewalls
| Type | How It Works | Best For |
|---|---|---|
| Packet-Filtering | Inspects packets by source/destination IP, port, protocol | Simple, fast — legacy use cases |
| Stateful Inspection | Tracks connection state; allows return traffic for established sessions | Traditional enterprise perimeter |
| Proxy (Application-Level) | Acts as intermediary; inspects at application layer (HTTP, FTP) | Content filtering, caching |
| Next-Generation Firewall (NGFW) | DPI, IPS, application awareness, user identity, SSL inspection | Modern enterprise networks |
| Web Application Firewall (WAF) | Protects web apps from SQLi, XSS, CSRF | Public-facing websites and APIs |
| Cloud-Native Firewall | AWS Network Firewall, Azure Firewall, GCP Firewall | Cloud workloads |
How Firewalls Work
- Packet inspection: Every packet entering or leaving the network is examined.
- Rule matching: The packet is matched against a set of rules (ACLs).
- Action: The firewall takes one of three actions — ALLOW, DENY, or DROP.
- Logging: Decisions are logged for audit and forensics.
Stateful firewalls add connection tracking — they know which packets belong to an established session and allow them through without re-checking every rule.






