skip to content

The Ageing Rulebase

A rulebase decays as permits are granted wider than asked, kept because nobody can prove them dead, or left unreachable behind an earlier match. Interviewers use it to find people who removed one.

on this pageshow

explore

questions

12

In an ordered firewall policy, a broad permit sits above a deny naming the same traffic — what reaches the server, and what does the deny still claim?

level: juniorimportance: must knowfreq 72%

answer

  1. Order decides, not intent
  2. Unreachable code, but in a policy
  3. A rule that never matches never logs
  4. The deny on the page is not evidence

basics

~20 s

The traffic arrives. The earlier permit decides and the deny below it is never evaluated. The deny still sits in the policy, still reads as an enforced control in review and audit, and never logs anything.

solid answer

~50 s

The packet is permitted. In an ordered policy the earlier rule decides, so the deny is unreachable text — the policy's author, a reviewer and an auditor all read a control that is not in effect. That asymmetry is the whole danger: a shadowed *permit* is found in hours because the requester's flow breaks and someone raises a ticket, while a shadowed *deny* produces no symptom at all. It never matches, so it never increments a counter and never writes a log line, and the permitted traffic looks like ordinary allowed business traffic in whatever logging exists. An intruder with a foothold does not need to defeat the control; they ride a path the policy claims is closed. Nothing in day-to-day operations will surface it — you only see it by reading the whole ordered policy at once and asking which rule wins each region of the match space.

go deeper

for a junior

Be ready to say plainly that the earlier rule decides and the later deny never runs, and that such a rule produces no log and no counter. Do not reach for a specificity or precedence rule that does not exist here.

for a middle

Explain why the failure is silent: an unreachable permit breaks somebody's flow and gets reported, an unreachable deny fails open with no symptom. Be able to say what evidence a zero counter does and does not carry.

for a senior

Show that you would find these by reading the exported policy as a whole rather than waiting for an operational signal, and that you treat a deny rule in an export as a claim to be verified, not as evidence of a control.

for a principal

Own the consequence for assurance: if a deny that was presented as a control turns out to be unreachable, the control was not in effect for that period, and your evidence process has to produce analysis output rather than rule text.

## The shape of the problem A classical firewall policy is an ordered list of rules, and the first rule whose match criteria cover a packet decides its fate. That much is mechanics. What matters here is the consequence at the scale of a real rulebase: a rule's effect is not a property of the rule, it is a property of the rule *plus everything above it*. When an earlier rule's match set completely covers a later rule's match set and the two carry different actions, the later rule can never fire. It is unreachable — dead text in a live document. The security-relevant case is a broad **permit above a specific deny**: ``` 20 permit 10.0.0.0/8 -> 10.5.0.0/16 tcp/3389 (added during migration) ... 90 deny any -> 10.5.0.0/16 tcp/3389 (written years earlier) ``` Rule 90 will never match a packet as long as rule 20 stands above it. The remote-desktop path into 10.5.0.0/16 that rule 90 exists to close is open to everything in 10.0.0.0/8. ## Why it is a security artefact and not just untidiness Three separate people are misled by the same page. - **The author.** Somebody wrote rule 90 deliberately, for a reason they could defend. They believe that path is closed. Their threat model, their segmentation diagram and their design document all assume it. - **The reviewer.** The permit that shadowed it arrived on its own ticket, correct in isolation and approved on its merits. - **The auditor.** A deny rule in an exported policy is routinely accepted as evidence of a control. Here it is evidence of nothing. And the fourth party is the one that turns this from a documentation defect into an incident: an intruder who already has a foothold somewhere inside 10.0.0.0/8 does not have to defeat the boundary. They enumerate what actually answers, find the path, and use it. The control was never in their way. Post-incident, the defender's own policy export argues that the traffic could not have happened. ## Why nothing raises it The usual operational signals are all silent by construction: | Signal | What it shows for a shadowed deny | |---|---| | The rule's own hit counter | Zero — it never matched | | Deny logging | Nothing — a rule that never matches never logs | | The permitted traffic's logs | Ordinary allowed traffic, indistinguishable from business flows | | The change ticket that caused it | One new permit, correct on its face | There is no alarm to miss. Note the direction of the claim carefully: a zero hit count on a deny is **not** evidence that the traffic is being blocked. Traffic that is blocked *matches* the deny and increments it. Zero means either nobody tried, or the rule is unreachable — and from the counter alone you cannot tell which. ## The asymmetry that matters Order faults come in two flavours and they behave completely differently in production: - A **permit** that is shadowed (by an earlier deny, or by an earlier permit with different treatment) has a loud failure mode. The person who requested the flow finds it broken and complains the same day. - A **deny** that is shadowed has no failure mode. It fails open, silently, forever, and the only party who benefits is someone you do not want. This is why interviewers ask about this and not about first-match evaluation in the abstract: the mechanics are simple, the consequence is not intuitive, and the failure is invisible to everything except a deliberate reading of the whole policy. ## What actually finds it Not a person reading a diff, and not the appliance — accepting a rule that some earlier rule makes unreachable is not an error condition, and the box will take it. It is found by whole-ruleset analysis: export the ordered policy, decompose the multi-dimensional match space (source, destination, port, protocol, zone) into disjoint regions, and for each region ask which rule wins. Any rule that wins no region at all is unreachable. That computation is offline and static — it needs the policy, not the traffic — which is exactly why it is available to you and also why it is easy to never run. ## The price Running that analysis on a rulebase of several thousand rules does not return one finding. It returns thousands, spread across several anomaly classes, most of which are not security defects. Detection is cheap here; deciding what to do with the output, and finding an owner for rules whose authors left the company years ago, is where the cost lands. That is the trade this leaf turns on: the control is easy to prove broken and expensive to prove safe to fix.

  • Does it matter whether the permit was added before or after the deny was written?
    No — the fault is positional, not chronological. A permit added last week near the top of the policy can silently kill a deny written five years earlier and never touched since. That is what makes it hard to attribute: the change that created the exposure looks nothing like the rule it disabled.
  • Why does nobody notice from logs?
    Because there is nothing to notice. The shadowed deny never matches, so it produces no log line and no counter movement. The traffic it should have stopped is handled by the permit above and appears, wherever it is logged at all, as ordinary allowed traffic. Silence here is indistinguishable from success.
  • Is a deny sitting below a broader permit always a defect?
    It is always dead — the deny cannot act. Whether that matters depends on what it names. Some were copied in as documentation, or as defence in depth against a rule that has since moved. The real problem is that nothing on the box tells you which kind you are looking at, so every one has to be read by a person.

