One infected laptop
I recently had to deal with an infected personal laptop belonging to a VPN user. This was a fairly unpleasant way to get a practical test of the network segmentation. The useful part was that the segmentation and isolation already in place prevented the infection from spreading through the network.
A VPN connection does not make the computer at the other end trustworthy. It gives that computer a way in, and the firewall rules decide how much of the network it can reach once it gets there. That distinction matters quite a bit when the computer is somebody’s personal laptop.
It also gave me a reason to go back through the rules. I already had VLANs. The follow-up was going through what each group of devices actually needed to talk to, then making the rules say that more precisely. That segmentation and port, service and IP lockdown is now complete. OpenCanary and the Wazuh rollout followed the incident; the existing segmentation and isolation were what contained it.
The VLAN is only part of it
Putting devices on different VLANs is a useful start. The firewall rules between them are what make that separation useful. I have now finished the additional segmentation and locked down the permitted traffic by IP address, port and service.
VPN users were already restricted to working through their office PCs. They did not have direct access to the NAS and printer. The bigger change was for on-site users: those workstations used to share a VLAN with them. The NAS is now on its own VLAN, and the printer is on another.
That means access from the user network to storage or printing now crosses a firewall boundary where I can control exactly what is allowed. Before, devices sharing the same subnet could communicate without those connections going through pfSense. Host firewalls and client isolation still matter for devices that remain together on a VLAN.
Remote Desktop has a limit too. Once a user is working on the office PC, that PC’s permissions and network access matter. The VPN restrictions, the rules around the office PC, file permissions and protected backups all have their own jobs to do.
Making “allow” mean something specific
This meant spending a fair amount of time in the less exciting part of pfSense: rule order, aliases, source networks, destination IP addresses and ports. I narrowed the allowances to the services that were actually needed and checked that an earlier, broader rule did not undo the restriction.
A rule called “allow printers” is easy enough to understand. Allowing the required printing service to one printer is more precise than allowing everything to a whole network. The same goes for storage: access to the NAS does not need to mean access to every service it offers. Every unnecessary service I stop exposing is one less thing an infected machine can try.
The lockdown is complete, although keeping user access working now takes considerably more effort. Something that used to work simply because two devices were on the same network may need a specific allowance. That exercise has certainly helped me understand how traffic actually flows around the network: what starts the connection, where it goes and which service it really needs.
The table below is a simplified example of the policy, rather than an export of the running firewall. DNS, time, authentication and application dependencies need their own allowances where required. Clear descriptions help when I have to revisit a rule later.
| Source | Destination / service | Intent |
|---|---|---|
| Remote user | Office PC / required remote desktop service | Existing route to normal work resources |
| Remote user | Direct NAS, printer and management access | Denied; work through the office PC |
| On-site workstation | NAS VLAN / required file service | Specific allowance, plus file permissions |
| On-site workstation | Printer VLAN / required printing service | Specific allowance |
| Admin workstation | Named management hosts / admin ports | Allow narrowly |
| Every VLAN | OpenCanary / virtual IP in that VLAN | Decoy access generates admin notifications |
| Other traffic between segments | No documented exception | Default deny |
OpenCanary is up and noisy
The OpenCanary server is now set up and accessible from every VLAN. It has a virtual IP on each VLAN to make it easy to find. Attempts to access it generate a flurry of notifications to administration. There is very little chance of quietly poking at it without somebody hearing about it.
That is useful because nobody has a legitimate work reason to use the decoy. A connection is something to investigate. OpenCanary records interactions with its decoy services; it does not inspect every conversation on the network. The notification path is working, while the Wazuh collection example below remains a separate integration example.
The canary is reachable across the VLANs deliberately. That does not give users general access to the real systems on those networks. A decoy with a presence on several networks also needs to stay out of the business of routing or bridging between them. Its management and outbound access deserve the same attention as the other firewall rules.
The commands below are a reusable example for a fresh lab VM, following the upstream Ubuntu installation method. The download includes a configuration fragment, a foreground systemd service example and the remaining setup notes. These are examples for building a similar setup, rather than a copy of my running configuration. Fake SSH must use a port that does not collide with the host’s real management SSH service.
sudo apt-get update
sudo apt-get install -y python3-dev python3-pip python3-venv libssl-dev libpcap-dev
sudo python3 -m venv /opt/opencanary/venv
sudo /opt/opencanary/venv/bin/python -m pip install opencanary
sudo /opt/opencanary/venv/bin/opencanaryd --copyconfig
# Merge the example fragment into the generated config.
# Set up the service user, log permissions and external firewall policy
# using the notes in the download before starting the service.Wazuh is now producing useful results
The Windows agents now give me a central place to investigate endpoint activity, and I have started putting that visibility to practical use. The useful measure is what I can learn and act on after an alert, beyond simply seeing that an agent is connected.
Wazuh identified installed software with known security vulnerabilities, and I used those findings to notify several users about software that needed to be removed or updated. That gives the follow-up a specific application and reason. Those notifications are a step toward remediation; I am not treating an alert or a message to a user as proof that the software has already been fixed.
It also caught thousands of failed authentication attempts. I traced them to failed tasks still associated with decommissioned user accounts. The volume was worth investigating, but in this case the explanation was stale task configuration rather than evidence of a password attack. Seeing the failures together made it much easier to identify what needed attention.
During the move from local Windows accounts to Entra ID, Wazuh also made suspicious-looking registry and user-account changes obvious. In that case I could connect the alerts to legitimate migration work. That was a useful real-world check that the monitoring could surface changes I would want to investigate if they occurred without an explanation. It was visibility into an authorized change, not a claim that the migration was malicious.
The earlier rollout also exposed a separate Windows health-check task issue. Its installer repair passed offline checks; that diagnostic work is distinct from the security findings above. The lab examples remain examples, rather than exports of my live alerts.
The example below shows how to collect the canary’s JSON event log through a Wazuh agent. It goes inside the agent’s existing ossec_config element. The file must be readable by the agent, and collection needs checking after service restarts and log rotation. OpenCanary’s administration notifications are already working; this example does not establish that they are being delivered through Wazuh.
<!-- Add INSIDE the agent's existing ossec_config element. -->
<localfile>
<location>/var/log/opencanary/events.json</location>
<log_format>json</log_format>
</localfile>The notifications work; the example is still simulated
The live canary is already generating notifications when someone tries to access it. For anyone adapting the Wazuh examples, I would still check that whole collection path: request the decoy HTTP service’s /index.html page from an approved test machine, find the event in the canary log, then trace the same event through Wazuh and any notification configured there.
The image below is a simulated view of that Wazuh workflow, using made-up events and reserved documentation addresses. It is not a screenshot of my dashboard or a record from the laptop incident. The downloadable rule is also a lab example: it matches selected HTTP and SSH event types from one named canary and needs testing and tuning for the installation where it is used.
{"node_id":"canary-lab-01","logtype":3000,"src_host":"192.0.2.25","src_port":51234,"dst_host":"198.51.100.20","dst_port":80,"logdata":{"PATH":"/index.html"}}Checking what can actually connect
With the rules locked down, repeatable connection checks are useful when I need to change access. The PowerShell helper in the download takes an explicit list of hosts and TCP ports, tries each connection and compares the result with Allow or Deny. It does not scan a subnet or change the firewall.
Replace the sample addresses and run it from a clean test machine in each relevant network, including the VPN. A failed connection by itself proves very little: the destination service might simply be down. Check it from an allowed source and compare the denied attempt with the firewall log.
Use fresh connections when checking a rule change, since existing states may still permit an earlier connection. IPv6 paths, same-VLAN traffic, UDP services and application permissions need their own checks. Being able to reach the required service matters as much as being unable to reach the things I meant to block.
# my-matrix.csv
# Host,Port,Expected
# 192.0.2.10,3389,Allow
# 198.51.100.10,443,Deny
.\Test-Segmentation.ps1 -MatrixPath .\my-matrix.csv `
-SourceLabel VPN -OutputPath .\results.csvMore upkeep, and a better picture of the network
The VLAN segmentation and port, service and IP lockdown are finished. The NAS and printer are on separate VLANs, and the canary is running with a virtual IP in every VLAN and working administration notifications. Wazuh now adds practical endpoint visibility: vulnerable software, failed authentication and changes that need context and follow-up.
There is certainly more work involved in keeping everyone’s access to things working. I have to understand a connection well enough to allow what is needed. Going through that process has given me a much better picture of how traffic moves around the network than I had when more of it could just talk directly.
I was glad the original boundaries were there when the laptop was infected. Finishing this work has made those boundaries more deliberate, and maintaining them will keep me familiar with what is actually happening on the network.