Provision the release-bound Windows maintenance helper on enrolled development devices

This commit is contained in:
2026-11-17 16:35:01 +01:00
parent a799272d91
commit 863dcb04b1
9 changed files with 215 additions and 34 deletions
+8 -2
View File
@@ -38,6 +38,8 @@ struct Config {
job_binding_file: Option<PathBuf>,
#[serde(default)]
localservice_time_policy: Option<PathBuf>,
#[serde(default)]
windows_update_helper: bool,
// Explicit protected opt-in only; this flag never qualifies a clock or pins.
#[serde(default)]
enable_jobs: bool,
@@ -97,6 +99,9 @@ impl Config {
fn read(path: &Path) -> Result<Self> {
let raw = protected_read(path, 32768)?;
let config: Self = serde_json::from_slice(&raw)?;
if config.windows_update_helper {
ensure!(config.localservice_time_policy.is_some() && cfg!(feature = "system-helper"), "ENROLLED_WINDOWS_UPDATE_HELPER_REQUIRED");
}
if let Some(policy) = &config.localservice_time_policy {
let parent = path.parent().context("CONFIG_PARENT")?;
ensure!(policy == &parent.join("job-time.json")
@@ -812,7 +817,7 @@ impl Agent {
&identity.certificate_pem,
&identity.private_key_pem,
)?;
let helper = if self.config.localservice_time_policy.is_some() {
let helper = if self.config.localservice_time_policy.is_some() && !self.config.windows_update_helper {
None
} else { rmm_agent_windows::helper_runtime::Client::discover(
&self.identity.agent_id,
@@ -1400,7 +1405,8 @@ impl Agent {
Ok(())
}
fn supported_job(&self, job: &rmm_domain::jobs::JobPayload) -> bool {
if self.config.localservice_time_policy.is_some() && job.execution_identity != "agent_service" {
if self.config.localservice_time_policy.is_some() && job.execution_identity != "agent_service"
&& !(self.config.windows_update_helper && job.execution_identity == "system" && job.action.windows_update_or_identity_probe()) {
return false;
}
if self.config.windows_echo_probe_only