It is unreachable code with a security label on it: the compiler is happy, the line reads correctly in review, and it never runs.

saying these in an interview costs you the question

  • Says the deny wins because deny is stronger than permit
  • Thinks the more specific rule wins regardless of position
  • Assumes the appliance warns when a rule becomes unreachable
  • Reads a zero hit count on a deny as proof traffic is being blocked
  • Believes the later rule refines or narrows the earlier one

context

open as a page

Why is the wide firewall permit opened at 02:00 to end an outage still an intruder's route in two years later?

level: juniorimportance: must knowfreq 68%

basics

~20 s

An emergency permit survives because nothing removes it: the change was recorded as an outage fix rather than as a permit with an end date and a named owner, and later nobody can prove that deleting the rule is safe.

open as a page

Every firewall change passes per-ticket diff review, yet a shadowed deny let an intruder through — what does the diff never show, and what would catching it cost?

level: middleimportance: must knowfreq 58%

basics

~20 s

A diff shows one rule; reachability is a property of that rule's position against every other rule. Nothing in the ticket contains the rest of the ordered policy, so catching it means re-analysing the whole policy on every change.

open as a page

Why can a firewall rule's zero hit count mean neither that the flow is dead nor that the reach is closed?

level: middleimportance: must knowfreq 66%

basics

~20 s

A counter can read zero because a broader permit above it matched the traffic first, or because the counter was reset by a reboot or failover. Deleting a shadowed rule closes nothing; the reach lives in the rule above.

open as a page

What does an intruder inherit from a decade-old firewall permit that nobody can prove is dead?

level: juniorimportance: should knowfreq 58%

basics

~20 s

Reach. A permit is an enforced path from a source to a destination and port, so anyone who lands on the source side crosses it without attacking the firewall, filing a change, or raising an alert.

open as a page

Adding a vendor subnet to a firewall object group at 02:00 ends the outage: what else did it open to an intruder in that subnet?

level: middleimportance: should knowfreq 45%

basics

~20 s

Every rule that references that object group. Group membership is not scoped to the rule you were fixing, so a one-line change widens paths the change record never names — and deleting that rule later leaves the group member behind.

open as a page

Whole-policy analysis of a migrated firewall rulebase returns thousands of findings — which can an intruder actually use, and what happens to a backlog you cannot staff?

level: seniorimportance: should knowfreq 46%

basics

~20 s

Anomaly count is not risk count. Only one class means the policy permits what its author believes it denies: a deny made unreachable by an earlier permit. Rank those by what the deny names; record the rest as accepted rather than working them.

open as a page

300 emergency firewall permits never expired and each is a standing way in: how do you switch them to expiry-by-default without dropping a live clinical workflow?

level: seniorimportance: should knowfreq 52%

basics

~20 s

In two stages. First attach expiry dates and enforce nothing, publishing what would drop and when so each flow gets claimed by a named person. Then enforce in waves, lowest blast radius first, never letting a clinical path lapse unannounced.

open as a page

How long must you watch a plant boundary firewall's rule counters before deleting, and what does waiting leave open?

level: seniorimportance: should knowfreq 48%

basics

~20 s

Long enough to span the rarest legitimate flow, which at a plant is annual — the shutdown maintenance window, a vendor commissioning visit, a yearly test. Meanwhile every unproven permit stays enforced, so watch selectively rather than uniformly.

open as a page

Hundreds of denies in a migrated rulebase are unreachable and an intruder can ride them, but their owners have left — what do you fund, and what do you accept?

level: principalimportance: nice to knowfreq 34%

basics

~20 s

Ask for a decision, not a tool. Detection is already solved; triage capacity and rule ownership are the constraints. Seek a named owner, an announced maintenance sequence, and authority to break unowned flows — then record what stays open as accepted.

open as a page

Firewall expiry-by-default creates a quarterly renewal review nobody will fund, and each un-renewed permit stays an intruder's route in: what do you propose?

level: principalimportance: nice to knowfreq 33%

basics

~20 s

Make renewal rare rather than free. Tier expiry by blast radius so only wide cross-zone permits face human renewal, shrink the population that qualifies, and if even that is unfunded, make a named senior owner sign for the standing exposure.

open as a page

A plant manager refuses to sign any firewall rule deletion. How do you still retire reach an intruder could inherit?

level: principalimportance: nice to knowfreq 34%

basics

~20 s

Change what the plant manager is being asked to approve: reversible disables at a time he chooses, owners claiming the rules they need, narrowing where deletion is refused, and the residual exposure escalated to whoever owns both risks.

open as a page