Enable per-order privileged scripts on managed devices

This commit is contained in:
2026-11-18 00:02:17 +01:00
parent 2aa460e337
commit ea87d8141c
20 changed files with 864 additions and 157 deletions
@@ -42,12 +42,21 @@ pub fn qualified(
pin.validate()?;
let (settings, _handles) = helper_system::read_settings()?;
ensure!(serde_json::to_vec(&settings.pin()?)? == serde_json::to_vec(pin)?, "system qualification pin");
if settings.windows_update_only() {
// The caller has verified an independent helper-role clock and the live
// peer. Only the two built-in scripts pass both local and server gates.
return Ok(vec!["helper.system.v1".into(), format!("helper.binary.sha256:{}",pin.helper.binary_sha256),
format!("helper.policy.sha256:{}",pin.policy_sha256), "system:run_script".into(),
rmm_domain::jobs::WINDOWS_UPDATE_LONG_CAPABILITY.into()]);
if settings.windows_update_only() || settings.managed_scripts() {
// The caller has verified the live enrolled peer and its independent clock.
let mut caps = vec![
"helper.system.v1".into(),
format!("helper.binary.sha256:{}", pin.helper.binary_sha256),
format!("helper.policy.sha256:{}", pin.policy_sha256),
"system:run_script".into(),
];
if settings.windows_update_max_runtime_seconds.is_some() {
caps.push(rmm_domain::jobs::WINDOWS_UPDATE_LONG_CAPABILITY.into());
}
if settings.managed_scripts() {
caps.push(rmm_domain::jobs::FULL_MAINTENANCE_CAPABILITY.into());
}
return Ok(caps);
}
let ordinary = load_ordinary(pin);
let (q, result_bytes) = match ordinary {