[client] Address review: redact and clear the MDM upload URL

- Never log the MDM-provided upload URL (it can embed credentials or
  signed query tokens): mark the key secret so it is redacted, and drop
  the raw value from the invalid-URL warning.
- Clear DebugBundleUploadURL when a replacement policy no longer carries
  the key, so a removed override can never keep directing uploads to a
  previously-enforced host; covered by a policy-replacement test.
- macOS docs: state "https URL with a host" consistently, and make the
  managed-plist helper fail closed on an invalid allowRemoteJobs value
  (emit false rather than dropping the key).
This commit is contained in:
mlsmaycon
2026-08-12 09:13:44 +00:00
committed by Maycon Santos
parent 90db57e3e5
commit c9568ba909
5 changed files with 27 additions and 8 deletions

View File

@@ -125,8 +125,8 @@
allowRemoteJobs : opt into management-requested
remote jobs. Off by default.
debugBundleUploadURL : override the debug-bundle upload
service (https URL); precedence
over the management value. -->
service (https URL with a host);
precedence over the management value. -->
<!--
<key>allowRemoteJobs</key>
<true/>

View File

@@ -57,7 +57,7 @@ managementURL='https://api.netbird.io:443'
preSharedKey="$NULL" # secret; redacted in log
allowServerSSH='true'
allowRemoteJobs="$NULL"
debugBundleUploadURL="$NULL" # https URL; overrides management
debugBundleUploadURL="$NULL" # HTTPS URL with a host; overrides management
blockInbound="$NULL"
disableAutoConnect="$NULL"
disableAutostart="$NULL"
@@ -130,7 +130,7 @@ emit_bool() {
case "$value" in
true|True|TRUE|1|yes) xml_bool='<true/>' ; value='true' ;;
false|False|FALSE|0|no) xml_bool='<false/>' ; value='false' ;;
*) log "invalid boolean for $key: $value (must be true/false); skipping"; return ;;
*) log "invalid boolean for $key: $value (must be true/false)"; return 1 ;;
esac
printf ' <key>%s</key>\n %s\n' "$key" "$xml_bool" >> "$PLIST_PATH.tmp"
log "set $key = $value"
@@ -156,7 +156,11 @@ main() {
is_set "$managementURL" && emit_string managementURL "$managementURL"
is_set "$preSharedKey" && emit_string preSharedKey "$preSharedKey"
is_set "$allowServerSSH" && emit_bool allowServerSSH "$allowServerSSH"
is_set "$allowRemoteJobs" && emit_bool allowRemoteJobs "$allowRemoteJobs"
# Fail closed: an invalid allowRemoteJobs value must not drop the key and
# leave a conflicting local opt-in active — enforce the safe default (false).
if is_set "$allowRemoteJobs"; then
emit_bool allowRemoteJobs "$allowRemoteJobs" || emit_bool allowRemoteJobs false
fi
is_set "$debugBundleUploadURL" && emit_string debugBundleUploadURL "$debugBundleUploadURL"
is_set "$blockInbound" && emit_bool blockInbound "$blockInbound"
is_set "$disableAutoConnect" && emit_bool disableAutoConnect "$disableAutoConnect"