34 lines
2.0 KiB
PowerShell
34 lines
2.0 KiB
PowerShell
$ErrorActionPreference = 'Stop'
|
|
$auditOutput = $PSScriptRoot
|
|
$entryAddress = 'https://portal-investidor.test:18445/aceitacao-B-396c691930bc.html'
|
|
$runtimeAddress = 'https://portal-investidor.test:18445/_qa/runtime'
|
|
$tlsResults = @()
|
|
foreach ($qaAddress in @($entryAddress, $runtimeAddress)) {
|
|
$runtimeProbe = $qaAddress -eq $runtimeAddress
|
|
$probeOutput = if ($runtimeProbe) { Join-Path $auditOutput 'grouped-passage-runtime-readonly.tmp' } else { 'NUL' }
|
|
$httpResult = & C:\Windows\System32\curl.exe --silent --show-error --max-time 10 --output $probeOutput --write-out '%{http_code}' $qaAddress 2>&1
|
|
$probeExitCode = $LASTEXITCODE
|
|
$report = [ordered]@{ url = $qaAddress; curl_exit_code = $probeExitCode; certificate_validation_disabled = $false; authentication_used = $false }
|
|
if ($probeExitCode -eq 0) {
|
|
$report.http_status = [string]($httpResult | Select-Object -Last 1)
|
|
if ($runtimeProbe -and (Test-Path -LiteralPath $probeOutput)) {
|
|
$runtimeState = Get-Content -LiteralPath $probeOutput -Raw -Encoding UTF8 | ConvertFrom-Json
|
|
$report.target = [ordered]@{ database = $runtimeState.target.database; port = $runtimeState.target.port }
|
|
$report.expected_isolated_QA = $runtimeState.target.database -eq 'stability_consumers_20261011_084534_test' -and [int]$runtimeState.target.port -eq 55441
|
|
}
|
|
} else {
|
|
$report.error = [string]($httpResult | Select-Object -First 1)
|
|
}
|
|
$tlsResults += [pscustomobject]$report
|
|
}
|
|
$sanitizedReport = [ordered]@{
|
|
at = [DateTimeOffset]::UtcNow.ToString('o')
|
|
operation = 'GET read-only; OS TLS verification enabled; not a browser demonstration'
|
|
tls = $tlsResults
|
|
QA_data_writes = 0
|
|
active_requests = 0
|
|
cookies_or_auth_material_recorded = $false
|
|
}
|
|
$sanitizedReport | ConvertTo-Json -Depth 7 | Set-Content -LiteralPath (Join-Path $auditOutput 'grouped-passage-HTTPS-readonly-20261014.json') -Encoding UTF8
|
|
$sanitizedReport | ConvertTo-Json -Depth 7
|