[GH-ISSUE #5364] mTLS Auth for Proxy Services #10461

Open
opened 2026-08-05 01:25:59 -04:00 by saavagebueno · 3 comments
Owner

Originally created by @marcschwaiger on GitHub (Feb 17, 2026).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/5364

Is your feature request related to a problem? Please describe.
The current authentication methods for the Reverse Proxy feature (SSO, PIN, Password) are interactive and browser-based. This breaks connectivity for:
​Native Mobile Apps: Apps like Home Assistant, Nextcloud, or Immich often cannot handle OIDC redirects or HTML login forms.
​Machine-to-Machine (M2M): CI/CD runners, webhooks, and IoT devices cannot "log in" via a browser.

Describe the solution you'd like
I propose a fully managed Internal Certificate Authority (CA) within NetBird to handle mTLS authentication and identity propagation.
​1. Built-in CA Management (Dashboard)
​Add a new section in the Dashboard (e.g., Settings > Certificates or a dedicated PKI tab) where:
​One-Click CA: The admin can click "Initialize Internal CA" to have NetBird generate a root CA automatically.
​Import Option: Alternatively, allow uploading an existing Root CA (cert + key) if the user has their own PKI.
​2. Per-User Certificate Issuance
​Allow generating client certificates directly from the "Users" or "Service Users" tab.
​Action: Select a user -> "Issue Client Certificate".
​Output: Download a .p12 or .pem bundle (Key + Cert) that is cryptographically signed by the Internal CA and linked to that user's identity (e.g., CN=alice@example.com).
​Revocation: A "Revoke" button next to the certificate that immediately invalidates it at the Proxy edge.
​3. Proxy Configuration & Identity Headers
​In the "Add/Edit Proxy Service" modal:
​Auth Method: Add "mTLS (Managed)" as an option.
​Validation: The Proxy automatically validates incoming client certs against the Internal CA.
​Identity Injection: Add a toggle: "Forward Identity Headers".
​If enabled, the Proxy extracts the User/Email from the valid certificate (CN or SAN).
​It injects this identity into a configurable HTTP header (default: X-Remote-User, Remote-Email, etc.) sent to the backend.
​Security: The Proxy must strip these headers from the incoming public request to prevent spoofing.

Describe alternatives you've considered
Application-Specific Auth: Relying on the app's own auth (e.g., API tokens/Login Form). This leaves the application login portal exposed to the public internet, which is less secure than pre-authenticating at the edge.

Additional context
This combination allows for a seamless "Single Sign-On" experience for legacy apps and mobile devices:
​Mobile App: The user installs the cert on their phone once.
​Connection: The app connects to https://app.proxy.example.com. NetBird Proxy validates the cert.
​Backend: NetBird injects X-Remote-User: alice@company.com.
​Auto-Login: The backend (e.g., Grafana, Nextcloud) sees the header and logs Alice in automatically without a password prompt.

Originally created by @marcschwaiger on GitHub (Feb 17, 2026). Original GitHub issue: https://github.com/netbirdio/netbird/issues/5364 **Is your feature request related to a problem? Please describe.** The current authentication methods for the Reverse Proxy feature (SSO, PIN, Password) are interactive and browser-based. This breaks connectivity for: ​Native Mobile Apps: Apps like Home Assistant, Nextcloud, or Immich often cannot handle OIDC redirects or HTML login forms. ​Machine-to-Machine (M2M): CI/CD runners, webhooks, and IoT devices cannot "log in" via a browser. **Describe the solution you'd like** I propose a fully managed Internal Certificate Authority (CA) within NetBird to handle mTLS authentication and identity propagation. ​1. Built-in CA Management (Dashboard) ​Add a new section in the Dashboard (e.g., Settings > Certificates or a dedicated PKI tab) where: ​One-Click CA: The admin can click "Initialize Internal CA" to have NetBird generate a root CA automatically. ​Import Option: Alternatively, allow uploading an existing Root CA (cert + key) if the user has their own PKI. ​2. Per-User Certificate Issuance ​Allow generating client certificates directly from the "Users" or "Service Users" tab. ​Action: Select a user -> "Issue Client Certificate". ​Output: Download a .p12 or .pem bundle (Key + Cert) that is cryptographically signed by the Internal CA and linked to that user's identity (e.g., CN=alice@example.com). ​Revocation: A "Revoke" button next to the certificate that immediately invalidates it at the Proxy edge. ​3. Proxy Configuration & Identity Headers ​In the "Add/Edit Proxy Service" modal: ​Auth Method: Add "mTLS (Managed)" as an option. ​Validation: The Proxy automatically validates incoming client certs against the Internal CA. ​Identity Injection: Add a toggle: "Forward Identity Headers". ​If enabled, the Proxy extracts the User/Email from the valid certificate (CN or SAN). ​It injects this identity into a configurable HTTP header (default: X-Remote-User, Remote-Email, etc.) sent to the backend. ​Security: The Proxy must strip these headers from the incoming public request to prevent spoofing. **Describe alternatives you've considered** Application-Specific Auth: Relying on the app's own auth (e.g., API tokens/Login Form). This leaves the application login portal exposed to the public internet, which is less secure than pre-authenticating at the edge. **Additional context** This combination allows for a seamless "Single Sign-On" experience for legacy apps and mobile devices: ​Mobile App: The user installs the cert on their phone once. ​Connection: The app connects to https://app.proxy.example.com. NetBird Proxy validates the cert. ​Backend: NetBird injects X-Remote-User: alice@company.com. ​Auto-Login: The backend (e.g., Grafana, Nextcloud) sees the header and logs Alice in automatically without a password prompt.
saavagebueno added the feature-request label 2026-08-05 01:25:59 -04:00
Author
Owner

@jschaufuss commented on GitHub (Feb 18, 2026):

would love to see this added

<!-- gh-comment-id:3922723738 --> @jschaufuss commented on GitHub (Feb 18, 2026): would love to see this added
Author
Owner

@Craftefix commented on GitHub (Feb 20, 2026):

its the only reason we cant switch to netbird

<!-- gh-comment-id:3934864091 --> @Craftefix commented on GitHub (Feb 20, 2026): its the only reason we cant switch to netbird
Author
Owner

@marcschwaiger commented on GitHub (Feb 20, 2026):

It would be cool if the proxy would be able to read the users netbird identity off the peer cert and allow/deny access based on the users groups. So this feature could be integrated in SSO. And the management server can define what the reverse proxy sends to the service for authenticating the user.

<!-- gh-comment-id:3936164743 --> @marcschwaiger commented on GitHub (Feb 20, 2026): It would be cool if the proxy would be able to read the users netbird identity off the peer cert and allow/deny access based on the users groups. So this feature could be integrated in SSO. And the management server can define what the reverse proxy sends to the service for authenticating the user.
Sign in to join this conversation.
No Label feature-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#10461