Guides / Default deny

Firewalls

A packet that is not permitted does not enter. Host firewall and network firewall are the same idea at two places. 22, 80, and 443 are an example of an allow-list, not a universal rule.

Default-deny firewall: host versus networkDefault deny: a packet that does not match an allow does not enter. A host firewall is this machine; a network firewall is this segment. 22, 80 and 443 are an example allow-list, not a universal rule.HOSTHost firewallthis machineNETNetwork firewallthis segmentEXAllow-list22 / 80 / 443 — only if you need themDEFAULT DENY. A PACKET NOT PERMITTED DOES NOT ENTER.Host and network firewalls are the same idea at two places. You want both.Everything else is denied. Open a port because a named service requires it.

Default deny: a packet that is not permitted does not enter. A host firewall enforces that on this machine. A network firewall enforces it on this segment. You want both — they fail differently. 22, 80, and 443 are an example allow-list, not a universal rule. Open a port because a named service on a named interface requires it.

First principles

A firewall is a policy on packets. Default deny means the policy is empty until you write an allow. A packet that does not match an allow does not enter. Default allow with a list of blocks is the opposite idea wearing the same name: you are forever chasing what you forgot.

The network device cannot see a process binding to a port on the host. The host cannot see a neighbour you never meant to be on the same VLAN. They fail differently. That is useful.

Allow-lists are specific

22, 80, and 443 are a common example of an allow-list for a public Linux host that speaks SSH and HTTP(S). They are not a universal rule. A mail exchanger needs 25. A closed management network may allow 22 from a jump host only, and nothing from the internet. A workstation may allow nothing inbound. Copying someone else's ports is how you open 22 to the world by accident.

What an admin actually does

  • Default deny inbound on hosts and on the edge. Open a port because a named service on a named interface requires it.
  • SSH from the internet is a choice. If you do not need it, do not allow 22. Use a VPN or a cloud serial / console for the box.
  • Egress matters too. Workloads that never need to call the internet should not be able to. That is still default deny, facing out.
  • Document the allows with an owner and a reason. An allow without an owner is how ports live forever.

Informed by ASD's ACSC — ISM.