Accept native Windows HTTPS with preserved LocalService identity and WSS restoration
Rust development slice / linux (push) Failing after 6s
Rust development slice / linux (push) Failing after 6s
This commit is contained in:
@@ -1,9 +1,36 @@
|
||||
# Windows-Client: erster nativer Entwicklungsstand
|
||||
|
||||
Stand 2026-11-13, Spezifikation 1.9. Windows-11-Gast und Notebook-Host sind
|
||||
Stand 2026-11-13, Spezifikation 1.15. Windows-11-Gast und Notebook-Host sind
|
||||
verschiedene Geräte. Auf dem Notebook laufen ausschließlich Entwicklungstools;
|
||||
der Client verwendet den endgültigen Cloudserver `discovery.ease-technologies.de`.
|
||||
|
||||
## Native HTTPS-Abnahme zusätzlich bestanden — 2026-11-13
|
||||
|
||||
Der bestehende LocalService-Agent wurde im festen Fall
|
||||
`3c60e1a8-7ab7-4720-8b1a-f89f4f0d7458` administrativ und versioniert von WSS auf
|
||||
explizites HTTPS umgestellt. Keine neue Identität, kein Enrollment, kein RMM-Job.
|
||||
Tatsächlicher serverseitiger Transport `https`, zwei frische Heartbeats um
|
||||
22:21:14.183598 und22:21:45.234313 UTC. Der native Readonly-Journalbeleg bestätigt
|
||||
Integrität, gleiche Identität, monotone Sequenz935→941 und0 ausstehende
|
||||
Inventarereignisse nach konkretem ACK. Tatsächlicher Prozessowner `S-1-5-19`
|
||||
(LocalService); unverändertes qualifiziertes Programm, CA, Zertifikat, privater
|
||||
Geräteschlüssel und deren ACLs. Private Schlüssel blieben auf der VM.
|
||||
|
||||
Anschließend exakt ursprüngliche WSS-Konfigurationsbytes und ACLs wiederhergestellt,
|
||||
zweimal frischer WSS-Kontakt sowie abgeschlossener Inventar-ACK nachgewiesen.
|
||||
Beide fremden Tenantzugriffe verweigert; vorher/nachher0Jobs/0Outbox/0Grants/
|
||||
0offene Versuche. `result.json` ist verifiziert. Geschützte Belege:
|
||||
`devstate/windows-client/transport/3c60e1a8-7ab7-4720-8b1a-f89f4f0d7458/`.
|
||||
|
||||
Ausgeführt: `python3 deploy/windows/transport_acceptance.py start`.
|
||||
Der Runner verwendet einen per Hash und SFTP gepinnten Bootstrap-PowerShellcode;
|
||||
prozessbezogenes RemoteSigned ändert keine Maschinen-/Gruppenrichtlinie und
|
||||
keine RMM-Jobausführung. Sieben gezielte lokale Runner-Guards und drei
|
||||
PowerShell-Parserprüfungen bestanden; kein neuer Clientbuild für diese Abnahme.
|
||||
Automatischer Fallback und TLS-Negativfälle sind getrennte folgende Abnahmen.
|
||||
PowerShell-Jobs bleiben bis zu [ihren Voraussetzungen](../../docs/windows-job-boundary.md)
|
||||
gesperrt. Die folgenden Erstnachweise bleiben historisch erhalten.
|
||||
|
||||
## Tatsächlich nachgewiesen
|
||||
|
||||
`rmm-agent-windows` als eigene Plattform-Crate mit gemeinsamen Domain-/Protobuf-
|
||||
@@ -82,9 +109,8 @@ Strecke ausschließlich passive Standardbeobachtungen verarbeitet.
|
||||
|
||||
Dieser erste Entwicklungsbuild ist **unsigniert**. Kein produktiver signierter
|
||||
Installer/MSVC-Supportnachweis, keine Zertifikatsrotations-/Widerrufs-/Proxy- oder
|
||||
Windows-Paket-/Dienstaktionsabnahme. Der native Onlinenachweis verwendet WSS;
|
||||
HTTPS-/Fallbackmodi sind gemeinsam implementiert, nativ auf Windows noch nicht
|
||||
abgenommen. Die passive SCM-/Enrollment-/mTLS-/Inventar-/Mandantentrennungsstrecke sowie
|
||||
Windows-Paket-/Dienstaktionsabnahme. Der erste native Onlinenachweis verwendete WSS. Explizites HTTPS ist inzwischen
|
||||
oben separat nativ abgenommen; automatischer Fallback folgt gesondert. Die passive SCM-/Enrollment-/mTLS-/Inventar-/Mandantentrennungsstrecke sowie
|
||||
die oben benannten nativen Tests sind nun tatsächlich getrennt belegt.
|
||||
Dies ist keine vollständige Windows-/Linux-MVP-Abnahme.
|
||||
|
||||
|
||||
@@ -0,0 +1,397 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Preserving passive Windows HTTPS acceptance; no RMM jobs or approvals.
|
||||
|
||||
The protected per-case intent is written before any remote mutation. A lost
|
||||
reply never reruns the transition: use finish or restore for that same case.
|
||||
"""
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
import time
|
||||
import uuid
|
||||
|
||||
import client_bootstrap as cb
|
||||
import cloud_mvp_acceptance as cloud
|
||||
import cloud_transport_acceptance as server_transport
|
||||
|
||||
require = cb.contract.require
|
||||
STATE = cb.EVIDENCE/'transport'
|
||||
AGENT = '63ea15b2-0643-403d-b5b4-cba1288dbea3'
|
||||
ASSET = 'a176520e-8a91-4e93-a78b-8e7620f430e0'
|
||||
BINARY = '31e360e50b177b4d5729d24e436d4f25aeed7b1a7bd35f2a129841ba1abffd37'
|
||||
ORIGINAL_CONFIG = 'ad396dfafe1d9764eb9840185d1e167d06e018799d6786218691e600a33ff589'
|
||||
PROBE = '760edb21bdcc2ac70695cd1245f8abaa4ea2bd8ebd42cfb3eeb17a1ff39ff4ec'
|
||||
|
||||
# Only fixed bootstrap resources are read or changed. Private keys never leave
|
||||
# the VM: only their preservation hashes occur in the protected case receipts.
|
||||
SCRIPT = r'''
|
||||
$ErrorActionPreference='Stop'
|
||||
$p=$global:RmmTransportPayload
|
||||
if ($null -eq $p) {throw 'Pinned bootstrap payload required'}
|
||||
if ([string]([guid]$p.id) -cne $p.id -or $p.mode -notin @('https','auto') -or $p.action -notin @('state','enter','restore')) {throw 'Fixed transport action'}
|
||||
foreach($n in @('binary_sha256','config_sha256','probe_sha256')) {if ($p.$n -notmatch '^[0-9a-f]{64}$') {throw 'Qualified hash'}}
|
||||
if ($p.agent_id -cne '63ea15b2-0643-403d-b5b4-cba1288dbea3' -or $p.asset_id -cne 'a176520e-8a91-4e93-a78b-8e7620f430e0') {throw 'Fixed existing Windows identity'}
|
||||
$root='C:\ProgramData\RustDiscovery';$state=Join-Path $root 'state';$cfg=Join-Path $root 'config.json'
|
||||
$exe='C:\Program Files\RustDiscovery\rmm-agent-windows.exe';$name='RmmDiscoveryWindows'
|
||||
$folder='C:\ProgramData\RustDiscoveryBootstrap\transport-'+$p.id
|
||||
$probe='C:\ProgramData\RustDiscoveryBootstrap\'+$p.probe_sha256+'\PassiveStateProbe.exe'
|
||||
$ss=(New-Object Security.Principal.NTAccount('NT SERVICE',$name)).Translate([Security.Principal.SecurityIdentifier]).Value
|
||||
$allowed=@('S-1-5-18','S-1-5-32-544',$ss)
|
||||
function Check-Path([string]$path,[bool]$directory) {
|
||||
$item=Get-Item -LiteralPath $path -Force
|
||||
if ($item.PSIsContainer -ne $directory -or ($item.Attributes -band [IO.FileAttributes]::ReparsePoint)) {throw 'Fixed path type'}
|
||||
$acl=Get-Acl -LiteralPath $path
|
||||
$owner=$acl.GetOwner([Security.Principal.SecurityIdentifier]).Value
|
||||
if ($owner -notin $allowed -and ($directory -or $owner -ne 'S-1-5-19')) {throw 'Fixed owner'}
|
||||
$rules=@($acl.GetAccessRules($true,$true,[Security.Principal.SecurityIdentifier]))
|
||||
if (!$rules.Count) {throw 'Empty DACL'}
|
||||
foreach($r in $rules) {if ($r.AccessControlType -ne 'Allow' -or $r.IdentityReference.Value -notin $allowed) {throw 'Broad DACL'}}
|
||||
}
|
||||
function Hash-Bytes([byte[]]$bytes) {
|
||||
$h=[Security.Cryptography.SHA256]::Create()
|
||||
try {return ([BitConverter]::ToString($h.ComputeHash($bytes))).Replace('-','').ToLowerInvariant()} finally {$h.Dispose()}
|
||||
}
|
||||
function Hash-File([string]$path) {Check-Path $path $false; return (Get-FileHash -LiteralPath $path -Algorithm SHA256).Hash.ToLowerInvariant()}
|
||||
function Write-New([string]$path,[byte[]]$bytes) {
|
||||
$f=[IO.File]::Open($path,[IO.FileMode]::CreateNew,[IO.FileAccess]::Write,[IO.FileShare]::Read)
|
||||
try {$f.Write($bytes,0,$bytes.Length);$f.Flush($true)} finally {$f.Dispose()}
|
||||
}
|
||||
function Receipt([string]$phase,$value) {
|
||||
Write-New (Join-Path $folder ('receipt-'+$phase+'.json')) ([Text.Encoding]::UTF8.GetBytes(($value | ConvertTo-Json -Depth 12 -Compress)))
|
||||
}
|
||||
function Probe-State {
|
||||
if ((Hash-File $probe) -cne $p.probe_sha256) {throw 'Readonly probe hash'}
|
||||
$si=New-Object Diagnostics.ProcessStartInfo
|
||||
$si.FileName=$probe;$si.UseShellExecute=$false;$si.CreateNoWindow=$true
|
||||
$si.RedirectStandardOutput=$true;$si.RedirectStandardError=$true
|
||||
$proc=New-Object Diagnostics.Process;$proc.StartInfo=$si
|
||||
if (!$proc.Start()) {throw 'Readonly probe start'}
|
||||
try {
|
||||
if (!$proc.WaitForExit(15000)) {$proc.Kill();throw 'Readonly probe timeout'}
|
||||
if ($proc.ExitCode -ne 0) {throw 'Readonly probe failed'}
|
||||
$raw=$proc.StandardOutput.ReadToEnd()
|
||||
if ($raw.Length -gt 4096) {throw 'Readonly probe bound'}
|
||||
return ($raw | ConvertFrom-Json)
|
||||
} finally {$proc.Dispose()}
|
||||
}
|
||||
function Snapshot {
|
||||
foreach($d in @('C:\Program Files\RustDiscovery',$root,$state)) {Check-Path $d $true}
|
||||
Check-Path $cfg $false
|
||||
if ((Get-Item -LiteralPath $cfg).Length -gt 32768) {throw 'Configuration size'}
|
||||
$c=Get-Content -LiteralPath $cfg -Raw | ConvertFrom-Json
|
||||
if ((($c.PSObject.Properties.Name | Sort-Object) -join ',') -cne 'ca_file,connect_address,enrollment_token_file,server_name,state_directory,transport') {throw 'Configuration schema'}
|
||||
if ($c.server_name -cne 'discovery.ease-technologies.de' -or $c.state_directory -cne $state -or $c.ca_file -cne (Join-Path $root 'server-ca.pem') -or $c.enrollment_token_file -cne (Join-Path $state 'enrollment.token')) {throw 'Fixed configuration paths'}
|
||||
if (Test-Path -LiteralPath $c.enrollment_token_file) {throw 'Enrollment must already be completed'}
|
||||
Check-Path (Join-Path $state 'identity.json') $false
|
||||
if ((Get-Item -LiteralPath (Join-Path $state 'identity.json')).Length -gt 32768) {throw 'Identity metadata size'}
|
||||
$identity=Get-Content -LiteralPath (Join-Path $state 'identity.json') -Raw | ConvertFrom-Json
|
||||
if ($identity.agent_id -cne $p.agent_id -or $identity.asset_id -cne $p.asset_id) {throw 'Existing identity mismatch'}
|
||||
$svc=Get-CimInstance Win32_Service -Filter "Name='RmmDiscoveryWindows'"
|
||||
$expected='"C:\Program Files\RustDiscovery\rmm-agent-windows.exe" --service --config "C:\ProgramData\RustDiscovery\config.json"'
|
||||
if ($svc.PathName -cne $expected -or $svc.StartName -cne 'NT AUTHORITY\LocalService' -or $svc.StartMode -ne 'Auto') {throw 'Fixed LocalService deployment'}
|
||||
$owner=$null
|
||||
if ($svc.State -eq 'Running') {
|
||||
$process=Get-CimInstance Win32_Process -Filter ('ProcessId='+$svc.ProcessId)
|
||||
$owner=(Invoke-CimMethod -InputObject $process -MethodName GetOwnerSid).Sid
|
||||
if ($owner -cne 'S-1-5-19') {throw 'Actual LocalService token'}
|
||||
}
|
||||
$hashes=[ordered]@{};$acls=[ordered]@{}
|
||||
foreach($entry in @(@('binary',$exe),@('ca',$c.ca_file),@('identity',(Join-Path $state 'identity.json')),@('certificate',(Join-Path $state 'device.pem')),@('private_key',(Join-Path $state 'device.key')))) {
|
||||
$hashes[$entry[0]]=Hash-File $entry[1]
|
||||
$acls[$entry[0]]=Hash-Bytes ([Text.Encoding]::UTF8.GetBytes((Get-Acl -LiteralPath $entry[1]).Sddl))
|
||||
}
|
||||
if ($hashes.binary -cne $p.binary_sha256) {throw 'Existing qualified passive binary'}
|
||||
Check-Path $cfg $false;Check-Path (Join-Path $state 'telemetry.sqlite') $false
|
||||
return [pscustomobject]@{agent_id=$identity.agent_id;asset_id=$identity.asset_id;transport=$c.transport;config_sha256=(Hash-File $cfg);config_acl_sha256=(Hash-Bytes ([Text.Encoding]::UTF8.GetBytes((Get-Acl -LiteralPath $cfg).Sddl)));hashes=$hashes;acl_sha256=$acls;service_state=$svc.State;service_identity=$svc.StartName;process_id=$svc.ProcessId;process_owner_sid=$owner;telemetry_creation_ticks=(Get-Item -LiteralPath (Join-Path $state 'telemetry.sqlite')).CreationTimeUtc.Ticks;journal=(Probe-State)}
|
||||
}
|
||||
function Preserved($baseline,$current) {
|
||||
if ($current.agent_id -cne $baseline.agent_id -or $current.asset_id -cne $baseline.asset_id -or $current.telemetry_creation_ticks -ne $baseline.telemetry_creation_ticks -or $current.journal.integrity -cne 'ok' -or $current.journal.agent_id -cne $baseline.agent_id -or $current.journal.sequence -lt $baseline.journal.sequence) {throw 'Preserved journal identity/sequence'}
|
||||
foreach($n in @('binary','ca','identity','certificate','private_key')) {if ($current.hashes.$n -cne $baseline.hashes.$n -or $current.acl_sha256.$n -cne $baseline.acl_sha256.$n) {throw 'Preserved artifact and identity bytes/ACL'}}
|
||||
}
|
||||
function Start-Own {
|
||||
Start-Service -Name $name
|
||||
(Get-Service -Name $name).WaitForStatus([ServiceProcess.ServiceControllerStatus]::Running,[TimeSpan]::FromSeconds(20))
|
||||
}
|
||||
function Stop-Own {
|
||||
Stop-Service -Name $name
|
||||
(Get-Service -Name $name).WaitForStatus([ServiceProcess.ServiceControllerStatus]::Stopped,[TimeSpan]::FromSeconds(20))
|
||||
}
|
||||
function Replace-Config([byte[]]$bytes,[string]$label,[string]$sddl) {
|
||||
$next=Join-Path $folder ($label+'-next.json');Write-New $next $bytes
|
||||
[IO.File]::Replace($next,$cfg,(Join-Path $folder ($label+'-previous.json')))
|
||||
$acl=New-Object Security.AccessControl.FileSecurity;$acl.SetSecurityDescriptorSddlForm($sddl);Set-Acl -LiteralPath $cfg -AclObject $acl
|
||||
}
|
||||
if ($p.action -eq 'state') {Snapshot | ConvertTo-Json -Depth 12 -Compress;exit 0}
|
||||
try {
|
||||
if ($p.action -eq 'enter') {
|
||||
$before=Snapshot
|
||||
if ($before.service_state -ne 'Running' -or $before.transport -cne 'wss' -or $before.config_sha256 -cne $p.config_sha256 -or $before.journal.integrity -cne 'ok' -or $before.journal.pending_inventory_events -ne 0) {throw 'Settled original WSS state required'}
|
||||
if (Test-Path -LiteralPath $folder) {throw 'Existing native intent; inspect or restore same case'}
|
||||
New-Item -ItemType Directory -Path $folder | Out-Null
|
||||
$acl=New-Object Security.AccessControl.DirectorySecurity;$acl.SetAccessRuleProtection($true,$false)
|
||||
$acl.SetOwner((New-Object Security.Principal.SecurityIdentifier('S-1-5-32-544')))
|
||||
foreach($sid in @('S-1-5-18','S-1-5-32-544')) {$acl.AddAccessRule((New-Object Security.AccessControl.FileSystemAccessRule((New-Object Security.Principal.SecurityIdentifier($sid)),'FullControl','ContainerInherit,ObjectInherit','None','Allow')))}
|
||||
Set-Acl -LiteralPath $folder -AclObject $acl
|
||||
$original=[IO.File]::ReadAllBytes($cfg);$sddl=(Get-Acl -LiteralPath $cfg).Sddl
|
||||
$text=[Text.Encoding]::UTF8.GetString($original);$re=New-Object Text.RegularExpressions.Regex('("transport"\s*:\s*)"wss"')
|
||||
if ($re.Matches($text).Count -ne 1) {throw 'Exact original transport field'}
|
||||
$next=[Text.Encoding]::UTF8.GetBytes($re.Replace($text,('${1}"'+$p.mode+'"'),1))
|
||||
$manifest=[pscustomobject]@{id=$p.id;mode=$p.mode;before=$before;original_config_sha256=(Hash-Bytes $original);selected_config_sha256=(Hash-Bytes $next);original_sddl=$sddl}
|
||||
Write-New (Join-Path $folder 'config-original.bin') $original
|
||||
Write-New (Join-Path $folder 'manifest.json') ([Text.Encoding]::UTF8.GetBytes(($manifest | ConvertTo-Json -Depth 12 -Compress)))
|
||||
Receipt 'prepared' @{stage='prepared';jobs_created=$false;reboot_requested=$false}
|
||||
Stop-Own
|
||||
Preserved $before (Snapshot)
|
||||
Replace-Config $next 'enter' $sddl
|
||||
if ((Hash-File $cfg) -cne $manifest.selected_config_sha256) {throw 'Selected configuration hash'}
|
||||
Start-Own
|
||||
$after=Snapshot;Preserved $before $after
|
||||
Receipt 'entered' @{stage='entered';snapshot=$after;jobs_created=$false;reboot_requested=$false}
|
||||
[pscustomobject]@{entered=$true;snapshot=$after;backup=$folder;config_selected_sha256=$manifest.selected_config_sha256;no_jobs=$true;no_reboot=$true} | ConvertTo-Json -Depth 12 -Compress
|
||||
} else {
|
||||
Check-Path $folder $true
|
||||
$manifest=Get-Content -LiteralPath (Join-Path $folder 'manifest.json') -Raw | ConvertFrom-Json
|
||||
$original=[IO.File]::ReadAllBytes((Join-Path $folder 'config-original.bin'))
|
||||
if ($manifest.id -cne $p.id -or $manifest.mode -cne $p.mode -or (Hash-Bytes $original) -cne $p.config_sha256 -or $manifest.original_config_sha256 -cne $p.config_sha256) {throw 'Exact original native intent'}
|
||||
$current=Snapshot;Preserved $manifest.before $current
|
||||
if ($current.config_sha256 -cne $p.config_sha256) {
|
||||
if ($current.config_sha256 -cne $manifest.selected_config_sha256 -or $current.transport -cne $p.mode) {throw 'Unknown configuration; refuse overwrite'}
|
||||
if ($current.service_state -eq 'Running') {Stop-Own} elseif ($current.service_state -ne 'Stopped') {throw 'Unexpected service state'}
|
||||
Replace-Config $original 'restore' $manifest.original_sddl
|
||||
}
|
||||
if ((Get-Service -Name $name).Status -ne 'Running') {Start-Own}
|
||||
$after=Snapshot;Preserved $manifest.before $after
|
||||
if ($after.config_sha256 -cne $p.config_sha256 -or $after.config_acl_sha256 -cne $manifest.before.config_acl_sha256 -or $after.transport -cne 'wss') {throw 'Original configuration/ACL restoration'}
|
||||
if (!(Test-Path -LiteralPath (Join-Path $folder 'receipt-restored.json'))) {Receipt 'restored' @{stage='restored';snapshot=$after;jobs_created=$false;reboot_requested=$false}}
|
||||
[pscustomobject]@{restored=$true;snapshot=$after;backup=$folder;no_jobs=$true;no_reboot=$true} | ConvertTo-Json -Depth 12 -Compress
|
||||
}
|
||||
} catch {
|
||||
if (Test-Path -LiteralPath $folder) {Receipt ('error-'+[guid]::NewGuid().ToString()) @{stage='incomplete';error_type=$_.Exception.GetType().FullName;line=$_.InvocationInfo.ScriptLineNumber;jobs_created=$false;reboot_requested=$false}}
|
||||
throw
|
||||
}
|
||||
'''
|
||||
|
||||
|
||||
def payload(ident, action, mode='https'):
|
||||
require(str(uuid.UUID(ident)) == ident and action in ('state','enter','restore') and mode in ('https','auto'), 'fixed passive transport action')
|
||||
probe = cb.contract.protected_json(cb.EVIDENCE/'PassiveStateProbe.exe.latest.json')
|
||||
require(probe['sha256'] == PROBE, 'existing qualified readonly probe artifact')
|
||||
return dict(id=ident, action=action, mode=mode, agent_id=AGENT, asset_id=ASSET,
|
||||
binary_sha256=BINARY, config_sha256=ORIGINAL_CONFIG, probe_sha256=probe['sha256'])
|
||||
|
||||
|
||||
PREPARE_SCRIPT = r'''$ErrorActionPreference='Stop'
|
||||
$p=([Console]::In.ReadLine() | ConvertFrom-Json)
|
||||
if ($p.sha256 -notmatch '^[0-9a-f]{64}$') {throw 'Fixed script hash'}
|
||||
$root='C:\ProgramData\RustDiscoveryBootstrap'
|
||||
$item=Get-Item -LiteralPath $root -Force
|
||||
if (!$item.PSIsContainer -or ($item.Attributes -band [IO.FileAttributes]::ReparsePoint)) {throw 'Bootstrap directory type'}
|
||||
$acl=Get-Acl -LiteralPath $root
|
||||
if ($acl.GetOwner([Security.Principal.SecurityIdentifier]).Value -notin @('S-1-5-18','S-1-5-32-544')) {throw 'Bootstrap owner'}
|
||||
foreach($r in $acl.GetAccessRules($true,$true,[Security.Principal.SecurityIdentifier])) {if ($r.AccessControlType -ne 'Allow' -or $r.IdentityReference.Value -notin @('S-1-5-18','S-1-5-32-544')) {throw 'Bootstrap DACL'}}
|
||||
$directory=Join-Path $root $p.sha256
|
||||
if (!(Test-Path -LiteralPath $directory)) {New-Item -ItemType Directory -Path $directory | Out-Null}
|
||||
$di=Get-Item -LiteralPath $directory -Force
|
||||
if (!$di.PSIsContainer -or ($di.Attributes -band [IO.FileAttributes]::ReparsePoint)) {throw 'Script directory type'}
|
||||
foreach($r in (Get-Acl -LiteralPath $directory).GetAccessRules($true,$true,[Security.Principal.SecurityIdentifier])) {if ($r.AccessControlType -ne 'Allow' -or $r.IdentityReference.Value -notin @('S-1-5-18','S-1-5-32-544')) {throw 'Script directory DACL'}}
|
||||
$script=Join-Path $directory 'TransportAcceptance.ps1'
|
||||
$exists=Test-Path -LiteralPath $script
|
||||
if ($exists -and (Get-FileHash -LiteralPath $script -Algorithm SHA256).Hash.ToLowerInvariant() -cne $p.sha256) {throw 'Existing script mismatch'}
|
||||
[pscustomobject]@{already_uploaded=$exists;sha256=$p.sha256} | ConvertTo-Json -Compress
|
||||
'''
|
||||
LAUNCH_SCRIPT = r'''$ErrorActionPreference='Stop'
|
||||
$p=([Console]::In.ReadLine() | ConvertFrom-Json)
|
||||
if ($p.sha256 -notmatch '^[0-9a-f]{64}$') {throw 'Fixed script hash'}
|
||||
$script='C:\ProgramData\RustDiscoveryBootstrap\'+$p.sha256+'\TransportAcceptance.ps1'
|
||||
$item=Get-Item -LiteralPath $script -Force
|
||||
if ($item.PSIsContainer -or ($item.Attributes -band [IO.FileAttributes]::ReparsePoint) -or (Get-FileHash -LiteralPath $script -Algorithm SHA256).Hash.ToLowerInvariant() -cne $p.sha256) {throw 'Pinned source script'}
|
||||
$global:RmmTransportPayload=$p.payload
|
||||
& $script
|
||||
'''
|
||||
|
||||
|
||||
def stage_script():
|
||||
raw = SCRIPT.encode('utf-8'); digest = hashlib.sha256(raw).hexdigest()
|
||||
prepared = cb.powershell(PREPARE_SCRIPT, dict(sha256=digest))
|
||||
if not prepared['already_uploaded']:
|
||||
directory = cb.EVIDENCE/'transport-source'
|
||||
directory.mkdir(mode=0o700, parents=True, exist_ok=True)
|
||||
source = directory/(digest+'.ps1')
|
||||
if not source.exists():
|
||||
descriptor = os.open(source, os.O_WRONLY|os.O_CREAT|os.O_EXCL|os.O_NOFOLLOW, 0o600)
|
||||
with os.fdopen(descriptor,'wb') as stream:
|
||||
stream.write(raw);stream.flush();os.fsync(stream.fileno())
|
||||
require(hashlib.sha256(source.read_bytes()).hexdigest() == digest, 'exact bootstrap script bytes')
|
||||
prefix = cb.contract.protected_json(cb.ROOT/'credentials/windows-dev-access.json')['ssh_prefix']
|
||||
arguments = ['sftp']+[value for value in prefix[1:-1] if value != '-T']+['-b','-',prefix[-1]]
|
||||
target = '/C:/ProgramData/RustDiscoveryBootstrap/'+digest+'/TransportAcceptance.ps1'
|
||||
transferred = subprocess.run(arguments,input=('put '+json.dumps(str(source.resolve()))+' '+json.dumps(target)+'\n').encode(),capture_output=True,timeout=60)
|
||||
require(transferred.returncode == 0, 'pinned bootstrap SFTP transfer failed')
|
||||
verified = cb.powershell(PREPARE_SCRIPT,dict(sha256=digest))
|
||||
require(verified['already_uploaded'], 'exact staged source missing')
|
||||
return digest
|
||||
|
||||
|
||||
def remote(ident, action, mode='https', source_sha256=None):
|
||||
digest = source_sha256 or stage_script()
|
||||
require(digest == hashlib.sha256(SCRIPT.encode('utf-8')).hexdigest(), 'qualified bootstrap source unchanged')
|
||||
# RemoteSigned affects only this trusted bootstrap process, never machine
|
||||
# policy or any RMM job interpreter. Machine/User policy still wins normally.
|
||||
return cb.powershell(LAUNCH_SCRIPT,dict(sha256=digest,payload=payload(ident,action,mode)),timeout=60,remote_signed=True)
|
||||
|
||||
|
||||
def save(folder, name, value):
|
||||
cb.contract.write_private(folder/name, value)
|
||||
|
||||
|
||||
def gate():
|
||||
return cloud.bootstrap.rpc('server.conf', cloud.server, dict(kind='gate', tenant_id=cloud.TENANT, agent_id=AGENT))
|
||||
|
||||
|
||||
def observe(ident):
|
||||
return cloud.bootstrap.rpc('server.conf', server_transport.server_evidence,
|
||||
dict(tenant_id=cloud.TENANT, agent_id=AGENT, fault_id=ident))
|
||||
|
||||
|
||||
def preserved(before, after):
|
||||
require(all(before[k] == after[k] for k in ('agent_id','asset_id','hashes','acl_sha256','telemetry_creation_ticks')), 'native identity/artifacts/ACL preservation')
|
||||
require(after['journal']['integrity'] == 'ok' and after['journal']['read_only'] is True
|
||||
and after['journal']['agent_id'] == AGENT
|
||||
and after['journal']['sequence'] >= before['journal']['sequence'], 'same retained journal and monotone sequence')
|
||||
|
||||
|
||||
def wait_mode(ident, mode, after, baseline):
|
||||
deadline = time.monotonic()+150
|
||||
first = None
|
||||
while True:
|
||||
value = observe(ident); device = value['device']
|
||||
if device and device['transport'] == mode and device['last_contact_at'] and cloud.contract.timestamp(device['last_contact_at']) > after:
|
||||
require(all(device[k] == baseline[k] for k in ('agent_id','asset_id','enrollment_generation','assignment_version','certificate_sha256')), 'same authenticated Windows device')
|
||||
if first is None:
|
||||
first = value
|
||||
elif device['last_contact_at'] != first['device']['last_contact_at']:
|
||||
return dict(first=first,second=value)
|
||||
require(time.monotonic() < deadline, 'two actual fresh transport heartbeats missing')
|
||||
time.sleep(2)
|
||||
|
||||
|
||||
def read_device():
|
||||
device = cloud.Backend().call('inventory.get_device', dict(tenant_id=cloud.TENANT, asset_id=ASSET))
|
||||
require(device['agent_id'] == AGENT and device['source_id'] == 'windows.base'
|
||||
and set(device['capabilities']) == {'windows.base/1','heartbeat/1'}
|
||||
and device['inventory'] is not None and device['inventory']['root_available_inodes'] is None
|
||||
and device['presence'] == 'online', 'honest existing passive Windows inventory')
|
||||
return device
|
||||
|
||||
|
||||
def foreign_denied():
|
||||
backend = cloud.Backend('b'); values = []
|
||||
for tenant in (cloud.TENANT,'22222222-2222-4222-8222-222222222222'):
|
||||
backend.sequence += 1
|
||||
answer = backend.request(dict(jsonrpc='2.0', id=backend.sequence, method='tools/call',
|
||||
params=dict(name='inventory.get_device',arguments=dict(tenant_id=tenant,asset_id=ASSET))))
|
||||
data = answer.get('data', {}); result = data.get('result', {})
|
||||
require('error' in data or result.get('isError'), 'foreign Windows device must remain denied')
|
||||
values.append(dict(tenant_id=tenant, denied=True))
|
||||
return values
|
||||
|
||||
|
||||
def fixed_intent(folder, name, value):
|
||||
path = folder/name
|
||||
if path.exists():
|
||||
require(cb.contract.protected_json(path) == value, 'same retained transition intent')
|
||||
else:
|
||||
save(folder, name, value)
|
||||
|
||||
|
||||
def finish(ident):
|
||||
folder = STATE/str(uuid.UUID(ident)); intent = cb.contract.protected_json(folder/'intent.json')
|
||||
require(intent['case'] == 'explicit_https' and intent['id'] == ident, 'same fixed Windows HTTPS case')
|
||||
require(not (folder/'result.json').exists(), 'completed acceptance retained')
|
||||
require(intent['source_sha256'] == hashlib.sha256(SCRIPT.encode('utf-8')).hexdigest(), 'same qualified bootstrap source')
|
||||
before = cb.contract.protected_json(folder/'before.json')
|
||||
accepted = folder/'https-accepted.json'
|
||||
try:
|
||||
if not accepted.exists():
|
||||
current = remote(ident,'state',source_sha256=intent['source_sha256']); preserved(before['native'], current)
|
||||
require(current['transport'] == 'https', 'resume observes selected HTTPS without repeating transition')
|
||||
online = wait_mode(ident,'https',cloud.contract.timestamp(intent['started_at']),before['central']['device'])
|
||||
save(folder,'https-observed-'+str(uuid.uuid4())+'.json',online)
|
||||
native = remote(ident,'state',source_sha256=intent['source_sha256']);preserved(before['native'],native)
|
||||
require(native['journal']['pending_inventory_events'] == 0 and native['service_state'] == 'Running'
|
||||
and native['process_owner_sid'] == 'S-1-5-19'
|
||||
and native['journal']['sequence'] > before['native']['journal']['sequence'], 'actual concrete inventory ACK, sequence advancement and LocalService')
|
||||
inventory = read_device(); denied = foreign_denied()
|
||||
require(gate() == before['gate'] == dict(jobs=0,outbox=0,permits=0,unresolved=0), 'passive transport creates no jobs/grants')
|
||||
save(folder,'https-accepted.json',dict(verified=True,online=online,native=native,inventory=inventory,foreign_denied=denied))
|
||||
else:
|
||||
require(cb.contract.protected_json(accepted)['verified'] is True, 'retain successful same-case HTTPS observations')
|
||||
finally:
|
||||
fixed_intent(folder,'restore-intent.json',dict(id=ident,expected_original_config_sha256=ORIGINAL_CONFIG,no_jobs=True))
|
||||
cleanup_state = remote(ident,'state',source_sha256=intent['source_sha256'])
|
||||
preserved(before['native'],cleanup_state)
|
||||
if (cleanup_state['transport'] == 'wss' and cleanup_state['config_sha256'] == ORIGINAL_CONFIG
|
||||
and cleanup_state['config_acl_sha256'] == before['native']['config_acl_sha256']
|
||||
and cleanup_state['service_state'] == 'Running'):
|
||||
# A successful restore with a lost reply is observed, not repeated.
|
||||
restored = dict(restored_by_readback=True,snapshot=cleanup_state,no_jobs=True,no_reboot=True)
|
||||
else:
|
||||
restored = remote(ident,'restore',source_sha256=intent['source_sha256'])
|
||||
save(folder,'restored-'+str(uuid.uuid4())+'.json',restored)
|
||||
wss = wait_mode(ident,'wss',cloud.contract.now(),before['central']['device'])
|
||||
require(gate() == before['gate'], 'restoration preserves zero-job gate')
|
||||
restored = remote(ident,'state',source_sha256=intent['source_sha256']);preserved(before['native'],restored)
|
||||
require(restored['config_sha256'] == ORIGINAL_CONFIG and restored['config_acl_sha256'] == before['native']['config_acl_sha256']
|
||||
and restored['journal']['pending_inventory_events'] == 0, 'exact original WSS configuration/ACL and acknowledged inventory')
|
||||
save(folder,'result.json',dict(verified=True,case='explicit_https',id=ident,https=cb.contract.protected_json(accepted),
|
||||
restored_wss=wss,final_native=restored,gate=gate(),no_jobs_or_approvals=True,no_reboot=True))
|
||||
print('PASS native Windows HTTPS: same identity/LocalService, two fresh heartbeats, concrete inventory ACK, tenant denial, original WSS config/ACL restored, zero jobs')
|
||||
|
||||
|
||||
def start():
|
||||
os.umask(0o077);STATE.mkdir(mode=0o700,parents=True,exist_ok=True)
|
||||
ident = str(uuid.uuid4()); folder = STATE/ident;folder.mkdir(mode=0o700)
|
||||
source = stage_script()
|
||||
save(folder,'intent.json',dict(id=ident,case='explicit_https',mode='https',started_at=cloud.contract.now().isoformat(),agent_id=AGENT,asset_id=ASSET,no_jobs=True,source_sha256=source))
|
||||
native = remote(ident,'state');central = observe(ident);device = read_device();counts = gate()
|
||||
require(native['transport'] == 'wss' and native['config_sha256'] == ORIGINAL_CONFIG
|
||||
and native['journal']['pending_inventory_events'] == 0 and native['journal']['integrity'] == 'ok'
|
||||
and counts == dict(jobs=0,outbox=0,permits=0,unresolved=0), 'healthy preserved original passive WSS prerequisite')
|
||||
save(folder,'before.json',dict(native=native,central=central,device=device,gate=counts))
|
||||
save(folder,'enter-intent.json',payload(ident,'enter'))
|
||||
# On a lost SSH reply the retained intent identifies the only permitted
|
||||
# continuation. Never create a new case or repeat enter as a substitute.
|
||||
entered = remote(ident,'enter',source_sha256=source);save(folder,'entered.json',entered)
|
||||
print('Entered existing Windows HTTPS case '+ident,flush=True)
|
||||
finish(ident)
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('action',choices=('start','finish','restore'))
|
||||
parser.add_argument('--id')
|
||||
args = parser.parse_args()
|
||||
if args.action == 'start':
|
||||
require(args.id is None, 'new case ID is generated once');start()
|
||||
else:
|
||||
require(args.id is not None, 'same existing case ID required')
|
||||
if args.action == 'finish':finish(args.id)
|
||||
else:
|
||||
ident = str(uuid.UUID(args.id));folder = STATE/ident
|
||||
intent = cb.contract.protected_json(folder/'intent.json')
|
||||
require(gate() == dict(jobs=0,outbox=0,permits=0,unresolved=0), 'no Windows jobs during operational restore')
|
||||
save(folder,'explicit-restore-intent-'+str(uuid.uuid4())+'.json',dict(id=ident,no_jobs=True))
|
||||
restored = remote(ident,'restore',source_sha256=intent['source_sha256']);save(folder,'explicit-restored-'+str(uuid.uuid4())+'.json',restored)
|
||||
print('Restored only the original Windows transport config/ACL for '+ident)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
main()
|
||||
except Exception as error:
|
||||
message = str(error)
|
||||
print('WINDOWS_TRANSPORT_INCOMPLETE:'+(message if isinstance(error,cb.contract.GuardError) else type(error).__name__))
|
||||
raise SystemExit(2) from None
|
||||
@@ -1,5 +1,21 @@
|
||||
# Tatsächlicher Implementierungsstand
|
||||
|
||||
## Windows: explizites HTTPS nativ bestanden — 2026-11-13
|
||||
|
||||
Bestehender Windows-11-Gast, LocalService und unveränderte Geräteidentität.
|
||||
Fall3c60e1a8-7ab7-4720-8b1a-f89f4f0d7458 verifiziert: tatsächliches HTTPS, zwei
|
||||
frische Heartbeats, konkreter Inventar-ACK, monotone Sequenz und erhaltene
|
||||
Schlüssel-/Programm-/CA-/Identitätsdateien samt ACLs. Originale WSS-Konfiguration
|
||||
byte- und ACL-genau restauriert, wieder zwei frische WSS-Heartbeats. TenantB
|
||||
weiter verweigert, davor/danach0Jobs/Outbox/Grants/offene Versuche. Keine
|
||||
WebUI-Genehmigung benötigt oder ersetzt, weil ausschließlich eigene passive
|
||||
Transportwartung und gespeicherte Daten geprüft wurden. Sieben lokale Guards/
|
||||
drei PS-Parserprüfungen ergänzen den nativen Nachweis; keine neue Binärdatei.
|
||||
Details:[Windows-Client](../deploy/windows/CLIENT.md), [Windows-Gates](windows-gates.md).
|
||||
Für erste PowerShell-Jobs fehlen noch portierter Sicherheitskern, nachgewiesene
|
||||
vertrauenswürdige Uhr, dauerhaftes Jobjournal und plattformgebundene Plan-/
|
||||
Interpreterprüfung; kein Ausführungscapability behauptet.
|
||||
|
||||
## Linux-MVP M0–M5 abgeschlossen — Endabgleich vom 2026-11-13
|
||||
|
||||
Alle vereinbarten begrenzten Linux-dev/test-Gates sind nachgewiesen.
|
||||
|
||||
@@ -9,7 +9,7 @@ abgenommen.**
|
||||
| Ziel | Build | Tatsächlicher nativer Nachweis | Offene Grenzen |
|
||||
| --- | --- | --- | --- |
|
||||
| Ubuntu 24.04 x86-64, Cloud-Linux-Client | Rust 1.99.1, GNU/glibc, Bookworm-Buildbasis; Agent-/Helperartefakte benötigen höchstens GLIBC 2.34; neue 1-GiB-Variante mit 126 lokalen Tests qualifiziert | systemd-Agent, mTLS/WSS und HTTPS/Auto-Fallback, TLS-Lifecycle, Inventar/Heartbeat; genehmigte Skript-/Rootdienst-/begrenzte Logstrecke, Doppelzustellung/ACK-Verlust; alle drei aktiven Offlinefälle und Prozessabbruch mit dauerhaftem Unknown, signiertem Abschluss und unabhängigem Zähler; begrenztes M4-Update 1.0→1.1 und beide 1.1-Noops; eigener einmaliger Reboot mit signiertem Abschluss; automatische Helper-Startwiederholung; aktuelle native APT-Kopienqualifikation; MCP-Endbericht mit sieben erfolgreichen Operationen und DoD-Endabgleich bestanden | Begrenztes dev/test-MVP M0–M5 abgeschlossen. Genau eine reale Ziel-VM, keine Mehrgeräte-/Mischplattform- oder Produktionsabnahme. Rebootrechte und APT-Endpunkt geschlossen; 18 Rootverbräuche abgeglichen, alte APT-Fehlschläge erhalten. |
|
||||
| Windows 11 Pro, Build 26300, x86-64, eigener Gast | `x86_64-pc-windows-gnu` Crossbuild Debug/Release und Clippy bestanden | LocalService/Service-SID, Enrollment, ausgehendes mTLS/WSS, gespeichertes `windows.base`, zwei frische Heartbeats, Tenant-B-Verweigerung; sieben native Tests, konkrete Inventar-ACKs | Unsignierter Entwicklungsbuild. Kein Jobexecutor/Helper/PowerShell-/Paketpfad. HTTPS, Rotation/Widerruf, MSI/EXE, signierter Installer und Rebootpersistenz noch nicht nativ abgenommen. Registry-Produktname meldet noch den tatsächlichen Legacywert „Windows 10 Pro“; unabhängige CIM-Probe bestätigt Windows 11. |
|
||||
| Windows 11 Pro, Build 26300, x86-64, eigener Gast | `x86_64-pc-windows-gnu` Crossbuild Debug/Release und Clippy bestanden | LocalService/Service-SID, Enrollment, ausgehendes mTLS/WSS und separat natives explizites HTTPS, gespeichertes `windows.base`, frische Heartbeats und konkrete Inventar-ACKs; Tenant-B-Verweigerung, sieben native Rusttests. HTTPS-Abnahme erhielt Identität/ACLs und restaurierte Original-WSS. | Unsignierter Entwicklungsbuild. Kein Jobexecutor/Helper/PowerShell-/Paketpfad. Automatischer Fallback, Rotation/Widerruf, MSI/EXE, signierter Installer und Rebootpersistenz noch nicht nativ abgenommen. Registry-Produktname meldet noch den tatsächlichen Legacywert „Windows 10 Pro“; unabhängige CIM-Probe bestätigt Windows 11. |
|
||||
| Windows MSVC-Ziel | Geplant | Nicht ausgeführt | GNU-Build/-Lauf ist kein MSVC-Nachweis. |
|
||||
| ARM64-Agenten, weitere Windows-/Linux-Versionen | Nicht freigegeben | Keine entsprechende native Agentabnahme | Keine Supportableitung aus einem Compilerziel oder ARM64-Server. |
|
||||
| Ubuntu 26.04 ARM64, dedizierter Cloudserver | Native ARM64-Serverbuilds bestanden | API/Gateway/PostgreSQL, Migrationen 1–13 und Clientverbindungen auf `discovery.ease-technologies.de` | Öffentliche WebUI/OIDC und Produktionsbetrieb nicht abgenommen; Verwaltungs-UI nur über SSH-Tunnel. Kein ARM64-Agentnachweis. |
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
# Windows-Client: Abnahmegates
|
||||
|
||||
Stand 2026-11-13, Spezifikation 1.15. Der Windows-11-x64-Gast ist ein eigenes
|
||||
Testgerät. Der Notebook-Host bleibt ausschließlich Entwicklungsrechner;
|
||||
Server ist `discovery.ease-technologies.de`. Das abgeschlossene Linux-MVP
|
||||
bleibt eine eigenständige Abnahme. Dieser Bericht erweitert dessen Umfang nicht.
|
||||
|
||||
| Strecke | Tatsächlicher Stand | Nächster Nachweis |
|
||||
| --- | --- | --- |
|
||||
| Zugang | Gepinnter Reverse-SSH-Zugang zum Gast vorhanden; keine öffentliche Windows-SSH-Freigabe. Bestehender Agent bei Wiederaufnahme als LocalService laufend, Auto-Start, unveränderte Identität, kein Enrollmenttoken. | Zugang zeitlich begrenzt; keine automatische Verlängerung oder neue öffentliche Portfreigabe. |
|
||||
| Passiver Client | SCM-Dienst, Service-SID/ACLs, Enrollment/mTLS/WSS, Inventar mit Quelle/Zeit, Heartbeats und Mandantentrennung nativ bestanden; sieben native Rusttests. | Bestehende Identität und Telemetriehistorie bei allen weiteren Schritten erhalten. |
|
||||
| HTTPS/Fallback | Explizites HTTPS unter bestehendem LocalService mit zwei frischen Heartbeats, Inventar-ACK und Tenantverweigerung nativ bestanden; ursprüngliche WSS-Bytes/ACLs restauriert,0Jobs/Grants. | Automatische Auswahl nach exakt begrenzten WSS-Verweigerungen noch separat prüfen. |
|
||||
| TLS-Lifecycle | TLS-Verifikation vorhanden, passive Identität funktioniert. Keine native Windows-Rotation/Widerrufsabnahme. | Native falsche CA/Name und abgelaufenes Clientzertifikat mit gültigen Kontrollen; danach gesonderte sichere Rotation/Widerruf. Permanente Identität nicht widerrufen oder ersetzen. |
|
||||
| Signierter Jobkern | Windows verweigert Jobangebote/Grants ausdrücklich und meldet keine Ausführungscapability. | Gemeinsamen Sync-/Checkpoint-/Einmalverbrauchskern portieren; vertrauenswürdige Uhr, Journalmigration ohne Reset, Schlüsselbindung und Fehlerpfade qualifizieren. |
|
||||
| PowerShell | Noch kein Executor oder freigegebener Interpreter. Server/UI lösen derzeit Linuxvarianten auf. | Exakte Windows-PowerShell-5.1-Bytes, Ausgabeencoding, Prozessgrenzen und unprivilegierte Ausführungsidentität binden. Erst nach vollständigem Antrag und tatsächlichem WebUI-Klick ausführen. |
|
||||
| Privilegierte Aktionen | Kein Windows-Helper, keine Named-Pipe-Aktionsschnittstelle. | Eigenständiger restriktiver Helper mit geprüfter Pipe-Identität und unabhängiger Signatur-/Plan-/Grantprüfung; keine SYSTEM-Netzwerkkomponente. |
|
||||
| Pakete/Dienste/Logs | Noch keine native Windows-Aktionsabnahme. | Begrenzte geprüfte MSI-/EXE-Rezepte, Dienst-/Eventlogadapter und unabhängige Nachbedingungen. Keine allgemeinen Installershellstrings oder impliziten Reboots. |
|
||||
| Dauerhafte Jobs/Fehlerfälle | Linuxnachweise vorhanden; sie ersetzen keine nativen Windowsnachweise. | Redelivery/ACK-Verlust, Prozessabbruch, Offline/Ablauf/Entzug und Wiederanlauf am tatsächlichen Windows-Jobpfad prüfen. |
|
||||
| Mischplattform | Windows/Linux sind separat inventarisierbar; noch keine gemischte Skriptabnahme. | AT-15 mit festen Varianten/Zielen, passenden Interpretern und nachvollziehbaren Einzelresultaten. |
|
||||
| Reboot/Installer | Entwicklungsbuild unsigniert, GNU-Crossbuild; kein MSVC-/signierter Installer-/Windows-Rebootnachweis. | Eigene Abnahmen; kein Windows-Reboot ist durch den bereits ausgeführten Linux-Testreboot autorisiert. |
|
||||
|
||||
Jeder RMM-Job beginnt als persistenter Antrag `pending_approval`, ohne Jobs,
|
||||
Outbox oder Startgrants. Nur die tatsächliche interaktive WebUI-Genehmigung
|
||||
aktiviert den unveränderlichen Plan. Die bestehende sichtbare dev/test-Simulation
|
||||
bleibt separat auditiert und ist kein Produktionsfreigabenachweis.
|
||||
Bootstrapwartung an eigenen Agentdateien und Lesen gespeicherter Daten erzeugen
|
||||
keine RMM-Ausführungsberechtigung. Live-Diagnose nicht als Inventar tarnen.
|
||||
|
||||
Quellen und bisherige native Nachweise:
|
||||
[Windows-Client](../deploy/windows/CLIENT.md),
|
||||
[Plattformmatrix](platform-support.md), [Implementierungsstand](implementation-status.md).
|
||||
@@ -0,0 +1,172 @@
|
||||
# Grenze vor dem ersten Windows-PowerShell-Job
|
||||
|
||||
Stand 2026-11-13, Spezifikation **1.15**. Dieses Dokument beschreibt notwendige
|
||||
Voraussetzungen und offene Nachweise, keine neue Zeitvertrauensentscheidung und
|
||||
keine Windows-Jobfreigabe. Notebook ausschließlich Entwicklungsrechner;
|
||||
Windows-11-Testgast als eigenes Gerät, Server `discovery.ease-technologies.de`.
|
||||
Der abgeschlossene Linux-MVP bleibt eigenständig; diese Planung startet keine
|
||||
Linux-Jobs. Passive Windows-Nachweise: [Clientstand](../deploy/windows/CLIENT.md),
|
||||
fortgeführte Foundation-Abnahmen: [Windows-Gates](windows-gates.md).
|
||||
|
||||
## Aktuelle Grenze
|
||||
|
||||
Der Windows-Agent bietet ausschließlich `windows.base/1` und `heartbeat/1` an.
|
||||
Er besitzt bisher keinen Jobexecutor, Startgrantverbrauch oder privilegierten
|
||||
Helper und verweigert JobOffers/ExecutionPermits. Implementierte passive
|
||||
Transportfunktionen sind kein Nachweis ausführbarer Windows-Jobs.
|
||||
|
||||
Auch der erste Hello-Job benötigt einen persistenten Antrag `pending_approval`
|
||||
und einen unveränderlichen, tatsächlich in der WebUI genehmigten Plan.
|
||||
Browserautomatisierung darf nur die vorhandene, sichtbar simulierte
|
||||
dev/test-Grenze bedienen; keine API-/DB-Genehmigung. Vor Genehmigung bleiben
|
||||
Jobs/Outbox/Startgrants/Wirkung null. Neue Versuche benötigen neue Genehmigung;
|
||||
Redelivery darf keine zweite Wirkung erzeugen, unklare Wirkung bleibt `unknown`.
|
||||
|
||||
## TrustedClock: belegte Möglichkeiten, offene Qualifikation
|
||||
|
||||
Die Spezifikation verlangt bei unklarer Uhrabweichung `CLOCK_UNTRUSTED`;
|
||||
Telemetrie darf weiterlaufen. `Utc::now()`, laufender W32Time-Dienst, jüngster
|
||||
Eventlogeintrag oder ein frischer Grant beweisen keine vertrauenswürdige Uhr.
|
||||
`GetSystemTimeAdjustmentPrecise` beschreibt Regelungsmodus und Frequenz, keinen
|
||||
Synchronisierungsstatus: [Microsoft-API](https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getsystemtimeadjustmentprecise).
|
||||
|
||||
Microsoft dokumentiert für lokales `w32tm` Administratorrechte. Deshalb ist ein
|
||||
erfolgreicher Administratoraufruf kein Nachweis für den tatsächlichen
|
||||
LocalService-Agenten. Lokalisierte CLI-Texte sind außerdem kein strukturierter
|
||||
Produktvertrag: [W32Time-Werkzeuge und Rechte](https://learn.microsoft.com/en-us/windows-server/networking/windows-time-service/Windows-Time-Service-Tools-and-Settings).
|
||||
|
||||
Der dokumentierte strukturierte Weg ist MS-W32T `W32TimeQueryStatus`, Opnum6,
|
||||
Interface-UUID `8fb6d884-2388-11d0-8c35-00c04fda2795`, Version4.1. Es handelt
|
||||
sich um einen RPC-/IDL-Vertrag, keinen hier nachgewiesenen einfachen SDK-Import.
|
||||
`W32TIME_STATUS_INFO` liefert `ulLcState`, `qwLastSyncTicks`,
|
||||
`tpTimeLastGoodSync`, `toSysPhaseOffset`, `tpRootDispersion`, `nStratum`,
|
||||
`eLeapIndicator` und `eLastSyncResult`:
|
||||
[Methode](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-w32t/7e80a465-f5f4-4c3c-87ef-12f76e45f8d1),
|
||||
[Statusstruktur](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-w32t/f60ebce0-df96-4c96-b40b-fdbd34a2c936),
|
||||
[vollständiges IDL](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-w32t/5793e908-22ef-4cea-962f-fca8a72c485a).
|
||||
|
||||
`SYNC=2` bezeichnet Synchronisierung; `UNSET`, `HOLD`, `SPIKE` sind kein
|
||||
gleichwertiger Beleg. Synchronisierungszustand allein garantiert keine bestimmte
|
||||
Genauigkeit. `TSF_Authenticated` zeigt gesondert die Verwendung der
|
||||
MS-SNTP-Authentifizierungserweiterung an, nicht bloß einen erfolgreichen lokalen
|
||||
RPC-Aufruf:
|
||||
[Zustände](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-w32t/b4abb4b0-6d6e-41e4-bd41-d54980d0598a),
|
||||
[Zeitdienstelemente und Einheiten](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-w32t/1da649d7-3edf-4a9a-98c2-907ecacd1633).
|
||||
|
||||
Eine eigene RPC-Anbindung müsste lokal den authentifizierten Endpunkt
|
||||
`\\PIPE\W32TIME_ALT` verwenden und jede automatische Rückstufung auf das
|
||||
unauthentifizierte `\\PIPE\W32TIME` verweigern. Der Zugriff unter LocalService
|
||||
ist **nicht nativ geprüft**:
|
||||
[Transport](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-w32t/e0803f6b-e175-4b87-ba63-bbcf51175655),
|
||||
[Sicherheitsbetrachtung](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-w32t/22d6e8df-0195-476f-8e8e-d81e700f4474).
|
||||
|
||||
### Kleinste Readinessprobe: geplant, nicht ausgeführt
|
||||
|
||||
1. Im tatsächlichen LocalService-Dienst Token-SID und fehlende Elevation prüfen;
|
||||
keine erfolgreiche Administrator-SSH-Probe als Ersatz verwenden.
|
||||
2. Ausschließlich einen festen lokalen Statusabruf mit Zeit-/Ausgabelimit
|
||||
qualifizieren. Keine Resynchronisierung, Clock-/Service-ACL-Änderung oder
|
||||
zusätzliche Administratorberechtigung. Ein fester CLI-Zugriffsversuch kann
|
||||
die Rechtefrage eingrenzen, ersetzt aber keinen robusten Statusvertrag.
|
||||
3. Nur begrenzte numerische Statusfelder/Fehlercodes veröffentlichen;
|
||||
`unsupported`, `permission_denied` und `unsynchronized` ausdrücklich melden.
|
||||
Keine Peer-Adressen oder vollständigen Rohdaten veröffentlichen.
|
||||
4. Vor Jobfähigkeit eine dokumentierte Genauigkeitspolitik implementieren und
|
||||
nativ prüfen: gültiger Syncstatus, frischer erfolgreicher Abgleich,
|
||||
begrenzte Dispersion/Phasenabweichung und monotone Wallclock-Abweichung.
|
||||
Konkrete Grenzwerte sind hier noch nicht beschlossen oder qualifiziert.
|
||||
Fehler, veraltete Daten oder unbekannte Felder schließen das Startgate.
|
||||
|
||||
Der dokumentierte RPC-Weg ist ein Implementierungskandidat. Ob er mit den
|
||||
vorhandenen Buildtools und ohne zusätzliche Rechte zuverlässig unter LocalService
|
||||
verwendbar ist, bleibt offen. Bis zur Qualifikation bleiben Windows-Jobs gesperrt.
|
||||
|
||||
### Signierter Serverzeitanker: Alternative, nicht beschlossen
|
||||
|
||||
Ein kryptografischer Zeitanker wäre ein eigener expliziter Vertrauensvertrag.
|
||||
Aktuell benötigt bereits `ClientSync.prepare()` eine vertrauenswürdige Uhr;
|
||||
`verify_response()` prüft ebenfalls die Zeit. Eine signierte Syncantwort darf
|
||||
diesen Kreis nicht stillschweigend umgehen. `ServerHello` enthält im aktuellen
|
||||
Protobuf nur Generation und Nachrichtenlimit, obwohl die Spezifikationstabelle
|
||||
zusätzlich Serverzeit nennt. Weder eine erfundene Hellozeit noch HTTP-`Date`
|
||||
beheben diese Lücke.
|
||||
|
||||
Ein gegebenenfalls gesondert spezifizierter Zeit-Bootstrap müsste zunächst ohne
|
||||
Startwirkung bleiben: frische Zufallschallenge, eigener signierter Domain-Tag,
|
||||
Identitäts-/Generations-/Boot-/Channelbindung, begrenzte monotone Roundtripzeit
|
||||
und konservatives UTC-Unsicherheitsintervall. Nur wenn das gesamte Intervall im
|
||||
gültigen Grantstartfenster liegt, wäre ein Start zulässig. Kein Verlängern eines
|
||||
Grants, kein Wiederverwenden alter Antworten nach Prozess-/Bootwechsel; Suspend
|
||||
müsste ebenfalls qualifiziert oder der Anker verworfen werden. Rust garantiert
|
||||
keine plattformübergreifend konstante Suspendbehandlung von `Instant`:
|
||||
[Rust-Primärdokumentation](https://doc.rust-lang.org/std/time/struct.Instant.html).
|
||||
Das ist ausdrücklich **keine** implementierte oder genehmigte Clock-Ausnahme.
|
||||
|
||||
## Gemeinsamer Sicherheitskern statt zweiter Sync-State-Machine
|
||||
|
||||
Geplant ist ein kleiner plattformneutraler Kern gemäß der vorgesehenen
|
||||
`agent-core`-Grenze: `AuthBinding`/`Request` mit unveränderter Serde-Struktur und
|
||||
Bytekodierung, bestehender `ClientSync` samt Checkpoints, Replay, konkreten ACKs,
|
||||
Unknown-Behandlung und Gate-Schließung. Unix-Dateischutz, Helper-IPC und
|
||||
Linux-`NativeClock` bleiben Plattformadapter. `SyncClock` existiert bereits als
|
||||
Port. Windows darf keine Unix-Helper-Abhängigkeiten oder kopierte abweichende
|
||||
Sync-State-Machine benötigen.
|
||||
|
||||
Ed25519-Verifikation kann einen kleinen gemeinsamen Verifier-Port erhalten:
|
||||
Linux zunächst unverändert OpenSSL, Windows das bereits im Lockfile vorhandene
|
||||
`ed25519-dalek 2.2.0`. Dessen `verify_strict` ist nicht automatisch verhaltensgleich
|
||||
mit OpenSSL; Regeln für schwache Schlüssel/nichtkanonische Signaturen müssen
|
||||
bewusst geprüft werden:
|
||||
[Dalek2.2.0-Verifikation](https://docs.rs/ed25519-dalek/2.2.0/ed25519_dalek/struct.VerifyingKey.html#method.verify_strict).
|
||||
|
||||
Notwendige gezielte Qualifikation, **noch nicht ausgeführt**: Codec-Goldenbytes
|
||||
vor/nach Extraktion; gültige/manipulierte Permit-/Syncsignaturen mit beiden
|
||||
Backends einschließlich Grenzfällen; bestehende Sync-Replay-/Checkpoint-Tests
|
||||
auf gemeinsamem Kern; additive Windows-Journalmigration mit erhaltener Identität,
|
||||
monotoner Sequenz und bytegleichen unbestätigten Ereignissen. Kein Reset oder
|
||||
neues Enrollment für den Übergang zum Jobjournal.
|
||||
|
||||
Die derzeitige `telemetry.sqlite` ist noch kein vollständiges Jobjournal.
|
||||
`crates/agent-windows/src/journal.rs` begrenzt die Queue auf acht Ereignisse mit
|
||||
je höchstens512KiB, prüft aber noch kein explizites SQLite-`page_size`/
|
||||
`max_page_count`. Vor dem Jobport ist zusätzlich das endliche Datenbankbudget
|
||||
gemäß Spezifikation1.15 zu übernehmen und nativ mit Erhalt von Sequenz, konkreten
|
||||
ACKs und Datenbank-Geräteidentität zu qualifizieren. Die Queuegrenze allein ist
|
||||
kein Nachweis eines begrenzten Datenbankfiles; kein Löschen für Platzgewinn.
|
||||
Diese offene Voraussetzung verändert weder den aktuellen Transportbuild noch
|
||||
die weiterhin fehlenden Windows-Jobcapabilities.
|
||||
|
||||
## Erste Hello-Strecke: Voraussetzungen vor Capability und Wirkung
|
||||
|
||||
- Domain, Server und WebUI additiv um plattformgebundene Interpreterpläne
|
||||
ergänzen. Derzeit ist `run_script` auf `posix_sh|bash` beziehungsweise Linux
|
||||
beschränkt. Windows PowerShell5.1 (`powershell`) und PowerShell7 (`pwsh`) sind
|
||||
getrennte Fähigkeiten, kein stiller Fallback. Windows-/Linux-Mischungen,
|
||||
unbekannte Interpreter und fehlende Capability bleiben an allen relevanten
|
||||
Plan-/Genehmigungs-/Startgrenzen verweigert; bestehende Linuxfälle erhalten.
|
||||
- Eindeutige Windows-Variante, exakte UTF8-Skriptbytes/Argumente, Hash,
|
||||
Zielidentität und `agent_service` vor Genehmigung binden. Erst nach echter
|
||||
Bereitschaft Script-/Interpreter- und `rmm.sync.v1`-Capabilities anbieten;
|
||||
Clock-, frischer Sync-, Permit- und dauerhafter Einmalverbrauch gemeinsam nötig.
|
||||
- Tatsächliches LocalService-Token vor Ausführung prüfen. Kein Administrator-
|
||||
oder SYSTEM-Fallback. Maschinen-/Gruppenrichtlinie, WDAC/AppLocker nicht
|
||||
abschwächen; keine versteckte `ExecutionPolicy Bypass`-Ausnahme. Der frühere
|
||||
prozessbezogene Bootstrap-`RemoteSigned`-Aufruf ist keine Jobfreigabe.
|
||||
- Festen kanonischen PowerShellpfad verwenden, geschützte neu erzeugte `.ps1`
|
||||
ohne Reparse-Points und strukturierte Argumente. Keine Shellverkettung oder
|
||||
nachträgliche BOM-/Encoding-/Prologänderung an genehmigten Bytes. WinPS5.1-
|
||||
Encodingverhalten nativ qualifizieren; die erste ASCII-Hello-Fixture beweist
|
||||
noch keine beliebige Unicode-Skriptausführung.
|
||||
- Netzwerk/Heartbeats dürfen nicht am Kindprozess blockieren. Begrenzte parallele
|
||||
Rohbyteausgabe mit Truncation, Timeout/Cancel und vollständiger Prozessbaum-
|
||||
Beendigung über qualifiziertes Windows-Job-Object; kein unbeschränktes
|
||||
`Command.output()` für freien Jobcode. Keine vererbten Gerätekey-/DB-Handles.
|
||||
- Startverbrauch vor Kindstart dauerhaft speichern, Ergebnis bis konkretem ACK
|
||||
behalten. Absturz nach möglicher Wirkung bleibt `unknown`, keine automatische
|
||||
Wiederholung. Der Hello-Nachweis prüft genau seinen gebundenen Exit/Output;
|
||||
eine dokumentierte CRLF/LF-Textnormalisierung ersetzt keine Rohbyteerhaltung.
|
||||
|
||||
SYSTEM-/NamedPipe-Helper, MSI, Paketverwaltung und Windows-Reboot sind nicht Teil
|
||||
dieser ersten unprivilegierten Hello-Strecke. Dieses Dokument wurde ausschließlich
|
||||
aus Quellcode und den verlinkten Primärquellen erstellt; keine Produktänderungen,
|
||||
Builds, Tests oder VM-/Serverkontakte für diese Planung durchgeführt.
|
||||
@@ -0,0 +1,119 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Source-only acceptance-runner guards; no Windows/server access."""
|
||||
import copy
|
||||
import datetime as dt
|
||||
import hashlib
|
||||
import pathlib
|
||||
import sys
|
||||
import tempfile
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
|
||||
ROOT = pathlib.Path(__file__).resolve().parents[1]
|
||||
sys.path.insert(0,str(ROOT/'deploy/windows'))
|
||||
import transport_acceptance as acceptance
|
||||
|
||||
|
||||
def state(transport='wss'):
|
||||
return dict(agent_id=acceptance.AGENT,asset_id=acceptance.ASSET,
|
||||
transport=transport,config_sha256=acceptance.ORIGINAL_CONFIG,
|
||||
config_acl_sha256='original-acl',hashes={'private_key':'retained'},acl_sha256={'private_key':'retained'},
|
||||
telemetry_creation_ticks=17,service_state='Running',process_owner_sid='S-1-5-19',
|
||||
journal=dict(integrity='ok',read_only=True,agent_id=acceptance.AGENT,sequence=5,pending_inventory_events=0))
|
||||
|
||||
|
||||
class Preservation(unittest.TestCase):
|
||||
def test_existing_identity_hash_acl_and_sequence_cannot_drift(self):
|
||||
original=state();acceptance.preserved(original,copy.deepcopy(original))
|
||||
for mutate in (
|
||||
lambda value:value['hashes'].update(private_key='replaced'),
|
||||
lambda value:value['acl_sha256'].update(private_key='broader'),
|
||||
lambda value:value.update(asset_id='different'),
|
||||
lambda value:value.update(telemetry_creation_ticks=99),
|
||||
lambda value:value['journal'].update(agent_id='different'),
|
||||
lambda value:value['journal'].update(sequence=4),
|
||||
lambda value:value['journal'].update(integrity='corrupt'),
|
||||
):
|
||||
changed=copy.deepcopy(original);mutate(changed)
|
||||
with self.subTest(changed=changed),self.assertRaises(acceptance.cb.contract.GuardError):
|
||||
acceptance.preserved(original,changed)
|
||||
|
||||
def test_passive_https_does_not_require_fabricated_job_sync_readiness(self):
|
||||
at=dt.datetime(2026,11,13,tzinfo=dt.timezone.utc)
|
||||
base=dict(agent_id=acceptance.AGENT,asset_id=acceptance.ASSET,enrollment_generation=1,
|
||||
assignment_version=1,certificate_sha256='retained')
|
||||
values=[dict(device=dict(base,transport='https',last_contact_at=(at+dt.timedelta(seconds=i)).isoformat(),
|
||||
sync_ready=False,restore_blocked=True)) for i in (1,2)]
|
||||
with patch.object(acceptance,'observe',side_effect=values),patch.object(acceptance.time,'sleep'):
|
||||
actual=acceptance.wait_mode('unused','https',at,base)
|
||||
self.assertNotEqual(actual['first']['device']['last_contact_at'],actual['second']['device']['last_contact_at'])
|
||||
self.assertFalse(actual['second']['device']['sync_ready'])
|
||||
|
||||
def test_actual_transport_receipt_cannot_change_identity_generation(self):
|
||||
at=dt.datetime(2026,11,13,tzinfo=dt.timezone.utc)
|
||||
base=dict(agent_id=acceptance.AGENT,asset_id=acceptance.ASSET,enrollment_generation=1,
|
||||
assignment_version=1,certificate_sha256='retained')
|
||||
bad=dict(device=dict(base,transport='https',assignment_version=2,last_contact_at=(at+dt.timedelta(seconds=1)).isoformat()))
|
||||
with patch.object(acceptance,'observe',return_value=bad),self.assertRaises(acceptance.cb.contract.GuardError):
|
||||
acceptance.wait_mode('unused','https',at,base)
|
||||
|
||||
def test_same_case_restore_intent_is_reused_but_changed_intent_refused(self):
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
folder=pathlib.Path(tmp)
|
||||
acceptance.fixed_intent(folder,'intent.json',{'id':'same'})
|
||||
acceptance.fixed_intent(folder,'intent.json',{'id':'same'})
|
||||
with self.assertRaises(acceptance.cb.contract.GuardError):
|
||||
acceptance.fixed_intent(folder,'intent.json',{'id':'changed'})
|
||||
|
||||
def test_short_pinned_launchers_do_not_embed_full_script(self):
|
||||
for value in (acceptance.LAUNCH_SCRIPT,acceptance.PREPARE_SCRIPT):
|
||||
# Includes the enclosing fixed bootstrap try/catch overhead.
|
||||
self.assertLess((len(value.encode('utf-16le'))+1024)*4//3,7500)
|
||||
self.assertNotIn('device.key',acceptance.LAUNCH_SCRIPT)
|
||||
self.assertIn('Get-FileHash',acceptance.LAUNCH_SCRIPT)
|
||||
|
||||
|
||||
class Resumption(unittest.TestCase):
|
||||
def test_finish_after_saved_https_and_restored_wss_performs_no_mutation(self):
|
||||
ident='11111111-1111-4111-8111-111111111111'
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
root=pathlib.Path(tmp);folder=root/ident;folder.mkdir(mode=0o700)
|
||||
source=hashlib.sha256(acceptance.SCRIPT.encode()).hexdigest()
|
||||
acceptance.save(folder,'intent.json',dict(id=ident,case='explicit_https',started_at='2026-11-13T00:00:00Z',source_sha256=source))
|
||||
acceptance.save(folder,'before.json',dict(native=state(),central={'device':{}},gate=dict(jobs=0,outbox=0,permits=0,unresolved=0)))
|
||||
acceptance.save(folder,'https-accepted.json',dict(verified=True,original_receipt=True))
|
||||
acceptance.fixed_intent(folder,'restore-intent.json',dict(id=ident,expected_original_config_sha256=acceptance.ORIGINAL_CONFIG,no_jobs=True))
|
||||
calls=[]
|
||||
def remote(case,action,**kwargs):
|
||||
calls.append(action)
|
||||
self.assertEqual(case,ident)
|
||||
self.assertEqual(action,'state')
|
||||
return state()
|
||||
with patch.object(acceptance,'STATE',root),patch.object(acceptance,'remote',side_effect=remote), \
|
||||
patch.object(acceptance,'wait_mode',return_value={'two_actual_receipts':True}), \
|
||||
patch.object(acceptance,'gate',return_value=dict(jobs=0,outbox=0,permits=0,unresolved=0)),patch('builtins.print'):
|
||||
acceptance.finish(ident)
|
||||
self.assertEqual(calls,['state','state'])
|
||||
self.assertTrue(acceptance.cb.contract.protected_json(folder/'result.json')['verified'])
|
||||
self.assertTrue(acceptance.cb.contract.protected_json(folder/'https-accepted.json')['original_receipt'])
|
||||
|
||||
def test_failed_https_observation_restores_same_transition_without_acceptance(self):
|
||||
ident='11111111-1111-4111-8111-111111111111'
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
root=pathlib.Path(tmp);folder=root/ident;folder.mkdir(mode=0o700)
|
||||
source=hashlib.sha256(acceptance.SCRIPT.encode()).hexdigest()
|
||||
acceptance.save(folder,'intent.json',dict(id=ident,case='explicit_https',started_at='2026-11-13T00:00:00Z',source_sha256=source))
|
||||
acceptance.save(folder,'before.json',dict(native=state(),central={'device':{}},gate=dict(jobs=0,outbox=0,permits=0,unresolved=0)))
|
||||
calls=[]
|
||||
def remote(case,action,**kwargs):
|
||||
calls.append(action)
|
||||
return state('https') if action=='state' else {'restored':True}
|
||||
with patch.object(acceptance,'STATE',root),patch.object(acceptance,'remote',side_effect=remote), \
|
||||
patch.object(acceptance,'wait_mode',side_effect=acceptance.cb.contract.GuardError('no fresh heartbeats')):
|
||||
with self.assertRaises(acceptance.cb.contract.GuardError):acceptance.finish(ident)
|
||||
self.assertEqual(calls,['state','state','restore'])
|
||||
self.assertFalse((folder/'result.json').exists())
|
||||
self.assertFalse((folder/'https-accepted.json').exists())
|
||||
|
||||
|
||||
if __name__=='__main__':unittest.main()
|
||||
Reference in New Issue
Block a user