Files

44 lines
1.7 KiB
PowerShell
Raw Permalink Normal View History

2026-07-12 09:39:55 +01:00
$ErrorActionPreference = "Stop"
2026-08-01 21:56:15 +01:00
$repoRoot = (Resolve-Path (Join-Path $PSScriptRoot "..")).Path
2026-08-01 22:37:57 +01:00
$venvPython = Join-Path $repoRoot ".venv\Scripts\python.exe"
$python = if (Test-Path -LiteralPath $venvPython) {
$venvPython
} else {
(Get-Command python -ErrorAction Stop).Source
}
2026-08-01 21:56:15 +01:00
$smokeRoot = Join-Path ([System.IO.Path]::GetTempPath()) ("violin-smoke-" + [guid]::NewGuid().ToString("N"))
$engagement = Join-Path $smokeRoot "engagement"
2026-07-12 09:39:55 +01:00
2026-08-01 21:56:15 +01:00
function Invoke-Guard {
param([string[]]$Arguments)
$output = & $python (Join-Path $repoRoot "scripts\violin_guard.py") @Arguments 2>&1
if ($LASTEXITCODE -ne 0) {
throw "violin_guard.py $($Arguments -join ' ') failed with exit code $LASTEXITCODE`n$($output -join "`n")"
}
return $output
2026-07-12 09:39:55 +01:00
}
try {
2026-08-01 21:56:15 +01:00
New-Item -ItemType Directory -Path $smokeRoot -Force | Out-Null
Invoke-Guard @("init-engagement", $engagement, "--host", "10.10.10.10", "--session-id", "windows-smoke") | Out-Null
$scopePath = Join-Path $engagement "scope\scope.yaml"
$scope = Get-Content -LiteralPath $scopePath -Raw
$scope = $scope -replace "confirmed: false", "confirmed: true"
Set-Content -LiteralPath $scopePath -Value $scope -Encoding UTF8
Invoke-Guard @("validate-scope", "--scope", $scopePath) | Out-Null
Invoke-Guard @(
"record-ptt", "--eng-dir", $engagement, "--id", "PT-001", "--status", "[~]",
"--note", "Windows workflow smoke", "--skill", "pentest", "--technique", "recon"
) | Out-Null
Write-Output "PASS: Windows workflow smoke completed through PTT preparation."
2026-07-12 09:39:55 +01:00
}
finally {
2026-08-01 21:56:15 +01:00
if (Test-Path -LiteralPath $smokeRoot) {
Remove-Item -LiteralPath $smokeRoot -Recurse -Force
}
2026-07-12 09:39:55 +01:00
}