Repository navigation
Description
What and why
Decided in ADR-0014 (the answer to #86); not built. This issue is the build.
ADR-0014 puts ifrit — attack tooling and the vulnerable targets — on ImaginationLAN (30) and adds no egress filtering there. The one firewall change it does decide is a tripwire on the ImaginationLAN interface, in the shape #223 gave the three terminal segments:
pass in log quick on igc0.30 inet from <vlan30 net> to <Internal_Segments>
Placed below the block rules that stop 30 → 99/50/40/20/10 and the quick iLO return-path pass (10.0.30.10 → 10.0.99.20/udp), and above the → any egress rule. It matches nothing while the design holds and costs nothing; if it ever logs a line, the segment that holds attackers has reached the house.
It is log-only. It cannot weaken anything. docs/security.md's threat-table row "a lab VM escaping into the house" is currently asserted, not watched; this is what makes it watched, on the segment where that threat becomes real.
The pieces
- The rule itself, on
morpheus, by hand — the firewall is not config-as-code. Re-runmake backup-firewallafterwards, as the restore runbook says. Internal_Segmentsmust not contain10.0.30.0/24. If the alias includes the lab's own subnet, every DNS and NTP query to10.0.30.1matches the tripwire and logs. Check the alias before adding the rule; if it does include 30, the rule needs its own alias (Internal_Segmentsminus 30) rather than a change to the shared one that the three existing tripwires use.- A Loki rule.
TerminalSegmentReachedInternalNetworkinstacks/observability/loki/rules/security.rules.yamlhard-codes sources10\.0\.(10|20|40)\.and destinations10\.0\.(30|50|99)\.— VLAN 30 is on the wrong side of it. A siblingLabSegmentReachedInternalNetworkwith source10\.0\.30\.and destination10\.0\.(10|20|40|50|99)\., severity critical, samefor.make check-loki-rulesboots a real Loki against it; mind the backtick raw-string note in the file header. docs/runbooks/restore-the-firewall.mdstep 4 grepsigc0\.(10|20|40)and expects exactly 3. Becomesigc0\.(10|20|30|40)and 4.docs/security.md— the "Three tripwire rules" paragraph becomes four, andcheck_docs.pydoes not count tripwires, so nothing guards that number but the runbook grep.- The
homelab-securitydashboard has "Terminal → internal" panels; the lab tripwire wants to appear there or in a sibling panel, so a line is seen and not only alerted on.
Optional, from the same ADR
ADR-0014 puts the vulnerable targets on a bridge inside ifrit with no physical port, on a subnet morpheus has no interface or route for. If forwarding is ever accidentally enabled on the attack VM, a target's packet arrives at igc0.30 with a source outside 10.0.30.0/24, misses the → any pass (which is from vlan30 net), hits default deny, and is logged as a block. A second Loki rule on {app="filterlog", action="block"} with that subnet as source catches the forwarding mistake for free. Its subnet is chosen when ifrit is built (#96), so this rule waits for that.
When
With ifrit, or before. There is no reason to wait: the rule is a no-op on today's segment and the only cost is one restore-runbook number.
Which VLAN does this touch
🟢 30 — ImaginationLAN (lab)
Activity
Gerrrt commentedon Sep 8, 2026
The firewall half of this landed before the repository half did, and it landed
into the trap item 2 predicted.
What is on
morpheustoday (read 2026-09-08,pfctl -sr)Rule
1788730111, created 2026-09-06 21:28 UTC alongside the untagged-LANblocks from Lemmiwinks#224:
Placed exactly where this issue asked — below the five blocks and the logged
untagged-LAN block, above Allow internet. That is item 1, done.
Item 2 is where it goes wrong.
Internal_Segmentsis10.0.30.0/24, 10.0.50.0/24, 10.0.99.0/24, 10.7.7.0/24— it names the lab's ownsubnet. So every packet from the lab to its own gateway that is not caught by
a block above falls onto the tripwire and is logged as a pass. Loki, last seven
days, tracker
1788730111:10.0.30.1:53/udp, every one of them10.0.30.110(Saruman) 826,10.0.30.40(alexander) 348,10.0.30.10(shiva) 65A tripwire that logs the lab's DNS is a DNS log, not a tripwire: the line that
would matter is buried in the ones that do not, and Passed (1h) on the
security dashboard has been counting gateway lookups as passes for three days.
What this PR lands (the repository half)
LabSegmentReachedInternalNetworkinsecurity.rules.yaml, sibling ofTerminalSegmentReachedInternalNetwork: source10\.0\.30\., destinationevery other segment including
10.7.7.0/24and excluding 30 — so therule is right even while the alias is wrong, which is why it has not fired on
any of the 1,239 lines. Critical,
for: 0s, same shape.make check-loki-rulesboots the pinned Loki against it: 17 rules, 30 dashboard expressions, all
evaluated. The sibling's destination class also gains
10.7.7, whichInternal_Segmentsgained on 2026-09-06 without the Loki rule following.restore-the-firewall.md§4 step 5 expects four tripwires onigc0.(10|20|30|40), accepts either alias name, and adds a third check thatthe lab's rule points at
House_Segments.docs/security.md,docs/observability.md, the security dashboard's textpanel: four tripwires, and why the fourth points at a different alias.
terminal panel, the violations log panel shows both directions, and the alert
table lists the new rule. Counted claims bumped: 94 rules, 17 log-based,
141 panels.
What closes this issue — one firewall change, by hand
House_Segments=10.0.10.0/24,10.0.20.0/24,10.0.40.0/24,10.0.50.0/24,10.0.99.0/24,10.7.7.0/24.Every segment except the lab's own.
1788730111on the ImaginationLAN tab: destinationInternal_Segments→House_Segments. Apply. LeaveInternal_Segmentsalone — the three terminal tripwires need 30 in it.
make backup-firewall, as the restore runbook says after any rule change.Verification, from the monitoring host:
Two things worth knowing, neither blocking
promtool test rulescovers thePrometheus side and
validate.shfails a stack without tests; the Loki sideis
check_loki_rules.sh(parse, and that the ruler evaluates) andcheck_loki_coverage.py(live, can this rule see each host). The new ruleis therefore proven to parse and to evaluate, not to fire — the same class of
gap TerminalSegmentReachedInternalNetwork cannot fire — the firewall logs blocks only #223 closed for the terminal rule by briefly logging real traffic. The
1,239 lines are, accidentally, that proof for the source half: they carry
10.0.30.xexactly where the regex reads it.172.30.30.0/24source arriving onigc0.30and being logged as a block)still waits for
ifrit; nothing here changes that.The repository half is #393.
🤖 Generated with Claude Code
Gerrrt commentedon Sep 8, 2026
Alias applied on 2026-09-08 and verified from the monitoring host.
On
morpheus(pfctl -sr,pfctl -t ... -T show):In Loki: the last line carrying tracker
1788730111is10.0.30.40 → 10.0.30.1:53at 13:33:47 UTC, before the change. Sixteen minutes later: zero lines since. The decisive number is the rule's own counter —pfctl -vsrshows 26 evaluations, 0 packets: the gateway lookups that used to match are still reaching the rule and no longer matching it. The three lab hosts that produced the 1,239 lines are still resolving at the gateway — Saruman's agent is pushing on schedule — and none of that traffic is logged any more, which is what ordinary egress should look like.The Loki side: the live ruler holds 17 rules after the reload,
LabSegmentReachedInternalNetworkamong them, and the rule's own query (10.0.30.xsource, any house destination,action=pass) returns nothing over 6h.All six pieces of this issue are in place: the rule, the alias it needed, the Loki rule, the restore-runbook count, the four-tripwire docs, and the dashboard panels.
make backup-firewallhas been re-run since the change, per the restore runbook. Closing.🤖 Generated with Claude Code
Merge pull request #399 from Gerrrt/gerrrt/roadmap-234-done