mirror of
https://github.com/netbirdio/netbird.git
synced 2026-07-11 08:31:59 -04:00
* Initial scaffolding * Applies MDM override * Unit tests * Helpers business logic * Return error if trying to modify any config that is gated by MDM * Add ManagedFields to returned config over GetConfig * Adds initial 101 MDM policy business logic testing * gRPC MDM changes * MDM Name scoping for clarity * Implements windows loading of MDM policy * Adds missing WGPort config * Cleanup setupKey to align to linear * Align split tunnel code * Adds some log * Prefix every log with MDM * Adds debug config cobra command This can be useful for troubleshooting and checking config now that its resolution is not trivial defaults > config > env cars > CLI/UI > MDM * Adds MDM 1m diff checker & reloader * Adds also up/start after cancel * Publishes event for UI to sync upon MDM changes * Add events to resync UI to actual config This also provide fixup for UI no aligning to changed config when coming from cli up with config flags. * UI behavior conflicts relaxation UI sends full config snapshot with all values. It doesn't make sense to block it if the values are aligned with the values constrained by the MDM policy. It's just simplier to allow values that are compliant. (this goes for the CLI as well at this point) * Lock toggle Settngs * Advanced Settings locking * Fixup presharedkey * Apply MDM locks * Toggle gray in/out for Advanced Settings * Adds support for disabling of Profiles and UpdateSettings feature flags * Adds Gate Login as well when --disable-update-settings=true is given to service This commit tries to settle things with an old PR-4237 which had relaxed the case where the SetConfig returned an `Unavailable` code error. Under this circumnstance the PR allowed the upFunc to just emit a warning and progress further with the login gRPC. Since the login call is consuming the --management-url coming from the `up` command, it might be possible to abuse the "Unavailable" code to inject a management URL that is different from the configured one even though the --disable-update-settings is set to true (?) * Evaluate disable-update-settings errors only when there's an actual override * [UI] Fixup advanced Settings * [UI] Fixup for preshared key * [UI] Fixup for profile enable/disable toggle We need to align the initial state to evaluate the delta in case. The initial state has to be "true" since the profile starts visible. Then we receive MDM and transition the cache bool value to the actual MDM imposed state * Enforces disable networks * [UI] Aligns to "enable/disable once on change only" * Fixup: MDM wins. always * Removes --disable-advanced-settings It was a typo in our meetings. the actual thing is --disable-update-settings * [PROTO] Removes --disable-advanced-settings * [UI] Removes --disable-advanced-settings * Pins feat profile retrieval to notif event * [UI] Fix for "hide" not working when propagating to parent with children * Adds dep for reading plist files * Introduces support for darwing plist loading * Tests MDM config reload via ticker * [PROVISIONING] ADMX/ADML/PS/bash scripts/templates * CI fixes - Add docstrings to `mdm_integration` - refactor for cognitive complexity - mod tidy * Linting * Add docstrings to `mdm_integration` * nil,nil is no policy and no error. Allow it * nil,nil is no policy and no error. Allow it * exclude MDM profile adminstrated keys data from debug bundle * Fixes Rosenpass left disable after MDM unlock * Partial revert coderabbit added docstrings * Renaming fix * Avoid locking on clientRunning bool when the connection is aborted for whatever reason We want to just signal this through the giveUpChan, we will manage the signal from the waiter side and in case set it to false there. THis way we avoid locking, which should allow the MDM down+wait_for_term_chan_signal_+up procedure clientRunning is used to signal two different conditions here: 1. the initialization procedure is over (we have an engine) 2. the connection being up (or being attempted) Probably these two functionalities should not alias, and the failure of the second condition (because of any error) should just drive a reconnection (currently it's not happening, and we silently go idle). OR, mor probably, the two things are the SAME and there should not exist a case where we did the "Up" initialization and connection attempt but we are not still attempting it. * Moves test helper at te very bottom * Addresses github comments * No lock no copy * Prevents engine not stopping within 10 secs from being paired by another instance We instead juts SKIP updating the policy, so 1. the MDM ticker will kick in 1 minute time, 2. find the policy misaligned, 3. enter the onMDMPolicyChange, 4. find the s.clientRunning == true (because it is set to false only in server cleanupConnection, and not by s.actCancel()) 5. call s.actCancel() again if not nil 6. immediately return from <-s.clientGiveUpChan 7. finally call s.restartEngineForMDMLocked() * Since we ARE running there should be a config If the config was cancelled midflight, connect will abort later on * DisableAutoConnect should not stop a running connection. DisableAutoConnect should just avoid the connection attempts *when the service starts*. If we are started and we are up and running, DisableAutoConnect should not kick in. Another PR will follow about this topic * Removes unused vars * Moves callback into Run method arg * align comment to removal of DisableAutoConnect DisableAutoConnect should just avoid the connection attempts *when the service starts*. If we are started and we are up and running, DisableAutoConnect should not kick in * Removes unused managed_fields data. This was initially used to drive the UI but approach changed to reload config/features upon notifications which makes this data redundant. * Reorder stuff * Unexport unrequired vars/functions PoliciesEqual → policiesEqual AllKeys → allKeys * Adds list of MDM managed fields in the debug bundle
127 lines
4.1 KiB
Plaintext
127 lines
4.1 KiB
Plaintext
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
<!--
|
|
NetBird MDM preferences (macOS) — bare plist for MDM platforms that
|
|
accept a managed-preferences plist tied to a bundle identifier
|
|
(e.g. JumpCloud "Mac Application Custom Settings", Mosyle "Custom
|
|
Settings", Jamf "Application & Custom Settings" → External
|
|
Application).
|
|
|
|
Bundle identifier (preference domain): io.netbird.client
|
|
|
|
The MDM provider will wrap this plist into a Configuration Profile
|
|
payload of type com.apple.ManagedClient.preferences and push it to
|
|
target devices via the Apple MDM protocol. The OS materializes the
|
|
final file at:
|
|
/Library/Managed Preferences/io.netbird.client.plist
|
|
which is what the NetBird daemon's client/mdm/policy_darwin.go
|
|
loader reads on every 1-minute MDM reload tick.
|
|
|
|
For MDM platforms that expect a full Configuration Profile instead
|
|
of a bare plist (Custom Configuration Profile / .mobileconfig upload),
|
|
use docs/netbird-macos.mobileconfig — same keys, additional Payload*
|
|
envelope.
|
|
|
|
Editing this file:
|
|
- Remove or comment out any key you do NOT want to enforce. The
|
|
daemon treats an absent key as "no enforcement" for that field.
|
|
- Keep the document well-formed XML. Validate locally with:
|
|
plutil -lint docs/io.netbird.client.plist
|
|
- Keys are camelCase; values are typed (<string>, <true/>, <false/>,
|
|
<integer>). See docs/src/pages/client/mdm-integration.mdx (the
|
|
public docs page) for the full reference.
|
|
|
|
Persistence caveat:
|
|
macOS wipes /Library/Managed Preferences/ at every boot on
|
|
devices that are NOT MDM-enrolled. This plist only sticks across
|
|
reboots when delivered through a real MDM channel. For local
|
|
testing on an un-enrolled host, write the file manually as root
|
|
and accept it will not survive the next boot.
|
|
-->
|
|
<plist version="1.0">
|
|
<dict>
|
|
|
|
<!-- ===== Identity / auth ===== -->
|
|
<key>managementURL</key>
|
|
<string>https://api.netbird.io:443</string>
|
|
|
|
<!--
|
|
Pre-shared key: secret. Remove the entry entirely when not used;
|
|
do NOT leave an empty <string></string>, which the daemon would
|
|
otherwise treat as a deliberate empty-PSK enforcement.
|
|
-->
|
|
<!--
|
|
<key>preSharedKey</key>
|
|
<string>REPLACE_ME</string>
|
|
-->
|
|
|
|
<!-- ===== Engine / runtime behavior =====
|
|
Each key is optional. Remove or comment out to leave the
|
|
field unmanaged on the client. -->
|
|
|
|
<key>allowServerSSH</key>
|
|
<true/>
|
|
|
|
<!--
|
|
<key>disableAutoConnect</key>
|
|
<false/>
|
|
|
|
<key>disableClientRoutes</key>
|
|
<false/>
|
|
|
|
<key>disableServerRoutes</key>
|
|
<false/>
|
|
|
|
<key>blockInbound</key>
|
|
<false/>
|
|
|
|
<key>rosenpassEnabled</key>
|
|
<true/>
|
|
|
|
<key>rosenpassPermissive</key>
|
|
<false/>
|
|
-->
|
|
|
|
<!-- ===== WireGuard UDP port =====
|
|
Range 1-65535. Omit to keep the daemon default. -->
|
|
<!--
|
|
<key>wireguardPort</key>
|
|
<integer>51820</integer>
|
|
-->
|
|
|
|
<!-- ===== UI / lockdown kill switches =====
|
|
disableUpdateSettings : block every config change from UI and CLI
|
|
on this device (Settings view stays
|
|
readable but read-only).
|
|
disableProfiles : hide the profile menu, reject profile CRUD.
|
|
disableNetworks : hide the Networks / Exit Node menus,
|
|
reject the related RPCs.
|
|
disableMetricsCollection: opt out of anonymous usage telemetry. -->
|
|
<!--
|
|
<key>disableUpdateSettings</key>
|
|
<true/>
|
|
|
|
<key>disableProfiles</key>
|
|
<true/>
|
|
|
|
<key>disableNetworks</key>
|
|
<true/>
|
|
|
|
<key>disableMetricsCollection</key>
|
|
<false/>
|
|
-->
|
|
|
|
<!-- ===== Split tunnel =====
|
|
Android-only at the client level. Safe to ship on macOS for
|
|
mixed-platform fleets; the macOS daemon parses and ignores. -->
|
|
<!--
|
|
<key>splitTunnelMode</key>
|
|
<string>allow</string>
|
|
|
|
<key>splitTunnelApps</key>
|
|
<string>com.acme.app1,com.acme.app2</string>
|
|
-->
|
|
|
|
</dict>
|
|
</plist>
|