feat(admin): #1078 headless POST /api/cluster/failover (key-gated, same service+audit) and unattended SCM-restart gate

fix(install): #1075 worker identity gets read+execute (not Modify) on <PeCacheDir>\pe; re-run replaces the old grant
This commit is contained in:
Joseph Doherty
2026-12-03 16:29:27 -05:00
parent fe4bbbe256
commit 762bcd7b8d
10 changed files with 229 additions and 12 deletions
+7 -5
View File
@@ -72,7 +72,7 @@ function Get-OtOpcUaPeCacheSddl {
The PeCacheDir root's security descriptor: owner Administrators, PROTECTED (no inherited Users/Everyone/
Authenticated Users), SYSTEM + Administrators + the host account full control (container + object inherit).
The worker identity gets NOTHING here — the HMAC key (pe-cache.key) and the launch markers (workers\) stay
host-only; the worker's one writable place is the pe\ subfolder (Get-OtOpcUaPeEntriesAce).
host-only; the worker can only READ the pe\ subfolder (Get-OtOpcUaPeEntriesAce, #1075).
#>
param([Parameter(Mandatory)] [string]$HostSid)
$aces = @(
@@ -84,9 +84,11 @@ function Get-OtOpcUaPeCacheSddl {
}
function Get-OtOpcUaPeEntriesAce {
# pe\ : the worker compiles in-process (owner decision §14 #7) and writes HMAC'd entries here — Modify, inherited.
# pe\ : read and execute only, inherited (lmxopcua#1075). Since #1014 the host verifies, compiles and writes every entry and
# sends verified images over the pipe, so the worker never writes here. Set-OtOpcUaExplicitAce PURGES the identity's existing
# explicit ACEs before adding this one, so a re-run on a box installed with the old Modify grant replaces it (idempotent upgrade).
param([Parameter(Mandatory)] [string]$WorkerSid)
Format-OtOpcUaAce -Type A -Flags 'OICI' -Mask $script:Modify -Sid $WorkerSid
Format-OtOpcUaAce -Type A -Flags 'OICI' -Mask $script:ReadAndExecute -Sid $WorkerSid
}
function Get-OtOpcUaScriptWorkerFolderAce {
@@ -220,8 +222,8 @@ function Get-ScriptWorkerIsolationPlan {
"create the PE cache directory and set its ACL (protected; SYSTEM, Administrators, host account full control; no Users; no worker access to the key or markers)" `
@{ Path = $cache; Sddl = (Get-OtOpcUaPeCacheSddl -HostSid $HostSid) }))
$steps.Add((New-OtOpcUaPlanStep 'PeEntriesDir' $entries `
"create the PE entries directory and grant the worker identity Modify (it compiles and writes HMAC'd entries)" `
@{ Path = $entries; Ace = (Get-OtOpcUaPeEntriesAce -WorkerSid $workerSid); Sid = $workerSid; Mask = $script:Modify; Type = 'Allow' }))
"create the PE entries directory and grant the worker identity read+execute only (host-side signing since #1014; replaces an older Modify grant on re-run)" `
@{ Path = $entries; Ace = (Get-OtOpcUaPeEntriesAce -WorkerSid $workerSid); Sid = $workerSid; Mask = $script:ReadAndExecute; Type = 'Allow' }))
$steps.Add((New-OtOpcUaPlanStep 'WorkerFolderAcl' $workerFolder `
"grant the worker identity read+execute on its own binaries" `
@{ Path = $workerFolder; Ace = (Get-OtOpcUaScriptWorkerFolderAce -WorkerSid $workerSid); Sid = $workerSid; Mask = $script:ReadAndExecute; Type = 'Allow' }))