Skip to content

The cross-harness, self-improving memory layer for AI agents. Join our community: https://discord.com/invite/zdNChS2fBu

sentinel: pin the PFX encodings Vector reads; OS-neutral Vector path test

shukieshaha7dc485fcf13
diff --git a/cli/beacon/internal/endpoint/sentinel/forwarder_test.go b/cli/beacon/internal/endpoint/sentinel/forwarder_test.go
index 164d5907..2110f51a 100644
--- a/cli/beacon/internal/endpoint/sentinel/forwarder_test.go
+++ b/cli/beacon/internal/endpoint/sentinel/forwarder_test.go
@@ -404,21 +404,22 @@ func TestForwarderInstallRemovesAServiceThatNeverStarted(t *testing.T) {
// The Vector install was told to run is the one reconcile keeps running.
func TestForwarderReconcileKeepsTheVectorInstallWasGiven(t *testing.T) {
newForwarderFixture(t)
+ custom := filepath.Join(t.TempDir(), "vector")
var asked []string
findVector = func(explicit string) (asymptote.VectorInfo, error) {
asked = append(asked, explicit)
- return asymptote.VectorInfo{Path: "/custom/vector", Version: "0.56.0"}, nil
+ return asymptote.VectorInfo{Path: custom, Version: "0.56.0"}, nil
}
o := validInstall()
- o.VectorBin = "/custom/vector"
+ o.VectorBin = custom
if _, err := Install(o); err != nil {
t.Fatal(err)
}
if _, err := Reconcile(ReconcileOptions{Restart: true}); err != nil {
t.Fatal(err)
}
- if len(asked) != 2 || asked[0] != "/custom/vector" || asked[1] != "/custom/vector" {
- t.Fatalf("findVector was asked for %q", asked)
+ if len(asked) != 2 || asked[0] != custom || asked[1] != custom {
+ t.Fatalf("findVector was asked for %q, want %s twice", asked, custom)
}
}
diff --git a/packaging/windows/smoke-sentinel-forwarder.ps1 b/packaging/windows/smoke-sentinel-forwarder.ps1
index 74547ccd..9e124e5d 100644
--- a/packaging/windows/smoke-sentinel-forwarder.ps1
+++ b/packaging/windows/smoke-sentinel-forwarder.ps1
@@ -150,8 +150,8 @@ switch ($Phase) {
if ($LASTEXITCODE -ne 0 -or -not (Test-Path -LiteralPath $pfx)) { throw "openssl could not make the test PFX" }
Remove-Item -LiteralPath $key
- # Which PFX encodings the bundled Vector can read, recorded for the docs: Windows'
- # Export-PfxCertificate with each algorithm, and OpenSSL's default.
+ # The PFX encodings the docs say work: Windows' Export-PfxCertificate with either algorithm,
+ # and OpenSSL's default. The bundled Vector has to read every one.
$cert = New-SelfSignedCertificate -Subject 'CN=beacon-sentinel-smoke-export' -CertStoreLocation Cert:\LocalMachine\My `
-KeyAlgorithm RSA -KeyLength 2048 -KeyExportPolicy Exportable -NotAfter (Get-Date).AddDays(2)
$cert.Thumbprint | Set-Content -LiteralPath (Join-Path $work 'cert-thumbprint')
@@ -185,9 +185,11 @@ certificate_path = '$($variants[$name])'
certificate_password = '$pfxPassword'
"@ | Set-Content -LiteralPath $probe -Encoding ascii
$out = & $vectorExe validate --skip-healthchecks $probe 2>&1 | Out-String
- $verdict = if ($LASTEXITCODE -eq 0) { 'accepted' } else { 'REJECTED: ' + (($out -split "`n" | Where-Object { $_ -match 'PKCS12|Sink' }) -join ' ').Trim() }
- Write-Output "pfx probe: $name -> $verdict"
- $global:LASTEXITCODE = 0
+ if ($LASTEXITCODE -ne 0) {
+ Write-Output $out
+ throw "the bundled Vector cannot read a PFX made with $name"
+ }
+ Write-Output "ok: the bundled Vector reads a PFX made with $name"
}
# The mock outlives this step: it keeps answering through the upgrade and the log access