-
Notifications
You must be signed in to change notification settings - Fork 36
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
wg-easy does not delete iptables rules when stopped #1239
Comments
I see what the issue is. |
Is solving it this way really necessary? How important is it to block I'm trying to migrate my per-client iptables rules, which allow certain clients to access only certain services, from wg-easy Chart and need both post_up and post_down scripts. |
The |
Yes, it's for the server, but default iptables rules open up the whole network to remotely connecting family members while I wanted to open just a couple of services for them. https://gist.github.com/qdm12/4e0e4f9d1a34db9cf63ebb0997827d0d?permalink_comment_id=5090869#gistcomment-5090869 goes into the details on how it was working in the Chart. iptables commands are executed from wg-easy, but when configured poorly it certainly affects the host system. |
Steps to reproduce
iptables-legacy -S
command – there's just one--dport 51820
ruleiptables-legacy -S
again – now there are two--dport 51820
rulesWhy it happens?
Despite all the effort done in wg-easy/wg-easy#862 to ensure
WG_PRE_DOWN
andWG_POST_DOWN
run on process termination, this line in/trains/stable/wg-easy/1.1.6/templates/docker-compose.yaml
filenot only "Avoids foot-shooting" but also overrides all
iptables -D ...
rules set in wg-easy/src/config.js.That's why every time app starts it adds new iptables rules and doesn't remove them when stopped.
How to fix
Remove
WG_POST_DOWN
setter. Yes, it'll allow users to override its value and "shoot themselves in the foot" but will also let wg-easy to run clean-up commands on installations with default config.The text was updated successfully, but these errors were encountered: