[PR #5175] feat(scripts): T-5.4 Bootstrap Script v2.0 with Smart Selection #25168

Open
opened 2026-08-05 06:09:37 -04:00 by saavagebueno · 0 comments
Owner

Original Pull Request: https://github.com/netbirdio/netbird/pull/5175

State: closed
Merged: No


Summary

  • Updates bootstrap-new-client.ps1 for v3.6 Smart Certificate Selection
  • Adds security improvements: Setup-Key redaction, REVOKE warning, verification docs

Changes

  • Smart Selection v3.6: Uses machine_cert_template_name + machine_cert_san_must_match instead of hardcoded thumbprint
  • REVOKE Warning: Prominent security box at script end reminding to revoke Setup-Key in Dashboard
  • Secret Redaction: Setup-Key shown as ****-****-****-****-XXXX (only last 4 chars visible)
  • Security Docs: Added in .NOTES section:
    • SHA256 checksum verification instructions
    • Authenticode signing instructions
    • Setup-Key handling best practices

Test Evidence

Windows VM WhatIf Mode Test:

Step 1: Pre-Tunnel NTP Sync (Public NTP)
What if: Performing the operation "Configure public NTP" on target "W32Time".

Step 2: Starting NetBird Machine Service (Phase 1: Setup-Key)
What if: Performing the operation "Install and start with Setup-Key" on target "NetBirdMachine".

Step 3: Verifying DC Connectivity via Tunnel
  Testing LDAP (port 389)... [OK] OK
  Testing Kerberos (port 88)... [OK] OK
  Testing DNS (port 53)... [OK] OK
[OK] All required DC ports reachable via tunnel

Step 4: NTP Sync with Domain Controller
What if: Performing the operation "Configure DC NTP" on target "W32Time".

Step 5: Domain Join
[OK] Computer is already joined to test.local

Step 6: Machine Certificate Enrollment
What if: Performing the operation "Request machine certificate" on target "AD CS".

Step 7: Updating NetBird Config for mTLS (Phase 2 - Smart Selection)
What if: Performing the operation "Enable mTLS with Smart Selection" on target "C:\ProgramData\NetBird\config.yaml".

Step 8: Completing Bootstrap
╔═══════════════════════════════════════════════════════════════════╗
║  ⚠️  SECURITY ACTION REQUIRED                                      ║
║  REVOKE the Setup-Key in NetBird Dashboard immediately!           ║
║  Setup-Key used: ****-****-****-****-7890                         ║
╚═══════════════════════════════════════════════════════════════════╝

DoD Checklist

  • Script mit allen 8 Schritten
  • DC-Connectivity Prüfung vor Join
  • NTP-Sync vor Join (Kerberos)
  • Smart Selection Config (kein Thumbprint)
  • Warnung: "REVOKE setup-key!"
  • Error-Handling für jeden Schritt
  • Integration Test: WhatIf Mode auf Windows VM
  • Keine Secrets in Logs (Setup-Key redacted)
  • Script-Signatur via Authenticode (dokumentiert)
  • Checksum-Verifikation dokumentieren

Closes #50

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added Windows machine tunnel bootstrap with two-phase authentication (Setup-Key Phase 1, mTLS Phase 2)
    • Implemented mTLS-based machine peer registration and management on dedicated port 33074
    • Added automated machine certificate enrollment and renewal via Active Directory Certificate Services
    • Introduced Domain Controller connectivity validation before domain join
    • Added PowerShell automation for client bootstrap, lab setup, and service installation
  • Configuration & Infrastructure

    • Enhanced server configuration with mTLS settings (port, CA certificates, issuer validation, domain mappings)
    • Added git hooks for code formatting and secret detection
    • Configured Dependabot for dependency updates and GitHub Actions for automated labeling and PR linting

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

**Original Pull Request:** https://github.com/netbirdio/netbird/pull/5175 **State:** closed **Merged:** No --- ## Summary - Updates `bootstrap-new-client.ps1` for v3.6 Smart Certificate Selection - Adds security improvements: Setup-Key redaction, REVOKE warning, verification docs ## Changes - **Smart Selection v3.6**: Uses `machine_cert_template_name` + `machine_cert_san_must_match` instead of hardcoded thumbprint - **REVOKE Warning**: Prominent security box at script end reminding to revoke Setup-Key in Dashboard - **Secret Redaction**: Setup-Key shown as `****-****-****-****-XXXX` (only last 4 chars visible) - **Security Docs**: Added in .NOTES section: - SHA256 checksum verification instructions - Authenticode signing instructions - Setup-Key handling best practices ## Test Evidence ``` Windows VM WhatIf Mode Test: Step 1: Pre-Tunnel NTP Sync (Public NTP) What if: Performing the operation "Configure public NTP" on target "W32Time". Step 2: Starting NetBird Machine Service (Phase 1: Setup-Key) What if: Performing the operation "Install and start with Setup-Key" on target "NetBirdMachine". Step 3: Verifying DC Connectivity via Tunnel Testing LDAP (port 389)... [OK] OK Testing Kerberos (port 88)... [OK] OK Testing DNS (port 53)... [OK] OK [OK] All required DC ports reachable via tunnel Step 4: NTP Sync with Domain Controller What if: Performing the operation "Configure DC NTP" on target "W32Time". Step 5: Domain Join [OK] Computer is already joined to test.local Step 6: Machine Certificate Enrollment What if: Performing the operation "Request machine certificate" on target "AD CS". Step 7: Updating NetBird Config for mTLS (Phase 2 - Smart Selection) What if: Performing the operation "Enable mTLS with Smart Selection" on target "C:\ProgramData\NetBird\config.yaml". Step 8: Completing Bootstrap ╔═══════════════════════════════════════════════════════════════════╗ ║ ⚠️ SECURITY ACTION REQUIRED ║ ║ REVOKE the Setup-Key in NetBird Dashboard immediately! ║ ║ Setup-Key used: ****-****-****-****-7890 ║ ╚═══════════════════════════════════════════════════════════════════╝ ``` ## DoD Checklist - [x] Script mit allen 8 Schritten - [x] DC-Connectivity Prüfung vor Join - [x] NTP-Sync vor Join (Kerberos) - [x] Smart Selection Config (kein Thumbprint) - [x] Warnung: "REVOKE setup-key!" - [x] Error-Handling für jeden Schritt - [x] Integration Test: WhatIf Mode auf Windows VM - [x] Keine Secrets in Logs (Setup-Key redacted) - [x] Script-Signatur via Authenticode (dokumentiert) - [x] Checksum-Verifikation dokumentieren Closes #50 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added Windows machine tunnel bootstrap with two-phase authentication (Setup-Key Phase 1, mTLS Phase 2) * Implemented mTLS-based machine peer registration and management on dedicated port 33074 * Added automated machine certificate enrollment and renewal via Active Directory Certificate Services * Introduced Domain Controller connectivity validation before domain join * Added PowerShell automation for client bootstrap, lab setup, and service installation * **Configuration & Infrastructure** * Enhanced server configuration with mTLS settings (port, CA certificates, issuer validation, domain mappings) * Added git hooks for code formatting and secret detection * Configured Dependabot for dependency updates and GitHub Actions for automated labeling and PR linting <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
saavagebueno added the pull-request label 2026-08-05 06:09:37 -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#25168