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

SSH daemons bound to WireGuard interface only can still be accessed from non-WireGuard network #7

Open
klyubin opened this issue Apr 23, 2020 · 1 comment

Comments

@klyubin
Copy link

klyubin commented Apr 23, 2020

https://github.com/simonw/til/blob/master/tailscale/lock-down-sshd.md suggests binding SSH daemon to the WireGuard interface only. This security measure can be bypassed because most modern Linux hosts use the Weak Host Model (see rp_filter settings). Packets received on non-WireGuard (e.g., eth0) interface, with destination IP of the WireGuard interface, will be happily delivered to the SSH daemon, and its replies will go out of the non-WireGuard interface. This, in effect, bypasses WireGuard. See rp_filter and https://lwn.net/Articles/806546/ for more information.

Mitigations:

  • Don't rely on VPNs as the primary security mechanism. Use application level security (well-configured and hardened SSH daemon) as the primary security mechanism. VPNs are fine for defense in depth.
  • If you want to rely on VPN as the primary security mechanism, change rp_filter sysctls or add firewall rules.
@simonw
Copy link
Owner

simonw commented Apr 29, 2020

Do you know if the alternative pattern suggested by @bradfitz would fix this?

AllowUsers *@100.64.0.0/10

simonw added a commit that referenced this issue Apr 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants