Change requests & rule placement
Add a service without breaking the rest
Lesson 18 of 20 · 12 min · Module 6: Put it together
Most firewall work is a small change to a policy someone else wrote. Where the new rule goes matters as much as what it says.
Start this lesson →Free. No installation: you write and run the code in your browser, and it is checked automatically.
By the end, you’ll be able to…
- Trace a new flow through an existing policy
- Choose the position for a new rule
- Confirm that existing behaviour is unchanged
The idea
A new rule has to be placed above every rule that would decide its traffic first, and it must not shadow anything below it. Before adding it, walk the new packet down the existing list and note the first rule it meets.
allow tcp from 10.0.5.7 to 10.0.6.20 port 1433 # the exception, first
deny any from 10.0.5.0/24 to 10.0.6.20 log # the general rule it limits
01Trace the new packet through the old rules
The request: the reporting PC 10.0.1.60 needs the database on tcp 5432. Walk that packet down the list. It meets "deny any from lan to db" first, because 10.0.1.60 is inside lan. A new rule placed below that line will never see the packet.
02Place the exception above the rule it limits
The new allow is an exception to the database deny, so it goes directly above it. It names one host, one server and one port, so it takes nothing else away from the deny rule.
03Verify like a change, not like a guess
After the change, three things must be true: the new flow works, the flows that worked before still work, and the traffic that was blocked is still blocked. The checks in this lesson test all three.
Your turn
reports, 10.0.1.60) needs the database db on tcp 5432. A colleague added the rule at the bottom, and it does not work. Move it to the right position. Do not change or remove any other rule.What the checks look for
- The reporting PC reaches the database
- Other PCs are still denied by the database rule, and logged
- Everything that worked before still works
- One rule was added, and the cleanup rule is still last
Take this with you
Trace the new packet through the existing rules, insert the rule above the first one that would decide it, then verify the new flow and the old ones.
Go a little further
Widen the new rule to "from lan" and run the lab to see what the database deny rule is left protecting. Then put it back.