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

Add network route access control on client #2298

Conversation

lixmal
Copy link
Contributor

@lixmal lixmal commented Jul 22, 2024

Describe your changes

Add:

  • Methods to set up forward rules for routed traffic (network ACLs) according to the network map
    Modify:
  • Apply ACLs in engine as early as possible to avoid security issues
  • Insert instead of append all netbird rules in existing input/output/forward chains
  • Rename existing ACLs to "peer ACLs"
  • Use dedicated type for route ID where possible
  • Use netip.Prefix instead of string where possible

Fix:

  • Management proto and network map:
    • Add default return traffic permit when there's no ACL applied to the network route
    • Fix missing protocol in default rules
    • Partically add IPv6 rules to DNS routes

Remove:

  • Default accept in forward chains
  • Rules in prerouting chains
  • Fwmark accept rules in output chains
  • Src addresses in output chains
  • Dst addresses in input chains
  • Dysfunctional rule in output chains
  • Accept traffic initiated by routed networks behind routing peers in input chains

The prerouting/fwmark parts were used as substitutes for route ACLs to prevent locally routed networks (e.g. containers) from bypassing the input rules (because forward rules match the traffic).

Issue ticket number and link

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

@CLAassistant
Copy link

CLAassistant commented Jul 22, 2024

CLA assistant check
All committers have signed the CLA.

@lixmal lixmal changed the base branch from main to feature/network-route-access-control July 22, 2024 08:05
@lixmal lixmal force-pushed the feature/network-route-access-control-client branch from 023e93d to 65ea678 Compare July 22, 2024 08:11
Copy link

@lixmal lixmal merged commit 8dba8f1 into feature/network-route-access-control Aug 6, 2024
21 checks passed
@lixmal lixmal deleted the feature/network-route-access-control-client branch August 6, 2024 08:45
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

Successfully merging this pull request may close these issues.

3 participants