Skip to content

Commit 518a0d0

Browse files
committed
firewall: allow postgres on localhost:54322 (modem docker-compose)
1 parent 18a3c7e commit 518a0d0

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

bin/setup-firewall.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Blocks: everything else (reverse shells, raw sockets, non-standard ports)
88
#
99
# LOCALHOST:
10-
# Allows: Slack bridge (7890), Ollama (11434), DNS (53)
10+
# Allows: Slack bridge (7890), Ollama (11434), PostgreSQL (54322), DNS (53)
1111
# Blocks: everything else (Steam, CUPS, Tailscale admin, unknown services)
1212
#
1313
# The agent cannot:
@@ -49,6 +49,9 @@ iptables -w -A "$CHAIN" -o lo -p tcp --dport 7890 -j ACCEPT
4949
# Allow Ollama (local LLM inference)
5050
iptables -w -A "$CHAIN" -o lo -p tcp --dport 11434 -j ACCEPT
5151

52+
# Allow PostgreSQL in Docker (modem app dev/test)
53+
iptables -w -A "$CHAIN" -o lo -p tcp --dport 54322 -j ACCEPT
54+
5255
# Allow DNS on localhost
5356
iptables -w -A "$CHAIN" -o lo -p udp --dport 53 -j ACCEPT
5457
iptables -w -A "$CHAIN" -o lo -p tcp --dport 53 -j ACCEPT
@@ -87,7 +90,7 @@ echo "✅ Firewall active. Rules:"
8790
echo ""
8891
iptables -w -L "$CHAIN" -n -v --line-numbers
8992
echo ""
90-
echo "Localhost allowed: 7890 (bridge), 11434 (ollama), 53 (dns)"
93+
echo "Localhost allowed: 7890 (bridge), 11434 (ollama), 54322 (postgres), 53 (dns)"
9194
echo "Internet allowed: 80, 443, 22, 53"
9295
echo "Everything else: BLOCKED + LOGGED"
9396
echo ""

0 commit comments

Comments
 (0)