iptables: block incoming wwan0 traffic (#67)

* iptables: block incoming wwan0 traffic (#45)

* allow related

Co-authored-by: Willem Melching <willem.melching@gmail.com>
This commit is contained in:
Adeeb Shihadeh
2022-05-26 17:22:27 -07:00
committed by GitHub
parent 063f805b83
commit 095bbb3fa9
3 changed files with 43 additions and 0 deletions
+3
View File
@@ -171,6 +171,9 @@ COPY ./userspace/files/disable_bootkick.py /lib/systemd/system-shutdown/
# Remove qt network bearer plugins
RUN rm -rf /usr/lib/aarch64-linux-gnu/qt5/plugins/bearer
# Add iptable rules to block incoming traffic on wwan0
COPY ./userspace/etc/iptables/rules.v4 /etc/iptables/rules.v4
# HACK: get newer version of ModemManager and libqmi from 21.04
# ModemManager 1.12.8 suffers from a bug with reconnecting: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/242
# libqmi 1.24.8 segfaults when power cycling the modem: https://gitlab.freedesktop.org/mobile-broadband/libqmi/-/issues/37
+1
View File
@@ -64,6 +64,7 @@ apt-get install --no-install-recommends -yq \
i2c-tools \
ifmetric \
ifupdown \
iptables-persistent \
jq \
landscape-common \
libi2c-dev \
+39
View File
@@ -0,0 +1,39 @@
# Generated by iptables-save v1.8.4 on Thu May 26 16:34:33 2022
*security
:INPUT ACCEPT [232864:1793459837]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [205236:11113001]
COMMIT
# Completed on Thu May 26 16:34:33 2022
# Generated by iptables-save v1.8.4 on Thu May 26 16:34:33 2022
*raw
:PREROUTING ACCEPT [232873:1793461973]
:OUTPUT ACCEPT [205236:11113001]
COMMIT
# Completed on Thu May 26 16:34:33 2022
# Generated by iptables-save v1.8.4 on Thu May 26 16:34:33 2022
*nat
:PREROUTING ACCEPT [92:10264]
:INPUT ACCEPT [83:8128]
:OUTPUT ACCEPT [281:20487]
:POSTROUTING ACCEPT [281:20487]
COMMIT
# Completed on Thu May 26 16:34:33 2022
# Generated by iptables-save v1.8.4 on Thu May 26 16:34:33 2022
*mangle
:PREROUTING ACCEPT [232873:1793461973]
:INPUT ACCEPT [232864:1793459837]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [205236:11113001]
:POSTROUTING ACCEPT [205236:11113001]
COMMIT
# Completed on Thu May 26 16:34:33 2022
# Generated by iptables-save v1.8.4 on Thu May 26 16:34:33 2022
*filter
:INPUT ACCEPT [16:2193]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [108:15364]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i wwan0 -j DROP
COMMIT
# Completed on Thu May 26 16:34:33 2022