Restrict the robot's service ports to the USB link
Audio (4713), MCP (8765) and the face webhook (8766) are accepted only on usb0 from 10.55.0.1 and dropped on every other interface, Wi-Fi included. SSH is left open on all interfaces for V2, by the owner's decision. Tested on the Pi with throwaway listeners: 8765 answers over usb0 and is unreachable over Wi-Fi, while a control port answers on both. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AFN8nRRCiDiMN7ChBpHJhs
This commit is contained in:
+4
-2
@@ -88,8 +88,10 @@ printed enclosure, speakers. Work until those arrive is limited to what the Pi,
|
|||||||
|
|
||||||
## Next
|
## Next
|
||||||
|
|
||||||
1. Finish package 0b: nftables rewrite (accept 4713/8765 only on `usb0` from `10.55.0.1`), Wi-Fi-off
|
1. Finish package 0b: Wi-Fi-off boot test, replug recovery, serial login check, NixOS snippet in
|
||||||
boot test, replug recovery, NixOS snippet in `host/nixos/`.
|
`host/nixos/`, and make the firewall load at boot. A new Omarchy host with a GPU (runs the local
|
||||||
|
model "ornith") arrives this week: it needs only `host/omarchy/robot-usb-link.sh` and its SSH key
|
||||||
|
added to the Pi.
|
||||||
2. Audio (package 1; needs the `wm8960-soundcard` overlay and a reboot), camera (package 3), then
|
2. Audio (package 1; needs the `wm8960-soundcard` overlay and a reboot), camera (package 3), then
|
||||||
the rest of the packages in `HANDOFF.md`.
|
the rest of the packages in `HANDOFF.md`.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#!/usr/sbin/nft -f
|
#!/usr/sbin/nft -f
|
||||||
# Only your Omarchy machine may reach the robot's audio (4713) and MCP (8765) ports.
|
# The robot's audio (4713), MCP (8765) and face webhook (8766) ports are reachable only over the
|
||||||
# Everything else, SSH included, is left alone. __HOST_IP__ is filled in by install.sh.
|
# USB link, and only from the host at 10.55.0.1. Every other interface, Wi-Fi included, is dropped.
|
||||||
|
# SSH and everything else are left alone: that policy is the owner's call.
|
||||||
|
|
||||||
table inet robot
|
table inet robot
|
||||||
delete table inet robot
|
delete table inet robot
|
||||||
@@ -9,7 +10,7 @@ table inet robot {
|
|||||||
chain input {
|
chain input {
|
||||||
type filter hook input priority 0; policy accept;
|
type filter hook input priority 0; policy accept;
|
||||||
iif "lo" accept
|
iif "lo" accept
|
||||||
ip saddr __HOST_IP__ tcp dport { 4713, 8765 } accept
|
iifname "usb0" ip saddr 10.55.0.1 tcp dport { 4713, 8765, 8766 } accept
|
||||||
tcp dport { 4713, 8765 } drop
|
tcp dport { 4713, 8765, 8766 } drop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user