ac4c4d40dc
v2-ci / unit-tests (push) Has been cancelled
Adds scripts/validation/opcua-windows-service/: a phased PowerShell gate (Invoke-ServiceGate.ps1) that installs the known-good build as the real OtOpcUaHost service via Install-Services.ps1, seeds LocalDb through the production cache API (Seeder, built against the baseline tree), upgrades in place with config/PKI/LocalDb carried with their ACLs, starts/stops through the SCM, runs a strict SDK 2 probe matrix (Sign + SignAndEncrypt, valid/wrong/unknown/disabled/anonymous keys, untrusted client and server), exercises the ScriptWorker isolation, rolls back and cleans up. windev 2026-11-12 (efb9197a->438484fd->efb9197a): app cert CEF9D91F... reused byte-for-byte with identical PKI SDDL on every start, all gating checks pass, 0 secrets in logs. Findings filed: #879 (None endpoint cannot be dropped), #880 (SDK 2 client 65-char key vs SDK 1.5 server: rollback/QA risk), #883 (Install-ScriptWorkerIsolation.ps1 fails on pwsh 7 and 5.1; runtime isolation proven with the patch in the evidence directory). Claude-Session: https://claude.ai/code/session_01GT67ACmpMR7b9LGRPLijMi
101 lines
10 KiB
JSON
101 lines
10 KiB
JSON
{
|
|
"whatIf": {
|
|
"script": "install-candidate-patched",
|
|
"host": "pwsh",
|
|
"args": "-WhatIf",
|
|
"exit": 0,
|
|
"output": "ScriptWorker isolation install: worker identity NT SERVICE\\OtOpcUaScriptWorker (S-1-5-80-1846135827-3903057317-1998105452-3938448374-3023753135), host account NT SERVICE\\OtOpcUaHost (S-1-5-80-3928861625-3486739760-3962757976-1980707066-3667558059)\r\nWhat if: Performing the operation \"AnchorService: register the disabled anchor service 'OtOpcUaScriptWorker' so the virtual account 'NT SERVICE\\OtOpcUaScriptWorker' (S-1-5-80-1846135827-3903057317-1998105452-3938448374-3023753135) resolves by name (never started)\" on target \"OtOpcUaScriptWorker\".\r\nWhat if: Performing the operation \"PeCacheDir: 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)\" on target \"C:\\OtOpcUa800\\state\\pe-cache\".\r\nWhat if: Performing the operation \"PeEntriesDir: create the PE entries directory and grant the worker identity Modify (it compiles and writes HMAC'd entries)\" on target \"C:\\OtOpcUa800\\state\\pe-cache\\pe\".\r\nWhat if: Performing the operation \"WorkerFolderAcl: grant the worker identity read+execute on its own binaries\" on target \"C:\\OtOpcUa800\\OtOpcUa\\script-worker\".\r\nWhat if: Performing the operation \"InstallRootDeny: deny the worker identity ReadData/ListDirectory on the install folder (appsettings, logs, host binaries); script-worker\\ stays readable\" on target \"C:\\OtOpcUa800\\OtOpcUa\".\r\nWhat if: Performing the operation \"FirewallBlockOutbound: add a Windows Firewall rule blocking ALL outbound traffic from 'C:\\OtOpcUa800\\OtOpcUa\\script-worker\\ZB.MOM.WW.OtOpcUa.ScriptWorker.exe' (every profile)\" on target \"OtOpcUa-ScriptWorker-BlockOutbound\".\r\nWhat if: Performing the operation \"HostServiceEnv: set Scripting__Worker__Identity=NT SERVICE\\OtOpcUaScriptWorker and Scripting__Worker__PeCacheDir=C:\\OtOpcUa800\\state\\pe-cache in the 'OtOpcUaHost' service environment (other entries kept; takes effect on the next service start)\" on target \"OtOpcUaHost\".\r\n"
|
|
},
|
|
"whatIfChangedState": false,
|
|
"apply": {
|
|
"script": "install-candidate-patched",
|
|
"host": "pwsh",
|
|
"args": "",
|
|
"exit": 0,
|
|
"output": "ScriptWorker isolation install: worker identity NT SERVICE\\OtOpcUaScriptWorker (S-1-5-80-1846135827-3903057317-1998105452-3938448374-3023753135), host account NT SERVICE\\OtOpcUaHost (S-1-5-80-3928861625-3486739760-3962757976-1980707066-3667558059)\r\n [unchanged] AnchorService OtOpcUaScriptWorker\r\n [unchanged] PeCacheDir C:\\OtOpcUa800\\state\\pe-cache\r\n [changed ] PeEntriesDir C:\\OtOpcUa800\\state\\pe-cache\\pe\r\n [changed ] WorkerFolderAcl C:\\OtOpcUa800\\OtOpcUa\\script-worker\r\n [changed ] InstallRootDeny C:\\OtOpcUa800\\OtOpcUa\r\n [changed ] FirewallBlockOutbound OtOpcUa-ScriptWorker-BlockOutbound\r\n [changed ] HostServiceEnv OtOpcUaHost\r\n\r\nDone. Host configuration for this node:\r\n Scripting:Worker:Identity = NT SERVICE\\OtOpcUaScriptWorker\r\n Scripting:Worker:PeCacheDir = C:\\OtOpcUa800\\state\\pe-cache\r\n Restart OtOpcUaHost for a configuration change to take effect.\r\n\r\n\u001b[32;1mId \u001b[0m\u001b[32;1m Target \u001b[0m\u001b[32;1m Outcome\u001b[0m\r\n\u001b[32;1m-- \u001b[0m \u001b[32;1m------ \u001b[0m \u001b[32;1m-------\u001b[0m\r\nAnchorService OtOpcUaScriptWorker unchanged\r\nPeCacheDir C:\\OtOpcUa800\\state\\pe-cache unchanged\r\nPeEntriesDir C:\\OtOpcUa800\\state\\pe-cache\\pe changed\r\nWorkerFolderAcl C:\\OtOpcUa800\\OtOpcUa\\script-worker changed\r\nInstallRootDeny C:\\OtOpcUa800\\OtOpcUa changed\r\nFirewallBlockOutbound OtOpcUa-ScriptWorker-BlockOutbound changed\r\nHostServiceEnv OtOpcUaHost changed\r\n\r\n"
|
|
},
|
|
"reapply": {
|
|
"script": "install-candidate-patched",
|
|
"host": "powershell.exe",
|
|
"args": "",
|
|
"exit": 0,
|
|
"output": "ScriptWorker isolation install: worker identity NT SERVICE\\OtOpcUaScriptWorker (S-1-5-80-1846135827-3903057317-1998105452-3938448374-3023753135), host account NT SERVICE\\OtOpcUaHost (S-1-5-80-3928861625-3486739760-3962757976-1980707066-3667558059)\r\n [unchanged] AnchorService OtOpcUaScriptWorker\r\n [unchanged] PeCacheDir C:\\OtOpcUa800\\state\\pe-cache\r\n [unchanged] PeEntriesDir C:\\OtOpcUa800\\state\\pe-cache\\pe\r\n [unchanged] WorkerFolderAcl C:\\OtOpcUa800\\OtOpcUa\\script-worker\r\n [unchanged] InstallRootDeny C:\\OtOpcUa800\\OtOpcUa\r\n [unchanged] FirewallBlockOutbound OtOpcUa-ScriptWorker-BlockOutbound\r\n [unchanged] HostServiceEnv OtOpcUaHost\r\n\r\nDone. Host configuration for this node:\r\n Scripting:Worker:Identity = NT SERVICE\\OtOpcUaScriptWorker\r\n Scripting:Worker:PeCacheDir = C:\\OtOpcUa800\\state\\pe-cache\r\n Restart OtOpcUaHost for a configuration change to take effect.\r\n\r\nId Target Outcome \r\n-- ------ ------- \r\nAnchorService OtOpcUaScriptWorker unchanged\r\nPeCacheDir C:\\OtOpcUa800\\state\\pe-cache unchanged\r\nPeEntriesDir C:\\OtOpcUa800\\state\\pe-cache\\pe unchanged\r\nWorkerFolderAcl C:\\OtOpcUa800\\OtOpcUa\\script-worker unchanged\r\nInstallRootDeny C:\\OtOpcUa800\\OtOpcUa unchanged\r\nFirewallBlockOutbound OtOpcUa-ScriptWorker-BlockOutbound unchanged\r\nHostServiceEnv OtOpcUaHost unchanged\r\n\r\n\r\n"
|
|
},
|
|
"reapplyAllUnchanged": true,
|
|
"envBefore": [
|
|
"ASPNETCORE_URLS",
|
|
"Cluster__Hostname",
|
|
"Cluster__Port",
|
|
"Cluster__PublicHostname",
|
|
"Cluster__Roles__0",
|
|
"Cluster__SeedNodes__0",
|
|
"Cluster__SystemName",
|
|
"ConfigSource__ApiKey",
|
|
"ConfigSource__CentralFetchEndpoints__0",
|
|
"ConfigSource__FetchTimeoutSeconds",
|
|
"ConfigSource__Mode",
|
|
"DOTNET_ENVIRONMENT",
|
|
"OpcUa__AllowAnonymous",
|
|
"OpcUa__ApplicationName",
|
|
"OpcUa__ApplicationUri",
|
|
"OpcUa__AutoAcceptUntrustedClientCertificates",
|
|
"OpcUa__EnabledSecurityProfiles__0",
|
|
"OpcUa__EnabledSecurityProfiles__1",
|
|
"OpcUa__OpcUaPort",
|
|
"OpcUa__PublicHostname",
|
|
"OTOPCUA_ROLES",
|
|
"Secrets__SqlitePath",
|
|
"Security__Acl__Enabled",
|
|
"Security__ApiKeys__Pepper",
|
|
"Security__Ldap__Enabled",
|
|
"ZB_SECRETS_MASTER_KEY"
|
|
],
|
|
"envAfter": [
|
|
"ASPNETCORE_URLS",
|
|
"Cluster__Hostname",
|
|
"Cluster__Port",
|
|
"Cluster__PublicHostname",
|
|
"Cluster__Roles__0",
|
|
"Cluster__SeedNodes__0",
|
|
"Cluster__SystemName",
|
|
"ConfigSource__ApiKey",
|
|
"ConfigSource__CentralFetchEndpoints__0",
|
|
"ConfigSource__FetchTimeoutSeconds",
|
|
"ConfigSource__Mode",
|
|
"DOTNET_ENVIRONMENT",
|
|
"OpcUa__AllowAnonymous",
|
|
"OpcUa__ApplicationName",
|
|
"OpcUa__ApplicationUri",
|
|
"OpcUa__AutoAcceptUntrustedClientCertificates",
|
|
"OpcUa__EnabledSecurityProfiles__0",
|
|
"OpcUa__EnabledSecurityProfiles__1",
|
|
"OpcUa__OpcUaPort",
|
|
"OpcUa__PublicHostname",
|
|
"OTOPCUA_ROLES",
|
|
"Scripting__Runner",
|
|
"Scripting__Worker__Identity",
|
|
"Scripting__Worker__PeCacheDir",
|
|
"Secrets__SqlitePath",
|
|
"Security__Acl__Enabled",
|
|
"Security__ApiKeys__Pepper",
|
|
"Security__Ldap__Enabled",
|
|
"ZB_SECRETS_MASTER_KEY"
|
|
],
|
|
"anchor": "[SC] QueryServiceConfig SUCCESS\r\n\r\nSERVICE_NAME: OtOpcUaScriptWorker\r\n TYPE : 10 WIN32_OWN_PROCESS \r\n START_TYPE : 4 DISABLED\r\n ERROR_CONTROL : 1 NORMAL\r\n BINARY_PATH_NAME : \"C:\\OtOpcUa800\\OtOpcUa\\script-worker\\ZB.MOM.WW.OtOpcUa.ScriptWorker.exe\"\r\n LOAD_ORDER_GROUP : \r\n TAG : 0\r\n DISPLAY_NAME : OtOpcUa ScriptWorker identity (anchor, never started)\r\n DEPENDENCIES : \r\n SERVICE_START_NAME : NT SERVICE\\OtOpcUaScriptWorker\r\n",
|
|
"anchorSid": "\r\nNAME: OtOpcUaScriptWorker\r\nSERVICE SID: S-1-5-80-1846135827-3903057317-1998105452-3938448374-3023753135\r\nSTATUS: Active\r\n",
|
|
"installAcl": "C:\\OtOpcUa800\\OtOpcUa NT SERVICE\\OtOpcUaScriptWorker:(OI)(CI)(DENY)(S,RD)\r\n NT SERVICE\\OtOpcUaHost:(OI)(CI)(RX)\r\n NT AUTHORITY\\SYSTEM:(I)(OI)(CI)(F)\r\n BUILTIN\\Administrators:(I)(OI)(CI)(F)\r\n\r\nSuccessfully processed 1 files; Failed processing 0 files\r\n",
|
|
"workerDirAcl": "C:\\OtOpcUa800\\OtOpcUa\\script-worker NT SERVICE\\OtOpcUaScriptWorker:(OI)(CI)(RX)\r\n NT SERVICE\\OtOpcUaScriptWorker:(I)(OI)(CI)(DENY)(S,RD)\r\n NT SERVICE\\OtOpcUaHost:(I)(OI)(CI)(RX)\r\n NT AUTHORITY\\SYSTEM:(I)(OI)(CI)(F)\r\n BUILTIN\\Administrators:(I)(OI)(CI)(F)\r\n\r\nSuccessfully processed 1 files; Failed processing 0 files\r\n",
|
|
"peCacheAcl": "C:\\OtOpcUa800\\state\\pe-cache NT AUTHORITY\\SYSTEM:(OI)(CI)(F)\r\n BUILTIN\\Administrators:(OI)(CI)(F)\r\n NT SERVICE\\OtOpcUaHost:(OI)(CI)(F)\r\n\r\nSuccessfully processed 1 files; Failed processing 0 files\r\n",
|
|
"peAcl": "C:\\OtOpcUa800\\state\\pe-cache\\pe NT SERVICE\\OtOpcUaScriptWorker:(OI)(CI)(M)\r\n NT AUTHORITY\\SYSTEM:(I)(OI)(CI)(F)\r\n BUILTIN\\Administrators:(I)(OI)(CI)(F)\r\n NT SERVICE\\OtOpcUaHost:(I)(OI)(CI)(F)\r\n\r\nSuccessfully processed 1 files; Failed processing 0 files\r\n",
|
|
"firewall": {
|
|
"name": "OtOpcUa-ScriptWorker-BlockOutbound",
|
|
"direction": "Outbound",
|
|
"action": "Block",
|
|
"enabled": "True",
|
|
"profile": "Any",
|
|
"program": "C:\\OtOpcUa800\\OtOpcUa\\script-worker\\ZB.MOM.WW.OtOpcUa.ScriptWorker.exe"
|
|
},
|
|
"workerExeSha256": "9DC0558BB62231487DAFCD1B792BBE280B5BAFC8849CB0347B14FB50483CFC04",
|
|
"workerFiles": 275
|
|
}
|