[PR #4969] [MERGED] [client, management] Feature/ssh fine grained access #26736

Open
opened 2026-08-05 07:07:44 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/4969
Author: @pappz
Created: 12/18/2025
Status: Merged
Merged: 12/29/2025
Merged by: @pappz

Base: mainHead: feature/ssh-fine-grained-access


📝 Commits (10+)

📊 Changes

32 files changed (+2344 additions, -511 deletions)

View changed files

📝 client/internal/engine.go (+2 -0)
📝 client/internal/engine_ssh.go (+38 -0)
client/ssh/auth/auth.go (+184 -0)
client/ssh/auth/auth_test.go (+612 -0)
📝 client/ssh/proxy/proxy_test.go (+21 -4)
📝 client/ssh/server/jwt_test.go (+18 -0)
📝 client/ssh/server/server.go (+44 -7)
📝 management/internals/controllers/network_map/controller/controller.go (+6 -4)
📝 management/internals/modules/peers/manager.go (+2 -0)
📝 management/internals/shared/grpc/conversion.go (+45 -5)
📝 management/internals/shared/grpc/server.go (+1 -1)
📝 management/server/account.go (+11 -13)
📝 management/server/account_test.go (+1 -1)
📝 management/server/http/handlers/peers/peers_handler.go (+28 -2)
📝 management/server/http/handlers/policies/policies_handler.go (+18 -0)
📝 management/server/peer.go (+2 -2)
📝 management/server/policy_test.go (+16 -16)
📝 management/server/store/sql_store.go (+6 -3)
📝 management/server/types/account.go (+108 -5)
📝 management/server/types/account_test.go (+187 -0)

...and 12 more files

📄 Description

Describe your changes

Add fine-grained SSH access control with authorized users/groups

Stack

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)

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

Documentation

Select exactly one:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (explain why)

Docs PR URL (required if "docs added" is checked)

Paste the PR link from https://github.com/netbirdio/docs here:

https://github.com/netbirdio/docs/pull/530

Summary by CodeRabbit

  • New Features

    • Runtime-updatable SSH access control with per-user hashed IDs and per-OS-user mappings
    • Policy support for a new "netbird-ssh" protocol and per-source-group authorized-users
    • Network maps and login responses now include SSH enablement and per-user authorization
    • Peer API and OpenAPI extended with peer-local flags schema
  • Behavioral Changes

    • Active-group user mappings now factor into network maps and peer resource calculations
    • Peer-update propagation now triggers more broadly for user changes
  • Tests

    • Extensive unit tests added for SSH auth, user hashing, JWT/proxy flows, policies and group behaviors

✏️ Tip: You can customize this high-level summary in your review settings.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbirdio/netbird/pull/4969 **Author:** [@pappz](https://github.com/pappz) **Created:** 12/18/2025 **Status:** ✅ Merged **Merged:** 12/29/2025 **Merged by:** [@pappz](https://github.com/pappz) **Base:** `main` ← **Head:** `feature/ssh-fine-grained-access` --- ### 📝 Commits (10+) - [`ee6d96e`](https://github.com/netbirdio/netbird/commit/ee6d96eac5dbdaf84b21fe868cd457cf946062ba) [management] add authorized users proto (#4961) - [`d378aa6`](https://github.com/netbirdio/netbird/commit/d378aa6d87bcb0a1ff5491e6742cc273994914ee) [client] Feature/ssh fine grained access client (#4962) - [`e898a58`](https://github.com/netbirdio/netbird/commit/e898a5817dfb361ae14a8a8d9df214e18a062552) Fix test - [`437a3a7`](https://github.com/netbirdio/netbird/commit/437a3a7941adc199727275778f1cb452f341ade7) [management] SSH authorized groups api (#4964) - [`1a6fc6c`](https://github.com/netbirdio/netbird/commit/1a6fc6c91729213c514abf6bfcd12d53c16c4243) Fix proxy test - [`d14d2a4`](https://github.com/netbirdio/netbird/commit/d14d2a4c543e4be9c4a591a0aa589d02301306ae) Fix concurency in tests - [`76c1cd1`](https://github.com/netbirdio/netbird/commit/76c1cd10c0648836e5c6fa273ee85bdc85c9f6d2) Merge branch 'main' into feature/ssh-fine-grained-access - [`2cc05ab`](https://github.com/netbirdio/netbird/commit/2cc05abb39dc291f368a768f9b4294fd42e50224) Use BLAKE2b-256 - [`9019747`](https://github.com/netbirdio/netbird/commit/9019747e2face4fd4260949ebb84cc3a5a239def) Use BLAKE2b-128 - [`3b28834`](https://github.com/netbirdio/netbird/commit/3b28834454fab6d26975d3dd828151c667e8505b) Add error handling ### 📊 Changes **32 files changed** (+2344 additions, -511 deletions) <details> <summary>View changed files</summary> 📝 `client/internal/engine.go` (+2 -0) 📝 `client/internal/engine_ssh.go` (+38 -0) ➕ `client/ssh/auth/auth.go` (+184 -0) ➕ `client/ssh/auth/auth_test.go` (+612 -0) 📝 `client/ssh/proxy/proxy_test.go` (+21 -4) 📝 `client/ssh/server/jwt_test.go` (+18 -0) 📝 `client/ssh/server/server.go` (+44 -7) 📝 `management/internals/controllers/network_map/controller/controller.go` (+6 -4) 📝 `management/internals/modules/peers/manager.go` (+2 -0) 📝 `management/internals/shared/grpc/conversion.go` (+45 -5) 📝 `management/internals/shared/grpc/server.go` (+1 -1) 📝 `management/server/account.go` (+11 -13) 📝 `management/server/account_test.go` (+1 -1) 📝 `management/server/http/handlers/peers/peers_handler.go` (+28 -2) 📝 `management/server/http/handlers/policies/policies_handler.go` (+18 -0) 📝 `management/server/peer.go` (+2 -2) 📝 `management/server/policy_test.go` (+16 -16) 📝 `management/server/store/sql_store.go` (+6 -3) 📝 `management/server/types/account.go` (+108 -5) 📝 `management/server/types/account_test.go` (+187 -0) _...and 12 more files_ </details> ### 📄 Description ## Describe your changes Add fine-grained SSH access control with authorized users/groups ## Issue ticket number and link ## Stack <!-- branch-stack --> ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [x] Is a feature enhancement - [ ] It is a refactor - [ ] Created tests that fail without the change (if possible) > By submitting this pull request, you confirm that you have read and agree to the terms of the [Contributor License Agreement](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT.md). ## Documentation Select exactly one: - [x] I added/updated documentation for this change - [ ] Documentation is **not needed** for this change (explain why) ### Docs PR URL (required if "docs added" is checked) Paste the PR link from https://github.com/netbirdio/docs here: https://github.com/netbirdio/docs/pull/530 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Runtime-updatable SSH access control with per-user hashed IDs and per-OS-user mappings * Policy support for a new "netbird-ssh" protocol and per-source-group authorized-users * Network maps and login responses now include SSH enablement and per-user authorization * Peer API and OpenAPI extended with peer-local flags schema * **Behavioral Changes** * Active-group user mappings now factor into network maps and peer resource calculations * Peer-update propagation now triggers more broadly for user changes * **Tests** * Extensive unit tests added for SSH auth, user hashing, JWT/proxy flows, policies and group behaviors <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 07:07:44 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#26736