refac: extend egress rules to IPv6 (#209)

The egress rules now also cover IPv6 traffic.
This commit is contained in:
Classic298 authored and GitHub committed 2026-11-07 11:12:46 +09:00
1 parent 4b059deb9f
commit f44200d581
2 files changed
+10

No files matched your search

+5
View File
@@ -191,6 +191,11 @@ setup_egress_firewall() {
iptables -A OUTPUT -m set --match-set allowed dst -j ACCEPT
fi
iptables -A OUTPUT -j DROP
# The allowed set holds IPv4 addresses only
ip6tables -F OUTPUT
ip6tables -A OUTPUT -o lo -j ACCEPT
ip6tables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
ip6tables -A OUTPUT -j DROP
echo "Egress firewall active — dropping CAP_NET_ADMIN permanently"
}
+5
View File
@@ -171,6 +171,11 @@ if [ "${OPEN_TERMINAL_ALLOWED_DOMAINS+set}" = "set" ]; then
sudo iptables -A OUTPUT -m set --match-set allowed dst -j ACCEPT
fi
sudo iptables -A OUTPUT -j DROP
# The allowed set holds IPv4 addresses only
sudo ip6tables -F OUTPUT
sudo ip6tables -A OUTPUT -o lo -j ACCEPT
sudo ip6tables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
sudo ip6tables -A OUTPUT -j DROP
echo "Egress firewall active — dropping CAP_NET_ADMIN permanently"
exec sudo -E PATH="$PATH" capsh --drop=cap_net_admin --user=user -- -c 'exec open-terminal "$@"' -- "$@"