Repository navigation
feat(logs): relay neo's log through morpheus (ADR-0127) - #1680
Merged
Merged
Conversation
…firewall's alerts (ADR-0127) syslog.alloy stores a line as host="neo" only when it arrives on morpheus's pinned connection with hostname neo, and gives it a fixed app="routeros" so no tag on that path reads as filterlog, Suricata or Kea. The firewall's Loki selectors also require host="morpheus". Two rules read the new stream: SwitchLoginFromUnexpectedSource and SwitchLogsStopped, the second against a five-minute heartbeat because Home Assistant's logins came once in four hours. ship-firewall-logs.md §3 now describes the syslog-ng config that runs, whose generated source cannot take flags(no-hostname), and §10 is the neo procedure. restore-the-firewall.md checks both streams come back. ADR-0127 is accepted, and README's ADR count is corrected to 127. Refs #1659 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # README.md # docs/changelog.md
Gerrrt
enabled auto-merge (squash)
November 23, 2026 18:35
There was a problem hiding this comment.
🟡 Changes recommended
The upgrade sequence omits a required hostname rewrite, risking misattributed logs and suppressed switch alerts, while a Loki label collision causes false critical login alerts and incorrect source reporting.
2 open issues
What changed in this PR
Implements ADR-0127’s receiver-side support for relaying neo’s switch logs through morpheus into Loki, while keeping switch logs separate from firewall alerts.
Changes:
- Adds Alloy sender identification and fixed
routeroslabeling, with firewall rules restricted tohost="morpheus". - Adds unexpected-login and missing-log alerts for
neo, plus sender and alert fixtures. - Documents deployment, recovery, and incident response; accepts ADR-0127 and updates rule and ADR counts.
| File | Description |
|---|---|
| stacks/observability/README.md | Updates the Loki rule count. |
| stacks/observability/loki/tests/security.test.yaml | Adds switch alert and firewall-isolation fixtures. |
| stacks/observability/loki/rules/security.rules.yaml | Scopes firewall selectors and adds two switch alerts. |
| stacks/observability/alloy/syslog.alloy | Identifies relayed switch logs and isolates their labels. |
| scripts/check_syslog_senders.sh | Adds switch sender acceptance and rejection checks. |
| README.md | Updates alert and ADR totals. |
| docs/security.md | Documents the gateway syslog pass and alert total. |
| docs/runbooks/ship-firewall-logs.md | Corrects relay setup and adds switch deployment steps. |
| docs/runbooks/restore-the-firewall.md | Adds recovery checks for both log streams. |
| docs/runbooks/respond-to-a-security-alert.md | Adds switch-login investigation guidance. |
| docs/observability.md | Describes the two switch alerts. |
| docs/network.md | Documents the syslog path and heartbeat. |
| docs/firewall-claims.yaml | Clarifies gateway-only passes in comments. |
| docs/changelog.md | Records the implementation and operational observations. |
| docs/architecture.md | Adds the switch-to-firewall syslog exception. |
| docs/adr/0127-relay-neos-log-through-morpheus.md | Accepts the decision and corrects relay and heartbeat assumptions. |
Review effort: Balanced
…elay rewrite first Every line on the syslog path carries source="network", so Loki renamed the regexp's `source` capture to source_extracted and the rule compared "network": every login to neo, expected or not, would have paged. The capture is now login_from, and the fixtures carry source: network as production lines do; the old rule fails all three login cases against them. ship-firewall-logs.md §10 now makes morpheus's r_host_morpheus rewrite a checked first step, before Alloy trusts the hostname neo. Refs #1659 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # README.md # docs/observability.md # docs/security.md
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
This applies ADR-0127.
neo's log is relayed through syslog-ng onmorpheusand stored in Loki ashost="neo". The receiver side is in this PR:syslog.alloygets aneosender rule. It matches only morpheus's connection address and the hostnameneo, and gives those lines a fixedapp="routeros".host="morpheus".SwitchLoginFromUnexpectedSourceandSwitchLogsStopped.ship-firewall-logs.md.The ADR moves to Accepted.
The
morpheusside is already live, by hand, as the ADR orders. Nothing has been sent on it yet:s_neo,r_host_neo,r_host_morpheus), with the existing TLS log path now rewriting HOST tomorpheus;igc0, Allow Neo syslog to Firewall,10.7.7.2 → 10.7.7.1UDP 5514.neois pointed at the relay only after this deploys.Why
ADR-0127 (#1659): the core switch kept its log in RAM only, 1,000 lines deep.
Applying it turned up three things the ADR got wrong or didn't know. They are fixed here and recorded in the changelog:
flags(no-hostname). It is package-generated and can't take the flag, and §3 of the runbook described a source that never ran. The morpheus path now rewrites HOST tomorpheus, so only the neo path can produceneo.neogets a 5-minutelog-heartbeatscheduler entry, soSwitchLogsStoppedhas something to measure against.ether4(mjolnir's card) is flapping. It has had 48,057 link-downs in 16 days and filled 987 of the 1,000 buffered lines. That is not fixed here.Blast radius
prometheus's Alloy, which loads the whole directory as one config, and Loki's ruler. If either is wrong, every firewall alert is affected, which is why the tests below cover both. Separately,morpheushas one new pass on the switch LAN, to its own address only, and two new syslog-ng objects.igc0. It reaches no segment, and nothing into or out of Winterfell changes.secrets/*.sops.yamlVerification
scripts/check_syslog_senders.sh: 14/14 pass, including three new neo cases (labels, a suricata tag on Skids's facility, andneofrom another address dropped and counted). With theapp="routeros"rule removed, the two label cases fail.scripts/test_loki_rules.py: 72/72 tests over 28 of 28 rules. New cases: a neo line taggedfilterlogdoesn't keepFirewallLogsStoppedquiet, and a priority-1 neo line taggedsuricatadoesn't fire.On morpheus: the syslog-ng syntax test was clean before applying, and
sockstatshows127.0.0.1:5140and10.7.7.1:5514. morpheus's own lines kept arriving in Loki after the restart, with filterlog, kea-dhcp4 and others in the next minute.pfctl -srshows the pass directly below the NTP pass and above Block access to Winterfell.check_docs.pyandlint.shpass.make validatepasses locally with 5 checks skipped: the offsite tmpfs path refusal, and four deployment-checkout checks that don't apply in a worktree. CI runs them.make validatepassesDeployed to the lab and confirmed working: the morpheus side is done, and the Alloy/Loki deploy and
neofollow the merge.Docs updated (
docs/, service README, ordocs/roadmap.md)Refs #1659
🤖 Generated with Claude Code