Foundation project

Project: a policy for a small office

Lesson 11 of 20 · 20 min · Module 3: Zones and policies

Write a complete policy from a brief, the way a change request reaches a firewall administrator.

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…

  • Turn a written brief into ordered rules
  • Combine internet access, a published server, and containment
  • Finish with a logged cleanup rule

The idea

This project combines the first three modules: precise rules, deliberate order, zones, containment, and logging. Read the whole brief before writing the first rule, and decide the order on purpose.

default deny
allow tcp from trust to untrust port 80,443
# ...
deny any from any to any log

01Sort the brief by direction

Group the requirements by source and destination zone: trust to untrust, trust to dmz, untrust to dmz, dmz to trust. Each group becomes one or two rules, and no group is forgotten.

02Place exceptions and denies deliberately

Decide where each deny has to sit. A deny that must override an allow goes above it. The cleanup rule goes last. Rules that do not overlap can be in any order, so group them for the reader.

03Check both what passes and what does not

Run the lab and read every line of the Output tab. Each test packet should be decided by the rule you intended, not by a different rule that happens to give the same verdict.

Your project brief

Write the policy. 1. trust may use the internet: tcp 80 and 443, and udp 53. 2. trust and untrust may both reach web on tcp 443. 3. admin may use SSH (tcp 22) to the dmz, logged. 4. The dmz may start nothing toward trust: an explicit deny, logged. 5. A logged cleanup rule comes last.

What the checks look for

  • The office uses the internet for web and DNS only
  • The website is reachable on 443 from the office and the internet, and nothing else is published
  • Administrator SSH to the DMZ is logged, and nobody else has it
  • A logged rule for the DMZ stops it from reaching the office
  • The internet cannot reach the office, and the attempt is logged
  • A logged cleanup rule is last
Try it in the editor →

Take this with you

A policy is a set of decisions about direction, service and order. Write it from the brief, then prove both halves: what passes and what does not.

Go a little further

Add a guest network 10.0.9.0/24 to the brief in your head: which zone would it be, and which single direction would you open for it?

Learn Firewall Foundations for free

20 short lessons with real code and instant checks.

See the whole course →