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

[management, client] Add access control support to network routes #2100

Merged
merged 19 commits into from
Oct 2, 2024

Conversation

bcmmbaga
Copy link
Contributor

@bcmmbaga bcmmbaga commented Jun 6, 2024

Describe your changes

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

* extends route with access control groups

* add support for creating and updating routes with access control groups

* Add access control groups to routes API request and response

* fix tests

* fix tests
Base automatically changed from 0.28.0 to main June 13, 2024 11:24
@roney492
Copy link

Any ETA on when this will be merged??

@fdisamuel
Copy link

I would like to know as well..😅

@braginini
Copy link
Contributor

braginini commented Jun 18, 2024

@roney492 @fdisamuel This PR is one of our top priorities. Soon it will be merged, give us a couple of weeks :)

@fdisamuel
Copy link

Hey @braginini thank you for your answer, we are looking forward for it :D

bcmmbaga added 2 commits June 20, 2024 14:21
# Conflicts:
#	management/server/account.go
#	management/server/http/api/openapi.yml
#	management/server/http/routes_handler.go
#	management/server/http/routes_handler_test.go
#	management/server/mock_server/account_mock.go
#	management/server/route.go
#	management/server/route_test.go
#	route/route.go
@bcmmbaga bcmmbaga force-pushed the feature/network-route-access-control branch from 9d2f6af to f1817f3 Compare June 20, 2024 11:39
bcmmbaga added 3 commits July 3, 2024 11:06
* extends route with access control groups

* add support for creating and updating routes with access control groups

* Add access control groups to routes API request and response

* fix tests

* fix tests

* Add network map processing for routed networks

* Refactor FirewallRule message and add RouteFirewallRule

* Refactor enum and field names in management proto files

* Refactor firewall rules and add route firewall rules

* Add firewall rules for routed networks

* Refactor enums and remove redundant code

* fix lint errors

* Move getAllRoutePoliciesFromGroups function to route.go

* Add tests for account peers routes firewall

* Add support for port range in policy rules

* Implement port range support in firewall rules

* fix tests

* Fix sonarcloud

* Refactor

* Replace PeerIP with SourceRange in RouteFirewallRule.

* Add CIDR notation to source range

* fix sonarlint

* Fix merge

* Add dynamic routing capabilities and allow all traffic for routes with no acl
# Conflicts:
#	management/server/account.go
#	management/server/http/policies_handler.go
#	management/server/http/routes_handler.go
#	management/server/http/routes_handler_test.go
#	management/server/mock_server/account_mock.go
#	management/server/route.go
#	management/server/route_test.go
Copy link

sonarqubecloud bot commented Jul 3, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
5 New issues
5 New Code Smells (required ≤ 0)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

@roney492
Copy link

Any update on this??

lixmal and others added 6 commits August 6, 2024 10:45
…2398)

* Add route ACLs

* Simplify createContainers

* Fix test

* Fix mgmt test

* Fix cycle

* Fix lints and remove obsolete code

* Fix typo

* Update firewall rules to support multiple source ranges

---------

Co-authored-by: Viktor Liu <viktor@netbird.io>
Co-authored-by: Viktor Liu <17948409+lixmal@users.noreply.github.com>
…ted (#2408)

* Remove outbound rules

* Add permissive legacy routing rules if the management server is outdated

* Add established rules to in/output chains to allow route client return traffic

* Remove obsolete iif/oif in inner input/output chain rules

* Fix route rule and nat rule removal

* Remove dst ip subnet in iptables output chain to align with nftables
# Conflicts:
#	management/server/account.go
#	management/server/grpcserver.go
#	management/server/route.go
@bcmmbaga bcmmbaga force-pushed the feature/network-route-access-control branch from 8090502 to 43e1854 Compare August 19, 2024 14:26
@roney492
Copy link

roney492 commented Sep 2, 2024

Any update on this?

@mlsmaycon mlsmaycon requested a review from pappz September 10, 2024 08:27
@pernetz
Copy link

pernetz commented Sep 25, 2024

Not sure if I understand this feature request correctly. Is it meant to access a remote network computer (w/o netbird client) via IP from a computer (w/o netbird client) from a local network? I manage to networks with each having one netbird peer online. I want to use these peers to route traffic forward to both LANs. Network routes are properly set on both local routes, but I cannot reach the other side.

@mlsmaycon
Copy link
Collaborator

Not sure if I understand this feature request correctly. Is it meant to access a remote network computer (w/o netbird client) via IP from a computer (w/o netbird client) from a local network? I manage to networks with each having one netbird peer online. I want to use these peers to route traffic forward to both LANs. Network routes are properly set on both local routes, but I cannot reach the other side.

@pernetz This feature is under review and testing now and should not affect your clients at this time. Can you please open a github issue with the problem?

- Handle mgmt server handing out sources instead of single source
- Adds ipset to iptables and sets for nftables when len(sources) > 1
- Make refcounter more generic for that purpose
@lixmal lixmal marked this pull request as ready for review September 27, 2024 15:08
Copy link

sonarqubecloud bot commented Oct 2, 2024

@lixmal lixmal changed the title Add access control support to network routes [management, client] Add access control support to network routes Oct 2, 2024
@lixmal lixmal merged commit ff78637 into main Oct 2, 2024
21 checks passed
@lixmal lixmal deleted the feature/network-route-access-control branch October 2, 2024 11:41
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.

8 participants