LOGBOOK

HELP

Quiz Entry - updated: 2026.11.26

What is a cleanup rule at the end of a firewall rulebase, and how do rule hit counts help keep a rulebase clean?

The cleanup rule is the last rule: Any → Any → Drop (usually logged), so anything not explicitly allowed is blocked and visible in the logs. Hit counts show which rules never match, which are candidates for removal.

A firewall rulebase is read top to bottom, first match wins. The last rule is therefore the default for everything nobody thought of. Best practice is to make that default explicit: a cleanup rule that drops all remaining traffic and logs it. Without a log you would not notice when something legitimate gets blocked; with it, a log line like "domain-udp traffic dropped from an internal host to 8.8.8.8, rule: Cleanup rule" tells you exactly which allow rule is missing.

Over the years rulebases collect rules nobody dares to delete. Hit counts (show_hits: true in the API) answer "does this rule still match anything?":

  • a rule with 0 hits over a long period is probably dead (old server, finished project), or completely shadowed by a broader rule above it;
  • a rule with very many hits that is very broad ("Any" service) is a candidate for tightening.

Pulling the rulebase with hits via Ansible turns this review into a repeatable report instead of a manual click-through.

Go deeper:

From Quiz: ITIA / Network Automation with Ansible and a Check Point Firewall | Updated: Nov 26, 2026