yggdrasil: multicast peer discovery by default, per-transport dial protocols #7877
Labels
Clear labels
Type/Regression
Good first issue
Help wanted
Breaking change in behavior
Architecture
Change
Fundamental change spanning across components
Component
API
Issues regarding the clan api
Component
App
Issues regarding the clan app
Component
Backup
Component
CICD
Component
CLI
Component
Clan Services
Component
Clan module system
Issues regarding the clan module system including inventory.
Component
Docs
Component
Flake
Component
Install & Update
Component
Networking
Component
Select
Issues regarding select - the caching layer
Component
Templates
Issues regarding templates.
Component
Testing
Issues regarding testing
Component
VARS
Issues regarding vars.
Component
Virtualisation
Issues regarding virtual machines.
OS
Darwin
OS
Linux
Priority
Critical
1
Priority
High
2
Priority
Medium
3
Priority
Low
4
Status
Blocked
1
Status
On Hold
2
Status
Needs More Info
3
Status
Needs Review
4
Status
In Progress
5
Status
Won't Fix
6
Status
Available
Status
Duplicate
Type
Community Contribution
1
contributed by members of the Clan community
Type
Discussion
1
Type
Bug
2
Type
Question
3
Type
Epic
4
Type
Feature Request
5
Type
User Experience
5
Type
Enhancement
6
Type
Maintenance
7
Type
Documentation
Type
Question
Question to be resolved
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: clan/clan-core#7877
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Two changes to the yggdrasil service:
yggdrasil: enable multicast peer discovery by default
multicastInterfacesnow defaults to discovery on all interfaces, with overlay/VPN interfaces (zt|wg|tailscale|mycelium|tinc|tun|tap|ygg) degraded to priority 10 so direct links win.?priority=20, worse than any multicast-discovered link, so locally discovered peerings carry the traffic and static routes act as fallback. Priority only tie-breaks between multiple links to the same peer, so nodes reachable only statically are unaffected.yggdrasil: dial per-transport link protocols, disable quic/ws listeners by default
tcp://link: the transport already encrypts and doesn't filter, so extra protocols add connections but no reachability.ports.quicandports.wsare nownullOr portand default tonull(listeners disabled, firewall ports closed, not dialed).02b33a6f1ctoef9f41c580hmm, what are the security implications by having this on by default? can strangers in the same network can connect now to my "private" yggdrasil network?
ef9f41c580to13b50f388eWe should be doing access control by allowing only our keys to peer with our hosts. Local discovery should have been enabled all along.
good question, went trough the yggdrasil source to check. Answer is: they can peer, but they get nothing useful out of it. AllowedPublicKeys explicitly does NOT apply to link-local multicast peers (multicast listeners go through ListenLocal which skips teh check). So yes, a stranger on the same LAN can establish a peering with your node.
But peering != access: yggdrasil is e2e encrypted and this module already firewalls the ygg interface to only accept traffic from clan member IPs. So the stranger can use your node as transit and sees your pubkey, but cant reach any services or hosts in the clan.
If we want to close even that, multicast supports a Password option (only nodes with the same password discover each other), we could derive one from a clan-wide secret via vars. Would do that in a follow up PR tho.
yggdrasil: multicast peer discovery by default, single link protocol per peerto yggdrasil: multicast peer discovery by default, per-transport dial protocolsThe password option doesn't seem to be sound from a security perspective. Enabling it would just prevent connecting with foreigners by accident, but doesn't guarantee it.
hmm, but they could route via my peers to another peer which maybe is not firewalled off? maybe that's obscure enough that we don't need to think too hard about it?
wg and most tap/tun devices don't have any multicast support. Is there anything we lose/gain from disabling that for them anyway?
That is a good point. Other than that I think this looks reasonable.
How does this affect data center based deployments? Will Hetzner be mad?
I looked at it from that side and I doubt it:
first we actually would only peer with peers we already have added.
Second I could not find any actual multicast specific wording in the hetzner tos, I assume they just block it and thats it.
Also I'm the canary in the coalmine I cheery picked this and have been running it for 4 days now actually on Hetzner and my homelab.