Bitzu

CPSA ยท Network protocols and filtering

Reviewing a firewall rule base or ACL

Rule order, implicit deny, overly broad any-any rules, shadowed rules and stateful vs stateless filtering.

Key points

  • Rules are checked top to bottom and the first match wins, so order matters.
  • No match: default policy or implicit deny.
  • Look for: any-any permits, overly broad rules, shadowed rules (unreachable behind an earlier broader rule), missing logging.
  • Stateless filter: judges each packet alone, needs rules both ways.
  • Stateful firewall: tracks connections, lets return traffic through automatically.

Source: https://man7.org/linux/man-pages/man8/iptables.8.html

Practice questions

Single choice

What happens to a packet that matches none of the rules in a chain whose default policy is DROP?

  1. It is accepted because no rule blocked it
  2. It is dropped by the chain policy
  3. It is logged and then accepted
  4. It is returned to the sender with a RST
Show answer

Answer: B. It is dropped by the chain policy

A packet that reaches the end of a built-in chain meets the chain policy, so with DROP it is discarded. It is not accepted by default or sent to the next rule, because none remains.

Select all that apply

Which findings in a rule base are worth reporting as weaknesses?

  1. A permit any any rule above stricter rules
  2. A deny rule hidden behind an earlier broader permit
  3. SSH or telnet to a firewall allowed from any source
  4. A final deny-all rule with logging
  5. Specific rules placed above general ones
Show answer

Answer: A. A permit any any rule above stricter rules, B. A deny rule hidden behind an earlier broader permit, C. SSH or telnet to a firewall allowed from any source

An any-any permit, a shadowed rule and a management service open to every source are all weaknesses. A final deny-all and specific-before-general ordering are good practice, not findings.

True or false

True or false: the order of rules in a firewall rule base does not affect the outcome, because every rule is evaluated before a decision is made.

Show answer

Answer: False

False. Most firewalls and ACLs stop at the first matching rule, so a broad rule placed early can override or shadow narrower ones below it.

Practice 8 questions on this topic in Bitzu

Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.

Download on the App StoreGet it on Google Play

More CPSA topics in this module