docs(deploy): record the app host firewall used in the edge rollout
This commit is contained in:
1 parent
b8c3c83ed8
commit
560724e2aa
2 files changed
+14
-8
No files matched your search
+7
-4
@@ -426,13 +426,16 @@ The app host initiates the handshake from behind NAT and sends a keepalive every
|
||||
|
||||
On the edge host, ufw gains three rules: 80/tcp and 443/tcp to `EDGE_LISTEN_IP`, and the tunnel port over UDP to `AWG_EDGE_ENDPOINT_IP`. The host's other rules, WireGuard interface, and UDP 443 listener are untouched.
|
||||
|
||||
On the app host, ufw denies incoming traffic by default and allows SSH only from the LAN (`192.168.10.0/24`); the tunnel port needs no inbound rule because the app host initiates and replies are tracked connections. Apply the SSH rule and check a second session before enabling ufw so a mistake cannot lock the host out:
|
||||
On the app host, ufw denies incoming traffic by default and rate-limits SSH. The rollout keeps SSH open to any source with `ufw limit`: the app host has only a private address behind NAT, and the operator's SSH source changes with the VPN path (both a LAN address and a VPN address were observed), so a source filter would lock the operator out. Narrow it to fixed sources only when they are known. The tunnel port needs no inbound rule because the app host initiates and replies are tracked connections. Arm a dead-man switch that disables ufw after five minutes, enable ufw, open a second SSH session, and only then stop the timer:
|
||||
|
||||
sudo systemd-run --unit=ufw-deadman --on-active=300 /usr/sbin/ufw --force disable
|
||||
sudo ufw default deny incoming
|
||||
sudo ufw default allow outgoing
|
||||
sudo ufw allow from 192.168.10.0/24 to any port 22 proto tcp
|
||||
sudo ufw allow in on awg-lincodex from 10.79.0.1 to 10.79.0.2 port 8080 proto tcp
|
||||
sudo ufw enable
|
||||
sudo ufw limit 22/tcp comment "SSH"
|
||||
sudo ufw allow in on awg-lincodex from 10.79.0.1 to 10.79.0.2 port 8080 proto tcp comment "lincodex edge to app"
|
||||
sudo ufw --force enable
|
||||
# From a new terminal: ssh <app-host> true, then:
|
||||
sudo systemctl stop ufw-deadman.timer
|
||||
|
||||
Docker bypasses ufw for published ports: it adds its own NAT and FORWARD rules, so a ufw rule does not stop traffic to a published container port, and the last rule above does not govern it. The control that holds is the publish address. With `APP_HTTP_BIND=10.79.0.2`, the port answers only for packets addressed to the tunnel address, not on the LAN address or on loopback. A host on the same LAN can still send a packet addressed to `10.79.0.2` to the app host's MAC address if it adds a route for that address, so the port is protected from the network only by the tunnel being private and the LAN being trusted. Never publish the frontend port on `0.0.0.0`. Keep every other Compose port unpublished, as the stack already does.
|
||||
|
||||
|
||||
Reference in new issue
Block a user