mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-08 14:39:09 +02:00
[management,client] Gate remote jobs behind an admin opt-in with MDM support (#7153)
This introduces a disabled-by-default allow-remote-jobs setting that controls whether the management server may run jobs (such as debug bundles) on a peer. The flag propagates end to end: through client configuration, the daemon SetConfig and Login requests, authentication, and system info, up to management, where it is stored on the peer and exposed on the peers API as remote_jobs_allowed. The client refuses any management-requested job unless the peer has opted in. Because enabling remote jobs crosses the user-to-root boundary, turning it on requires privilege, mirroring the SSH-server gate. Administrators can enforce the setting through MDM policy on both macOS and Windows, and MDM can also override the debug-bundle upload URL. The change ships policy documentation and generated profile templates, and adds configuration, conflict, and enforcement tests covering the opt-in, privilege, and MDM paths.
This commit is contained in:
@@ -32,6 +32,8 @@ var allKeys = []string{
|
||||
KeySplitTunnelMode,
|
||||
KeySplitTunnelApps,
|
||||
KeyLazyConnection,
|
||||
KeyRemoteJobsAllowed,
|
||||
KeyBundleUploadURL,
|
||||
}
|
||||
|
||||
// canonicalKey maps the lowercase form of a managed-config value name to
|
||||
|
||||
@@ -62,6 +62,17 @@ const (
|
||||
// the management feature flag. Read as a bool (native bool, or on/off,
|
||||
// true/false, 1/0, yes/no); absent = defer to management.
|
||||
KeyLazyConnection = "lazyConnection"
|
||||
|
||||
// KeyRemoteJobsAllowed opts the peer into management-requested remote jobs
|
||||
// (e.g. debug bundles). Read as a bool; absent = defer to the local config
|
||||
// (which defaults to disabled). Stored on Config as RemoteJobsAllowed.
|
||||
KeyRemoteJobsAllowed = "allowRemoteJobs"
|
||||
|
||||
// KeyBundleUploadURL overrides the debug-bundle upload service URL for
|
||||
// remote jobs, taking precedence over the management-supplied value. Read
|
||||
// as a string; must be an https URL with a host. Absent = defer to the
|
||||
// management-supplied URL (or the default upload server).
|
||||
KeyBundleUploadURL = "debugBundleUploadURL"
|
||||
)
|
||||
|
||||
// Split-tunnel mode literals (KeySplitTunnelMode values).
|
||||
@@ -73,6 +84,8 @@ const (
|
||||
// SecretKeys lists keys whose values must be redacted in logs.
|
||||
var SecretKeys = map[string]struct{}{
|
||||
KeyPreSharedKey: {},
|
||||
// The upload URL can embed credentials or signed query tokens.
|
||||
KeyBundleUploadURL: {},
|
||||
}
|
||||
|
||||
// boolStringLiterals enumerates the textual boolean encodings the
|
||||
|
||||
Reference in New Issue
Block a user