FIREWALLS
Stateful Firewall Policy Design Playbook
Design zones, rules, logging and stateful inspection so security policy follows business flows instead of becoming a pile of undocumented permits.
Start with flows, not rules
Write down who needs to talk to whom, on which service, and why. A useful policy statement looks like "Staff VLAN may reach the accounting application on TCP 443" rather than "permit 192.0.2.0/24 any". The first statement is understandable months later.
Stateful inspection
A stateful firewall tracks permitted sessions. Cisco's Zone-Based Firewall documentation distinguishes inspected traffic, which creates state in the firewall connection table, from simple pass behaviour. Return traffic for an inspected session can be recognised as part of that connection rather than needing a broad reverse rule.
Zone design
- Group interfaces or networks with similar trust and policy requirements.
- Examples include Users, Servers, Cameras, Guest, Management, Voice and Internet.
- Do not create zones only because VLANs exist. Create them where policy boundaries are useful.
- Document which traffic is expected between every pair of zones.
Cisco's zone firewall model defaults inter-zone traffic to deny until an explicit policy is applied. That is a useful mental model even on other firewall vendors: start from required flows, not broad access.
Rule design
- Name the business purpose.
- Use the narrowest practical source group.
- Use the actual destination service or server group.
- Specify protocol and destination port.
- Choose stateful inspection/allow or deny.
- Log denials and important allows where operationally useful.
- Add an owner and review date in documentation.
What works
- Object groups for maintainable policy.
- Specific rules above general rules.
- Logging at security boundaries.
- Separate management policy from user policy.
- Regular review of unused rules and objects.
What fails in the real world
- Adding temporary "any-any" rules and never removing them.
- Publishing a server with NAT but forgetting the firewall rule.
- Assuming NAT itself is a security policy.
- Allowing users directly to infrastructure management interfaces.
- Changing firewall, routing and NAT simultaneously during troubleshooting.
Acceptance test
Test required traffic, forbidden traffic and return traffic separately. Save rule-hit counters and logs for the test window. A successful ping alone does not prove the required application flow works.
Build a policy matrix before the firewall
Create a worksheet with source zone, destination zone, service, business owner, logging requirement and change ticket. This turns firewall configuration into implementation of an agreed design rather than live experimentation.
| Source | Destination | Service | Purpose | Action |
|---|---|---|---|---|
| Staff | DNS servers | DNS | Name resolution | Inspect/allow |
| Cameras | NVR | Vendor-required ports | Recording | Inspect/allow |
| Guest | Internal management | Any | No business requirement | Deny/log |
Policy troubleshooting
When an application fails, prove routing and server listening state first. Then generate one test flow while watching firewall hit counters or session logs. A log showing the packet denied on the first SYN is different from a session established and then closed by the server.
NAT order of operations
Policy engines differ in whether rules display pre-NAT or post-NAT addresses. Document the platform behaviour. A rule written against the wrong address side can look correct to a technician and still never match.
Asymmetric routing
Stateful firewalls expect to see enough of the connection to maintain state. If forward traffic crosses firewall A and return traffic crosses firewall B, sessions can fail unless the architecture explicitly supports state synchronisation or asymmetric routing. Check the return route before adding broad permits.
Rule lifecycle
- New rule: owner and change reason.
- Temporary rule: expiry date.
- Unused rule: investigate before deletion.
- Changed application: update ports and documentation.
- Decommissioned server: remove NAT, DNS, objects and policy together.
Technical references
Use the current project specification and the exact product documentation for the installed equipment. These references support the technical principles used in this guide.