Repository navigation
fix(firewall): close the firewall's own addresses to every segment, key-only sshd - #1503
Merged
Merged
Conversation
…ey-only sshd Every interface's Block SSH/HTTPS/HTTP to pfSense rows named only that interface's address, so every segment reached the admin UI and sshd on the WAN address, and Hicks on the lab gateway too (2026-11-13 audit). ADR-0126 re-points them at This Firewall (self), adds a prometheus-only SSH pass on Winterfell, and sets SSHd Key Only. The UI change is the new runbook. check_firewall_claims.py now also asks which of the firewall's own addresses each segment reaches on ssh, http and https, evaluated the way pf does, with its first fixtures under self-tests.sh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gerrrt
force-pushed
the
gerrrt/morpheus-self-access-key-only
branch
from
November 23, 2026 05:39
b059bb7 to
e6442d6
Compare
Gerrrt
added a commit
that referenced
this pull request
Nov 23, 2026
…piry; true up the audit's docs The repository side of the 2026-11-13 morpheus audit, apart from the firewall's own addresses and key-only sshd (#1503). - loki/rules/ups.rules.yaml: NutUpsDataStaleSustained (a stale period two minutes long) and NutUpsDataStaleFrequent (over twenty in an hour). The fortnight to 2026-11-23 had 1,363 periods, none over 5.2 s, at most nine an hour. Five behaviour tests. Neither sees a gap that lasts days, as the 2026-11-05 driver outage did, because syslogd folds repeats; so scripts/collect-nut-state.sh asks upsc on the firewall from make gateway-state, and NutUpsUnreadable pages after 30 minutes. - collect-cert-expiry.sh --file, for a client certificate with no handshake to read. make gateway-state reads the syslog listener's leaf and morpheus's pinned client leaf; SyslogTlsCertificateExpiringSoon warns at 30 days, and the console rules exclude syslog-*. - network.md: the undeclared Hicks SSH pass into smaug (ten passes), Skids' eighth reservation at .24, and the thirteen static ARP reservations. - hardware.md: check_versions.py does collect pfSense's release. - Changelog: the audit, and where each finding stood on 2026-11-23. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5 of 6 tasks
main took ADR-0126 (gandalf monitoring, #1676) and ADR-0127 (neo's log relay), so this PR's ADR moves to 0128, with every reference. README counts 128 ADRs and 54 runbooks. Also corrects three links the earlier renumber broke: network.md and security.md named phoenix's ADR-0117 "ADR-0126". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main's #1677 took ADR-0128 (prometheus's key-only sshd), so this PR's ADR moves to 0129, with every reference to it; prometheus's ADR-0128 links are left as main has them. README counts 129 ADRs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e deleted WSL rule from §3 make check-firewall 35/35, the WAN address closed to https and ssh, sshd key-only, a password login refused. The dead Mac-to-WSL rule was deleted during §3, so the runbook's ordering list no longer names it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gerrrt
marked this pull request as ready for review
November 23, 2026 18:57
Gerrrt
enabled auto-merge (squash)
November 23, 2026 19:01
There was a problem hiding this comment.
🟡 Changes recommended
The checker can falsely declare management paths closed by ignoring rule suffixes and mishandling table exclusions and negated sources, while contradictory guidance can encourage accepting unexpected exposure.
4 open issues
What changed in this PR
This PR documents and verifies tighter access to pfSense’s management services across the lab, extending the existing firewall-claims checker to cover the firewall’s own addresses.
Changes:
- Records blocks targeting This Firewall (self), explicit management exceptions, and key-only SSH.
- Adds per-address management-port evaluation and 11 self-test cases to the claims checker.
- Adds deployment, verification, and recovery instructions, with updated policy documentation.
| File | Description |
|---|---|
| systemd/homelab-firewall-claims.service | Updates comments describing the expanded check. |
| scripts/self-tests.sh | Documents the firewall checker’s fixtures. |
| scripts/README.md | Describes management-address coverage. |
| scripts/check_firewall_claims.py | Adds address discovery, rule evaluation, comparisons, and fixtures. |
| README.md | Updates ADR and runbook counts. |
| docs/security.md | Documents management restrictions and key-only SSH. |
| docs/runbooks/close-the-firewall-to-its-segments.md | Adds rollout, verification, and rollback procedures. |
| docs/network.md | Updates firewall access policy and SSH-hardening details. |
| docs/firewall-claims.yaml | Declares expected management access per interface. |
| docs/changelog.md | Records deployment and verification results. |
| docs/adr/0129-close-the-firewalls-own-addresses-and-take-passwords-off-its-ssh.md | Records the hardening decision, exceptions, and tradeoffs. |
Review effort: Balanced
Gerrrt
disabled auto-merge
November 23, 2026 19:05
… cannot fully evaluate Copilot's review of #1503, four points: - A rule's text after the address part was ignored, so a block ending in flags A/A or tagged read as closing the port. Anything but flags S/SA, flags any, state options, tag and allow-opts now marks the rule conditional: a block is skipped, a pass is taken. - A table's ! entries were dropped, so a block to {0.0.0.0/0, !WAN} closed the WAN address. Destination lookup now takes the most specific entry; a source table with an exclusion overlapping the segment is unknown. - A negated source was the negation of 'contains the segment', so a block from ! 10.0.99.0/25 covered all of 10.0.99.0/24. Sources now resolve to all, some or none of the segment, and a negation covers only when disjoint. - When a management path opened, the stale-file advice still followed the warning; it now returns before it. Three fixtures, each failing on the old code. Live: 35/35. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gerrrt
enabled auto-merge (squash)
November 23, 2026 19:09
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5 of 6 tasks
Gerrrt
added a commit
that referenced
this pull request
Nov 24, 2026
… stalls (#1702) * docs(ups): NUT's driver retries for 14 seconds, riding out the card's stalls The data stale spells were the UPS card going silent for 2-8 s; NUT's defaults gave up at about 6 s. Records the snmp_timeout/snmp_retries arguments applied on morpheus on 2026-11-23 in the runbook, observability and the changelog. Refs #1503. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(ups): the 14 seconds is per request; slow exporter scrapes were retried, not failed Review on #1702: upsd's MAXAGE counts from the driver's last message, so the retry budget does not set an outage-detection delay, and the exporter's 5 s is a per-request timeout inside a 45 s scrape. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
5 of 6 tasks
Gerrrt
added a commit
that referenced
this pull request
Nov 24, 2026
…ft open (#1716) * docs(network): name the three Hicks pool leases the morpheus audit left open .100 is laptop-02 on Wi-Fi, .101 is mobile-02 (was .109), and .105 is desktop-01 on its second Ethernet port, so its .20 reservation and static ARP entry do not apply. mobile-01's row no longer claims .105. Refs #1503. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(network): desktop-01's reservation now follows the port it uses Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


What changed
Every interface's Block SSH/HTTPS/HTTP to pfSense rows are to name This Firewall (self) instead of that interface's own address. Winterfell gains Allow SSH to pfSense from prometheus, and
sshdgoes to Public Key Only (ADR-0129). The firewall change is made in the pfSense UI by the new runbook,close-the-firewall-to-its-segments.md.check_firewall_claims.pygains a second question: per interface, which of the firewall's own addresses a host there reaches on ssh, http and https. It evaluates the ruleset the way pf does, one address at a time, and names addresses by segment,WANorlink-local, never by number. Unknowns resolve toward "reachable". It also gets its first fixtures (11), which CI now runs throughself-tests.sh.Applied on 2026-11-23, the date the docs give. Brought up to date with main the same day; ADR-0117, 0126, 0127 and 0128 were taken meanwhile, so this one is ADR-0129.
Why
A read-only audit of
morpheuson 2026-11-13 found two problems:sshdon the WAN address. The per-interface blocks named only their own address, and the catch-all'sto anycarried the rest. Fromprometheus, HTTPS there answered 200 and port 22 gave a banner.network.mdsaid Winterfell was blocked from the UI.10.0.30.1, through Allow Hicks access to ImaginationLAN.sshdaccepted passwords. The existing claims check could not see any of this, because the WAN address is in no segment.Blast radius
secrets/*.sops.yamlIf the Hicks rows go in the wrong order, the UI locks out from Hicks. The runbook gives two ways back: the console's Restore recent configuration, and the anti-lockout rule on the switch LAN. If the Winterfell pass is wrong,
prometheus's collectors, the nightly export and this check lose SSH. Runbook §2.3 tests for that before going on.oracleandtrinitylose port 22 on the firewall; nothing scheduled on either uses it. Key-only SSH locks out any machine whose key is not onadmin, and §1 proves each key first.Verification
make validatepassed before the merges with main; after them,check_docs.py, lint and the firewall-claims self-test pass (5 local skips: worktree-only timer and unit checks and the tmpfs offsite refusal; CI runs them)prometheus:make check-firewall35 PASS, 0 FAIL (21 FAILs before); the WAN address answers neither https (000) nor ssh (blocked);sshd -Treadspasswordauthentication no,kbdinteractiveauthentication no,permitrootlogin yes; a password login is refused withPermission denied (publickey); prometheus's key still logs in. The three administering keys were proved withkey-okbefore §6.network.md,security.md,firewall-claims.yaml, the changelog, ADR-0129 and the runbookpython3 scripts/check_firewall_claims.py --self-test: 11PASS.--deriveagainst the live firewall reproduces the audit by hand: Winterfell reaches only the WAN address on https and http.scripts/check_docs.pyandscripts/lint.shpass, with nothing skipped.🤖 Generated with Claude Code