Skip to content

docs(heimdall): a host firewall, a console that asks for the password, no radio and no unused apps - #1745

Merged
Gerrrt merged 2 commits into
mainfrom
gerrrt/heimdall-console-and-firewall
Nov 25, 2026
Merged

Gerrrt merged 2 commits into
mainfrom
gerrrt/heimdall-console-and-firewall

Conversation

@Gerrrt

@Gerrrt Gerrrt commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

What changed

build-heimdall.md §2 gains three subsections for the five hardening gaps a full re-check of heimdall found, with undo steps in §9:

  • No radio and no unused desktop apps: dtoverlay=disable-bt, and apt purge --autoremove firefox vlc.

  • Nothing at the console but a login:

    • It removes the tty1 autologin drop-in, so the text console asks for the password. The desktop's lightdm autologin on vt7 stays.
    • It masks serial-getty@ttyAMA10.
  • A firewall that admits only those two: an nftables ruleset that drops input except:

    • SSH;
    • the scrape on 9100 from 10.0.99.20 alone;
    • ICMP and DHCP replies;
    • loopback and established traffic.

    It is loaded live first, and enabled at boot only after a new SSH login and the scrape both work. Until then, a power-cycle undoes it.

docs/security.md's paragraph on the Hicks pass now names the firewall, and the changelog records the change. Nothing is applied on the Pi yet: every step needs the operator's sudo password.

Why

A read-only re-check on 2026-11-24 at 21:25 found every fix from the first audit in place. Another auditor could still raise these five:

  1. No host firewall. nftables is installed, but its ruleset is empty. The Pi stays at 22 and 9100 only because nothing else listens.
  2. A shell on tty1. atropos is logged in there at all times, so a keyboard gives the user without a password, though not root.
  3. A login prompt on the debug UART. Nothing uses it.
  4. The Bluetooth radio is still up. hci0 exists even though bluetooth.service is masked.
  5. Firefox and VLC are installed and unused. 16 of the Pi's 18 pending upgrades were VLC's.

None of them is reachable from the network today.

Blast radius

  • Only heimdall, once the operator applies it. The repo change is docs only.

  • The firewall is the step that can lock you out. That's why it is loaded live before it is enabled. If a new SSH login or the scrape fails, power-cycling the Pi brings it back without the ruleset.

    • Allowed: SSH from anything that can reach the Pi, which morpheus already limits to Hicks. 9100 only from prometheus (10.0.99.20, on Winterfell), whose scrape crosses into Hicks through the one morpheus pass.
    • Dropped: 9100 from every host on Hicks itself.
  • Removing the tty1 autologin ends that shell, not the kiosk. loginctl shows the desktop is lightdm's session on vt7.

  • The Bluetooth overlay takes effect at the next reboot. config.txt is backed up first.

  • No change to network segmentation or firewall rules

  • No new port published to a VLAN that could not already reach the service

  • No credential added outside secrets/*.sops.yaml

The first box is unticked because this adds a host firewall to heimdall. It changes no morpheus rule and no VLAN.

Verification

  • On the Pi, read-only:

    • loginctl shows session 3 on tty1 (Service=login) and the lightdm-autologin wayland session on VT 7.
    • getty@tty1.service.d/autologin.conf holds the --autologin line.
    • cmdline.txt has console=serial0,115200, and serial-getty@ttyAMA10 is active.
    • /sys/class/bluetooth holds hci0, and the overlays include disable-bt.dtbo (README: "Disable onboard Bluetooth on Bluetooth-capable Raspberry Pis").
    • nftables 1.1.3 is installed and disabled, with an empty ruleset.
    • The only established peer on 9100 is 10.0.99.20.
  • The app purge: apt-get -s purge --autoremove firefox vlc lists 40 packages, all Firefox, VLC and their libraries.

  • The ruleset, loaded on the Pi's own nft inside unshare -rn (a throwaway network namespace; the Pi's real ruleset was not touched): it loads, and nft list ruleset prints it back as written.

  • Checks:

    • python3 scripts/check_docs.py: docs OK.
    • ./scripts/lint.sh: everything that ran passed except ansible-lint, which fails the same way on main (a local uv problem). The Docker-based linters, including markdownlint, were skipped because this Mac has no Docker daemon.
  • make validate passes

  • Deployed to the lab and confirmed working

  • Docs updated (docs/, service README, or docs/roadmap.md)

🤖 Generated with Claude Code

Gerrrt and others added 2 commits November 24, 2026 21:37
…, no radio and no unused apps

A full re-check of heimdall found the first audit's fixes in place and five
gaps a second audit could raise: an empty nftables ruleset, an autologin
shell on tty1, a getty on the debug UART, the Bluetooth radio still up,
and Firefox and VLC installed for nothing. build-heimdall.md §2 now closes
each, with the firewall loaded live before it is enabled at boot, and §9
undoes them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…le-and-firewall

# Conflicts:
#	docs/changelog.md
@Gerrrt
Gerrrt marked this pull request as ready for review November 25, 2026 18:09
@Gerrrt
Gerrrt merged commit f49b3cd into main Nov 25, 2026
10 checks passed
@Gerrrt
Gerrrt deleted the gerrrt/heimdall-console-and-firewall branch November 25, 2026 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant