feat: agent updates from SAC, poll config, SSH/WinRM fallback (0.12.0)

Add agent update settings, pending self-update via poll, desired config per host, and automatic or manual SSH/WinRM fallback when agents do not report agent.update events.
This commit is contained in:
PTah
2026-06-20 15:52:10 +10:00
parent 75f4c475df
commit cd2f27792d
24 changed files with 1494 additions and 15 deletions
+30
View File
@@ -140,6 +140,36 @@ def run_winrm_logoff(*, target: str, user: str, password: str, session_id: int)
)
def _winrm_rdp_update_remote_cmd(script_path: str) -> str:
script = script_path.strip()
if script:
return f'powershell.exe -NoProfile -ExecutionPolicy Bypass -File "{script}"'
return (
"powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "
'"& { $candidates = @('
"(Join-Path $env:ProgramData 'LoginMonitor' 'Deploy-LoginMonitor.ps1'),"
"(Join-Path $env:USERPROFILE 'Deploy-LoginMonitor.ps1')"
'); $p = $candidates | Where-Object { Test-Path $_ } | Select-Object -First 1; '
"if (-not $p) { throw 'Deploy-LoginMonitor.ps1 not found' }; & $p }'"
)
def run_winrm_rdp_monitor_update(
*,
target: str,
user: str,
password: str,
script_path: str = "",
) -> WinRmCmdResult:
return run_winrm_cmd(
target=target,
user=user,
password=password,
remote_cmd=_winrm_rdp_update_remote_cmd(script_path),
timeout_sec=900,
)
def run_winrm_on_host_targets(
host: Host,
*,