# Secure Campus Testbed: One System for the Network, Its Security and Its Buildings

Written by [Taki Sadik](../../about) · Last updated 2026-11-28 · Status: code done, rehearsal measured (110 of 110 checks), Proxmox build next · 15 min read

A secure three-building campus shaped by National Defence's Secure Campus project, built as one system: department VLANs with 802.1X, two firewall cores that cover for each other, a remote-access VPN, an IDS and a SIEM that quarantine what they catch, and a facilities and physical security service that runs the buildings themselves. One file describes the campus, Ansible builds it, and a test suite breaks it on purpose and measures what happens.

## Overview

A campus is secure when three things hold at once: the right person, and only the right person,
        gets onto the right part of the network; anything that misbehaves is seen and contained; and the
        buildings themselves, their doors, sensors and plant, are watched and maintained. Most labs
        build one of those. This one builds all three as a single system and tests them together.

The campus is fictional: Kestrel Point, three buildings (headquarters with the server room, a
        secure operations building, and a support building with a clinic, a lab, a hangar, quarters, a
        utilities plant and a magazine). Thirty machines run it: two core firewalls, three building
        switches, workstations, door controllers, cameras, building sensors, servers, three remote VPN
        users and a simulated internet. Every one of them is configured from one file,
        campus/campus.yaml, so the firewall, the RADIUS servers, the IDS rules, the SIEM and
        the facilities database cannot disagree about who is allowed where.

