← Network Security tutorial

Network Security

Firewalls, Deeper Than the Basics

Cybersecurity Fundamentals introduced firewalls as traffic rules. Here's what a rule actually looks like, and the one distinction that matters most: stateless vs stateful filtering.

A stateless firewall checks each packet in isolation against its rule list, every single time, with no memory of what came before. A stateful firewall tracks active connections, so once it's allowed the first packet of a legitimate connection, it automatically allows the return traffic for that same connection without re-checking every rule. Almost every modern firewall, including the one built into your OS, is stateful, it's both faster and more secure, since it can spot traffic that doesn't belong to any connection it actually opened.

Example
# A typical stateful firewall rule, in a common plain-English style:
ALLOW   tcp   port 443   from any           # let HTTPS traffic in from anywhere
ALLOW   tcp   port 22    from 10.0.0.0/24   # SSH, but only from this internal network
DENY    all   all        from any           # block everything else by default
Output
The order matters: rules are usually checked top to bottom, and the first match wins. That final DENY-all rule is called a default-deny policy, explicitly blocking anything not already allowed above it, rather than hoping nothing dangerous was missed.
Ready to go further?

These free tutorials are a preview, our Cybersecurity cohort covers it in depth, with a real project and a cohort alongside you. Closes Nov 30

Enroll in Cybersecurity

Cookie preferences

Choose what you're comfortable with. You can change this any time from the footer.

Don't miss out

Ready to build something real?

Create a free account to enroll in a track, and get notified the moment a cohort opens.

Create free account