X-Git-Url: https://git.distorted.org.uk/~mdw/firewall/blobdiff_plain/d0409c909cb113596f5d0daed5be237a42878c8d..7377aca7bc3d4cfd29e6974c861048db8e1a4161:/local.m4 diff --git a/local.m4 b/local.m4 index 6081132..821cea9 100644 --- a/local.m4 +++ b/local.m4 @@ -354,6 +354,23 @@ case $forward in ;; esac +m4_divert(82)m4_dnl +###-------------------------------------------------------------------------- +### Check for source routing. + +clearchain check-srcroute + +run iptables -A check-srcroute -g forbidden \ + -m ipv4options --any --flags lsrr,ssrr +run ip6tables -A check-srcroute -g forbidden \ + -m rt + +for c in INPUT FORWARD; do + for m in $from_scary $from_untrusted; do + run ip46tables -A $c -m mark --mark $m/$MASK_FROM -j check-srcroute + done +done + m4_divert(84)m4_dnl ###-------------------------------------------------------------------------- ### Locally-bound packet inspection. @@ -382,7 +399,7 @@ m4_divert(88)m4_dnl openports inbound ## Inspect inbound packets from untrusted sources. -run ip46tables -A inbound -j forbidden +run ip46tables -A inbound -g forbidden run ip46tables -A INPUT -m mark --mark $from_scary/$MASK_FROM -g inbound run ip46tables -A INPUT -m mark --mark $from_untrusted/$MASK_FROM -g inbound