-
-
Notifications
You must be signed in to change notification settings - Fork 794
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
[Bug]: Iptables firewall rules update to block traffic on abended tunnel #1649
Comments
There is a 2nd bug as well - wireguard only uses udp - so its ok to say -A INPUT -p UDP. But openvpn allows both UDP and TCP. But i dont think -A INPUT -P is needed at all - in rules below, i left it in just for consistency, but removed the -p UDP. What is happening is very easy to reproduce on either wireguard or openvpn. Traffic will still flow. Below is a better kill switch for both. The basic jist - MASQUERADE is a-ok but ONLY if traversing the vpn tunnel. In current ruleset as deployed - traffic will flow if the tunnel is there or not. I think you also want to be sure to drop any tun+ to tun+ traffic (thats an attack), For custom CLI vpn, if you can identify the tunnel name from 'ip a' (or known from publisher), same rules will protect traffic to be sure it flows thru whatever tunnel name they create. Confirmed with iptraf (sudo apt-get install iptraf)
|
I dont know if i did this right - but i updated the json file with changes. |
@frankozland thanks for this. the |
This issue is stale because it has been open for 30 days with no activity. |
This issue was closed because it has been inactive for 14 days since being marked as stale. |
Code of Conduct
Issue reporting checklist
Operating System
Raspberry Pi OS (64-bit) Lite Bookworm
Quick install or Manual setup?
Quick install
Onboard wireless chipset or external adapter?
Onboard wireless chipset
Hardware
Raspberry Pi 4 Model B
RaspAP version
3.1.3 (Latest)
Other software or services running with RaspAP?
Yes (specify below)
Contact details (optional)
Bug description
config/iptables_rules.json
With '-P FORWARD ACCEPT' and any cli/openvpn/wg goes down, packets will still flow.
Masquerade means "FORWARD ANY MEANS POSSIBLE"
So if tunnel dies, packets still traverse.
This should be changed to '-P FORWARD DROP'
2ndly - if i have already applied custom firewall rules, they should be honored vs raspap changing them.
For example, in my firewall i specificed '-P FORWARD DROP'. RASPAP ignored what i configured and changed it to '-P FORWARD ACCEPT'.
I think Raspap should check to see if i have any rules that its about to change and give option not to change them if already set.
Steps to reproduce
install raspap
apply personal custom firewall rules
enable tunnel
Screenshots
No response
Additional context
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: