Skip to content

Conversation

@JackDoan
Copy link
Collaborator

@JackDoan JackDoan commented Oct 21, 2025

replaces #1506

  • We want to allow handshakes (and other L2 traffic like relays+lighthouseing) if your certs are valid and trusted (IP network overlap not required)
    • handshakes allowed
    • checks removed from other L2 traffic areas, esp config file
    • tests!
  • We do not want to pass L3 traffic without a vpn-network in common between the two hosts
  • We will store and remember all IPs in a certificate in the hostinfo
  • When we log vpnaddr(s), print as many IPs as we know

hostmap.go Outdated
}

func (i *HostInfo) buildNetworks(networks, unsafeNetworks []netip.Prefix) {
func (i *HostInfo) buildNetworks(myVpnNetworksTable *bart.Lite, networks, unsafeNetworks []netip.Prefix) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I keep thinking this would be better as buildNetworks(myVpnNetworksTable *bart.Lite, crt cert.Certificate)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? I don't like passing whole objects around when I only need a member or two

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Less to type and screw up, they are the literal Networks() and UnsafeNetworks() from the certificate, anything else would be an error.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohhhh ordering bc they're the same type. Smart.

There's a school of thought that would tell us to define a VPNNetwork and UnsafeNetwork type, but, I don't wanna.

Will change.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(this change actually is part of #1509, I forgot to target this PR at that one to reflect that, updated)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah crap #1509 doesn't include the removal of filteredNetworks

if !lh.myVpnNetworksTable.Contains(addr) {
return nil, util.NewContextualError("lighthouse host is not in our networks, invalid", m{"vpnAddr": addr, "networks": lh.myVpnNetworks}, nil)
lh.l.WithFields(m{"vpnAddr": addr, "networks": lh.myVpnNetworks}).
Warn("lighthouse host is not in our networks, this might be a mistake")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be beneficial to explain a little more about the mistake, maybe lighthouse host is not in our networks, only lighthouse control traffic will work, you will not be able to ping this lighthouse. or something. Same with the static host map.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah good idea

@JackDoan JackDoan changed the base branch from master to firewall-types October 28, 2025 15:56
@JackDoan JackDoan marked this pull request as ready for review October 28, 2025 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants