Deploy gate: ScriptWorker isolation installer (identity, pipe ACL, firewall, PeCacheDir ACL) on QA (lmxopcua#780) #794
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Deploy gate for the lmxopcua#780 installer slice (
2a8e2981). None of it has run on a real node: windev is a build box only, so no account, firewall rule or persistent ACL was created there. Run it on one QA node first (vq03), during or after the P2 shadow week, before the P3OutOfProcessflip.What is verified so far: the dry-run harness
pwsh -File scripts/install/tests/Test-ScriptWorkerIsolation.ps1(46 assertions), andWorkerIsolationTestson windev. Those cover the pipe ACL, the restricted token's access, and a real restricted worker running a script. The installer itself has not run on Windows. Rollback isInstall-ScriptWorkerIsolation.ps1 … -ConfigureHostService -Uninstall, then restart the host (or just unsetScripting__Worker__Identity).Steps on the QA node (an elevated session, as part of a user-requested deploy)
2a8e2981: a self-contained win-x64 publish, so thatscript-worker\ZB.MOM.WW.OtOpcUa.ScriptWorker.exeexists..\Install-ScriptWorkerIsolation.ps1 -InstallRoot <root> -HostServiceAccount <OtOpcUaHost account> -ConfigureHostService -WhatIf. Check that it prints 7 steps and changes nothing.-WhatIf, then run it again. The second run must report every stepunchanged(idempotency).sc.exe qc OtOpcUaScriptWorker: start type DISABLED, SERVICE_START_NAMENT SERVICE\OtOpcUaScriptWorker.sc.exe showsid OtOpcUaScriptWorkershould giveS-1-5-80-1846135827-3903057317-1998105452-3938448374-3023753135.icacls <PeCacheDir>: protected; SYSTEM, Administrators and the host account full control; no Users.icacls <PeCacheDir>\peaddsNT SERVICE\OtOpcUaScriptWorker:(OI)(CI)(M).icacls <root>:NT SERVICE\OtOpcUaScriptWorker:(OI)(CI)(DENY)(RD).icacls <root>\script-worker: identity(OI)(CI)(RX).Get-NetFirewallRule -Name OtOpcUa-ScriptWorker-BlockOutbound | Get-NetFirewallApplicationFilter: the program is the worker exe; the rule is Outbound / Block / Any.EnvironmentcontainsScripting__Worker__IdentityandScripting__Worker__PeCacheDir, and the other entries are intact.Scripting:Runner=Shadow(orOutOfProcessfor Calculation only), restart the host and check:otopcua_script_worker_up{shard}= 1 andscript-runneris Healthy. NoScriptWorker[..] failed to startlines.IsTokenRestrictedvia a one-off script.ERROR_DLL_INIT_FAILED(0x80008089 worker exit).<PeCacheDir>\pe\*.peappears, and on a restartotopcua_script_compile{cache="hit"}rises.-Uninstall -ConfigureHostServiceand restart. Workers then run unrestricted, and a second uninstall reportsunchanged. Re-apply afterwards if the shadow week continues.Watch-outs
dotnet.exe) is not covered by the program-scoped firewall rule. The Windows installs are self-contained, so this should not apply.