Everything is in a repository:
        [github.com/TYFSADIK/secure-campus-testbed](https://github.com/TYFSADIK/secure-campus-testbed),
        with the renderer, the Ansible roles, the NAC agent, the campus-ops service, the device
        simulators, 31 unit tests and the rehearsal that produced every number on this page.

## The DND Project

From the public Defence Capabilities Blueprint catalogue. The extract I worked from lists this project by name and tags; it does not give an objective, funding range or schedule, so none is claimed here.

| Item | Public detail |
| --- | --- |
| Project | National Defence Secure Campus |
| Capability area | Real Property (INFRA) |
| Investment areas | Physical Security Systems; Office and Administrative Infrastructure |
| What this build takes from it | A secure, multi-building office campus: who and what may enter which buildings, rooms and networks, and how the facility is run and kept available |

## One System, 33 Register Entries

My project register gives about thirty Real Property campus projects the same five proposed
        requirements: define the facility's zones, users and assets; model rooms, assets, maintenance,
        inspections and access events; run an asset register, work orders, an inspection schedule and a
        dashboard; add role-based access, audit, backup, availability and safety checks; and test
        outages, the work-order lifecycle, access control and restore. Building that thirty times would
        prove nothing new each time. So the campus meets it once, and each kind of building is a
        facility profile: the inspections, environmental limits and access rules of an office,
        a server room, an operations floor, a clinic, a lab, a hangar, quarters, a utilities plant or a
        magazine.

| How it is covered | Register entries |
| --- | --- |
| Directly, the whole campus | #89 National Defence Secure Campus |
| Network access control and the CIS server room | #41 Construct New Communications and Information Systems Building, Petawawa (tagged Access Management Systems) |
| Secure operations profile (doors, two-person room, intrusion tests) | #72 Joint Task Force 2 Infrastructure; #25 CSOTC Petawawa; #56 Future Combined Aerospace Operations Centre; #94 New Quick Reaction Area, Bagotville; #23 CJIRU Trenton |
| Office profile | #1 21 EW Regiment, Kingston; #34 2 Service Battalion HQ, Petawawa; #36 CAF TC Edmonton; #51 Edmonton Strategy; #33 MFRC Petawawa |
| Health profile (vaccine fridge limits, medical gas) | #38 Bagotville, #61 Gagetown and #62 Valcartier health services centres |
| Laboratory profile (fume hoods, eyewash) | #39 DRDC ORC; #66 DRDC Valcartier renewal; #53 Energetic Materials Test Lab; #93 Neurobehavioral Facility, Suffield |
| Hangar and workshop profile | #2 427 SOAS hangar; #4 436 Squadron; #9 AFEC main facility; #35 Ammunition Workshop; #110 Refueling Tender Garage |
| Accommodation profile | #10 AFEC mess; #37 Cambrai Rd quarters; #73 JNCM accommodation, Esquimalt; #40 Yellowknife multi-purpose building; #106 North Park Armoury |
| Utilities profile (mains loss, generator, boiler) | #59 Halifax heating; #111 underground electrical distribution; #105 19 Wing roads and utilities |
| Magazine profile | #104 Recap Magazine Area, Dundurn |

Seven Real Property entries are left out because their work is civil engineering rather than a campus building: jetties, a runway, a remote naval facility, a fighter infrastructure programme, a diving unit, a school relocation, and Camp Sustain, which is a deployable camp. The list is generated from a YAML file in the repository, so it cannot drift from the code.

## Target Design

| Need | Testbed component | Design requirement |
| --- | --- | --- |
| Three-building topology | containerlab (rehearsal), Proxmox (build) | 30 nodes wired only by lab links, no management back door around the cores |
| Department VLANs | 14 VLANs, 802.1X | People get their department's VLAN wherever they plug in; device VLANs per building |
| Inter-VLAN routing | Collapsed core, keepalived, STP | Two cores share every gateway; either can carry the whole campus |
| Firewall policies | nftables; OPNsense config for the Proxmox option | Default deny, every allowed flow listed once, drops logged |
| 802.1X | hostapd, NAC agent, FreeRADIUS x2 | PEAP with server certificate checks, MAB bound to ports, quarantine and guest fallback |
| VPN | WireGuard on both cores | Three user groups with their own rules; survives a core failure |
| Monitoring | Suricata, Wazuh, NFLOG | Campus rules, correlation, automatic quarantine on both cores, incidents in campus-ops |
| Facilities and physical security | campus-ops (FastAPI, PostgreSQL), door and sensor simulators | Assets, profiles, alarms, work orders, inspections, door control, audit, backups |
| Automation | Ansible | Every node, idempotent, the same roles for the rehearsal and Proxmox |
| Tested recovery | Rehearsal suite | Segmentation, failover, restore, all measured by probes inside the endpoints |

## The Campus

| VLAN | Name | Who | May reach |
| --- | --- | --- | --- |
| 10 | MGMT | Switches, network admins | RADIUS, DNS, syslog to Wazuh |
| 20 | STAFF | Administrative staff | campus-ops, DNS, the web |
| 30 | OPS | Secure operations | campus-ops and DNS only, no internet |
| 40 | HEALTH | Clinic | campus-ops, DNS, HTTPS only to the internet |
| 50 | LAB | Laboratory | campus-ops, DNS, the web |
| 61-63 | BMS, one per building | Air handlers, meters, fridges, generator | campus-ops only |
| 71-73 | PHYSEC, one per building | Door controllers, cameras | campus-ops, syslog to Wazuh |
| 80 | GUEST | Visitors on lobby ports | The internet only |
| 100 | SERVERS | campus-ops, database, RADIUS, Wazuh | Each other, the web for updates |
| 999 | QUARANTINE | Anything not authenticated | Nothing: no gateway, never on a trunk |

Device VLANs are per building so a door controller in one building can only meet a device in another through the firewall, and device ports on the same switch are isolated from each other. VPN users get their own address ranges: remote staff reach campus-ops, the HVAC contractor reaches building management on HTTPS and Modbus, network admins reach management and servers.

## Plugging In: 802.1X and MAB

Every access port starts in quarantine. A person logs in with 802.1X (PEAP, and the laptop
        only trusts the campus CA and the RADIUS server's name, so a fake switch cannot harvest
        passwords). RADIUS answers with the VLAN of that person's department, so the VLAN follows the
        person to any port in any building. Devices that cannot do 802.1X, door controllers, cameras and
        sensors, are checked by MAC address against the asset register, and each entry only matches on
        the switch port the register puts that device on.

One piece had to be written: hostapd, the Linux 802.1X authenticator, can read the VLAN from
        RADIUS but cannot apply it to a port of a VLAN-aware bridge. A small NAC agent on each switch
        relays hostapd's RADIUS packets unchanged, so the cryptographic checks still hold, moves the port
        into the right VLAN before hostapd sees the reply, fails over between the two RADIUS servers,
        runs MAB, and reports a MAC that appears on two ports at once.

## Segmentation and the Firewall

The policy is a short list in the campus file: who may reach what, on which ports. The renderer
        turns it into the nftables ruleset both cores run, into an OPNsense configuration for the Proxmox
        option, into a policy table for the documentation, and into a test matrix of 267 probes from 15
        real endpoints: every allowed flow must pass and every other must be blocked. Every probe target
        runs a listener, so "blocked" means the firewall stopped it, not that nothing was there.

The two cores share every gateway address with VRRP and form one spanning tree; each building
        switch has an uplink to each core. DHCP runs on both with split pools and identical reservations.
        A drift check compares each core's live ruleset with the one Ansible loaded, and Ansible puts it
        back if someone changes or wipes it.

## Detection and Response

Suricata runs on both cores with campus rules: scans and admin or database ports from device
        VLANs, guests probing the campus, a blocked domain, scanner tools, every Modbus write to a
        building controller, database connections from outside the server VLAN. Wazuh reads those alerts,
        the firewall's drop log, every RADIUS decision, and syslog from the switches and doors, and
        correlates them: five failed logins on one port, a MAC on two ports, one badge refused three
        times. A level 10 alert puts the source address in a set both cores drop for ten minutes and
        opens an incident with a P1 work order in campus-ops, linked to the asset that owns the address.

## The Buildings: campus-ops

campus-ops is the facilities and physical security side: an asset register of 30 assets, zones
        with their profiles, people with roles and badge clearances, sensor readings checked against each
        profile's limits, work orders, inspections, door events and security incidents. Every change goes
        into a hash-chained audit log, and the database is backed up every two minutes to a store in the
        second building.

- Alarms: a vaccine fridge above 8 °C, a boiler over pressure, a device silent for 30 s, mains lost with the generator not starting within 20 s. Each opens a work order, P1 when the limit or the asset is critical.

- Work orders: open, assigned, in progress, completed, verified, closed. Only the assignee works an order, a completion needs a note, and whoever completed it cannot verify it. Contractors see only their own orders, only in the zones they are cleared for.

- Doors: controllers sync an access list every 10 s and decide at the door, by clearance, opening hours and the two-person rule for the secure room and the magazine, so doors keep working if campus-ops or the network is down. Events are numbered, queued and delivered exactly once.

- Inspections: scheduled from the profiles (fire suppression, UPS, fume hoods, generator runs, lightning protection); overdue ones become work orders and a failed one opens a corrective order.

## Measured Results

The final run, on a lab rebuilt from scratch: 110 of 110 checks in eight scenarios, about 18
        minutes. Outages are measured by endpoints that probe every 0.2 seconds during each failure.
        These numbers come from the rehearsal on a laptop; the Proxmox build will be measured with the
        same suite.

| Measured | Result |
| --- | --- |
| Segmentation | 267 probes from 15 sources (27 allowed, 240 blocked): 0 mismatches. Probing the blocked ports got 11 of the probers quarantined by the IDS |
| 802.1X login to VLAN | 1.4 s, and about 1.7 s more for the DHCP address |
| RADIUS failover | Login through radius-2 in 4.0 s; with both down, new logins fail closed and logged-in users keep working |
| Cloned MAC | Same switch: caught in 5 s, Wazuh level 12, real device unaffected. Another switch: refused by MAB |
| Rogue switch claiming STP root | Port disabled by BPDU guard, campus root unchanged |
| Door controller scanning servers | Suricata 0.08 s, Wazuh 1.8 s, quarantined on both cores 1.8 s, incident and P1 work order 2.2 s |
| Doors with campus-ops stopped | 20 swipes decided at the door; all 20 events delivered exactly once in under 0.1 s once it was back |
| Badge suspended | Refused at the door 1.1 s later |
| Vaccine fridge out of range | Critical alarm and P1 work order in 1.3 s |
| Core power loss, and return | 8.8 s for every building (15 s for a VPN user); 6 to 8 s on return |
| Building uplink cut | 8.0 s (802.1D spanning tree) |
| Firewall wiped on the active core | Drift detected; restored by Ansible in 27 s |
| Database dropped | Restored from building 2 in 4.7 s, row counts and audit chain verified |
| SIEM down 60 s | Agent events delivered after restart; UDP syslog from switches and doors lost |
| Audit tampering | One edited row in the database: verification names that row |
| Ansible | A second full run over 30 hosts changes nothing |

## What the Tests Found

The suite ran about twenty times while the lab was built. Most failures were in the tests; these were in the campus, and two of them would bite a real one:

| Fault | Why | Fix |
| --- | --- | --- |
| Losing a core took 38 s instead of 9 | The standby core announced the gateway addresses while the building switches were still in spanning tree's listening and learning states; the announcements were dropped and clients kept the dead core's MAC until their ARP entries expired | keepalived repeats its gratuitous ARP every 2 s while master |
| VPN users did not follow a failover | WireGuard peers move to the source address of the server's packets; the cores answered from their own addresses. Source NAT fixed the address but, clashing with the peer's own connection entry, could change the port | WireGuard bypasses connection tracking and its source address is rewritten statelessly; the tests check address and port |
| A cloned MAC knocked the real door controller offline | The agent quarantined whichever port changed last | The port where the MAC is already authorised keeps it |
| A healthy door controller was quarantined | Its HTTPS retries to campus-ops looked like a SYN sweep | The sweep rule leaves out the service port |
| Every 802.1X login was rejected at first | FreeRADIUS could not write its JSON log, and the failing log call turned each Accept into a Reject | The log file is created for the RADIUS user first |
| One lost badge opened six P1 work orders | Door incidents were not merged | Repeats within 10 minutes count on one incident |

## How to Build It

### Rehearse first (Docker with 5 GB, about 15 minutes to build)

git clone https://github.com/TYFSADIK/secure-campus-testbed && cd secure-campus-testbed
./local/rehearse.sh up      # render, build two images, deploy 30 nodes, run Ansible
./tools/nac-status.sh       # every access port: VLAN, method, user
./local/rehearse.sh test    # 8 scenarios, about 18 minutes, then results/run-N/
./local/rehearse.sh down

### Then the Proxmox build

./proxmox/create-lab.sh apply   # on the host: one bridge per lab link, 30 LXC containers
./proxmox/bootstrap.sh          # packages through a temporary NIC, removed afterwards
KP_TARGET=proxmox KP_PVE_HOST=pve python3 tools/render.py
ansible-playbook ansible/site.yml   # the same roles, over pct

To change the campus, edit campus/campus.yaml and run Ansible again: a new person, device, VPN user, allowed flow or kind of building is one entry, and the renderer refuses a campus with errors.

## Spec-Gap and Status Table

| Capability | Status |
| --- | --- |
| 802.1X, MAB, quarantine, guest, BPDU guard | Measured in the rehearsal |
| Segmentation and firewall policy | Measured in the rehearsal (267 probes) |
| Core, uplink and RADIUS failover | Measured in the rehearsal |
| WireGuard VPN with failover | Measured in the rehearsal |
| IDS, SIEM, active response, incidents | Measured in the rehearsal |
| Facilities, doors, work orders, inspections, audit, backup and restore | Measured in the rehearsal |
| Proxmox build | Written; not yet run |
| OPNsense core (CARP pair) | Configuration rendered; not yet booted |
| Wazuh indexer and dashboard | Proxmox build only |
| Rapid spanning tree (sub-second uplink failover) | Not in the Linux kernel; real switches or mstpd |
| Real door hardware | Simulated |

## Safety Notes

## Frequently Asked Questions

**Q: What is the National Defence Secure Campus project?**

A: It is a Real Property (infrastructure) project listed in National Defence's Defence Capabilities Blueprint, tagged with the investment areas Physical Security Systems and Office and Administrative Infrastructure. The public catalogue extract this build works from gives its name and tags, not a technical specification.

**Q: Is this build part of the DND project?**

A: No. It is an independent, personal research build on a fictional campus. It is not affiliated with, funded by, or submitted to DND or the CAF, and it models no real site, system or standard.

**Q: Why one system instead of separate projects?**

A: The register proposes the same five requirements for about thirty Real Property campus projects: zones and an asset register, work orders and inspections, access events, role-based access with audit and backup, and outage and restore tests. One campus with a facility profile per kind of building meets them once, and the network and security around it are what a secure campus needs anyway.

**Q: Which tools does it use?**

A: hostapd and FreeRADIUS for 802.1X, my own NAC agent for dynamic VLANs and MAB, nftables (and an OPNsense configuration for the Proxmox option), keepalived for VRRP, dnsmasq, WireGuard, Suricata, Wazuh, PostgreSQL and a FastAPI service for facilities, Ansible for every node, and containerlab for the rehearsal.

**Q: What has been measured?**

A: Everything in a rehearsal of all 30 nodes on one machine: 110 of 110 checks, a 267-probe segmentation matrix with no mismatches, 1.8 seconds from a scan to quarantine on both cores, an 8.8 second outage when a core firewall loses power, and a 4.7 second database restore from another building. The Proxmox build is written but not yet run.

## Related Builds

- Secure Campus Testbed source code, everything behind this page.

- ICAM Testbed, identity, MFA and badge access in depth; this campus uses simpler tokens and points there for identity.

- CD-DAR Testbed, the AI-assisted SOC that would sit on top of a campus like this one.

- ITI C2 Testbed, the same habit of breaking things and measuring them, across three sites.

- Net C2 ISAC Testbed, IT service health turned into mission impact.

- Canadian Defence Hardware Program, the hub page for all of my defence builds.

## What Happens Next

- Next: the Proxmox build, then the same eight scenarios, published here next to the rehearsal numbers.

- Then: an OPNsense CARP pair in place of the Linux cores, with the same policy, and the Wazuh indexer and dashboard.

- Later: one real managed switch with 802.1X and a real door reader, so a building is partly physical.

## Cite This Page

**Q: Citation formats**

A: Plain text
