Qualify tenant-scoped bootstrap rotation and fresh Windows scripting
This commit is contained in:
@@ -80,19 +80,13 @@ pub fn qualified(
|
||||
for action in q.actions {
|
||||
match action.as_str() {
|
||||
"run_script" => {
|
||||
ensure!(
|
||||
settings.schema_version >= 3
|
||||
&& settings.allowed_script_profiles.as_deref()
|
||||
== Some(&[
|
||||
rmm_domain::jobs::PrivilegedScriptProfile::FullMaintenanceV1
|
||||
])
|
||||
&& crate::actions::powershell().is_ok(),
|
||||
"system script qualification policy"
|
||||
);
|
||||
if settings.windows_update_max_runtime_seconds.is_some() {
|
||||
caps.push(rmm_domain::jobs::WINDOWS_UPDATE_LONG_CAPABILITY.to_owned());
|
||||
}
|
||||
caps.extend(["system:run_script", "script.full_maintenance/1"].map(str::to_string));
|
||||
let general = settings.allowed_script_profiles.as_deref() ==
|
||||
Some(&[rmm_domain::jobs::PrivilegedScriptProfile::FullMaintenanceV1]);
|
||||
let windows_update = settings.windows_update_max_runtime_seconds.is_some();
|
||||
ensure!(settings.schema_version >= 3 && (general || windows_update), "system script qualification policy");
|
||||
caps.push("system:run_script".into());
|
||||
if general { caps.push(rmm_domain::jobs::FULL_MAINTENANCE_CAPABILITY.to_owned()); }
|
||||
if windows_update { caps.push(rmm_domain::jobs::WINDOWS_UPDATE_LONG_CAPABILITY.to_owned()); }
|
||||
}
|
||||
"set_service_state" => {
|
||||
ensure!(
|
||||
|
||||
Reference in New Issue
Block a user