Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

netfilter-persistent systemd service does not lock the network if netfilter-persistent wrapper is failing at system bootup #21

Open
adrelanos opened this issue Aug 15, 2016 · 1 comment

Comments

@adrelanos
Copy link
Owner

adrelanos commented Aug 15, 2016

netfilter-persistent may not be ready for prime time.

netfilter-persistent bug reports:

netfilter-persistent feature request:


systemd feature request:
please provide a firewall scripts drop-in folder

netfilter feature request:
please provide a firewall scripts drop-in folder


Anyone feeling awesome to patch netfilter-persistent in Debian?

@ghost
Copy link

ghost commented Aug 22, 2016

I wonder if netfilter-persistent dependence is really needed here. I think not every user of netfilter-persistent desire fail-lock network option. Also providing standalone systemd service gives you full control of bugs/features/hardening. It's also more cross-platform as not every distro has netfilter-persistent available. At the end creating standalone systemd service means one more file...

Systemd service:

/lib/systemd/system/vpn-firewall.service

[Unit]
Description=Leak Protection (Fail Safe Mechanism) for (Open)VPN
DefaultDependencies=no

Wants=network-pre.target
Before=network-pre.target

Wants=systemd-modules-load.service local-fs.target
After=systemd-modules-load.service local-fs.target

Conflicts=shutdown.target
Before=shutdown.target

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/sbin/vpn-firewall start
ExecStop=/usr/sbin/vpn-firewall flush

[Install]
WantedBy=multi-user.target

And network lock:

/lib/systemd/system/networking.service.d/30_vpn-firewall.conf

[Unit]
#Fail Closed Mechanism. When the firewall systemd service failed, do not bring up the network.
Requires=vpn-firewall.service

@adrelanos adrelanos changed the title netfilter-persistent loads firewall rules too late / netfilter-persistent systemd service does not lock the network if netfilter-persistent wrapper is failing at system bootup netfilter-persistent systemd service does not lock the network if netfilter-persistent wrapper is failing at system bootup Nov 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant