Repository navigation
ca-trust-guard: observe the Homebrew bundle store only when it exists - #162
Conversation
Keep the macOS system store unconditional, but observe Homebrew only when prefix discovery succeeds and its CA bundle exists. Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
Superseded — see the current review report for commit
|
General PR Review: ca-trust-guard: observe the Homebrew bundle store only when it existsBlocking Issues: 0 | Suggestions: 0 | Threads Resolved: 0 Review SummaryOn Darwin,
No repo-local criteria loaded, so only the base criteria were applied. Not verified: behavior on a native macOS runner, which the author also says was not run. Security IssuesNone found. Correctness IssuesNone found. SuggestionsNone. Reviewed commit: |
Why
Post-merge review of #160 surfaced a real bug (adjudicated from the CI reviewer thread):
discoverStores's Darwin branch discardedbrew --prefix's error and unconditionally added themacos-brewstore. On a self-hosted mac without Homebrew (or without the brewedca-certificatesformula), the resolved path doesn't exist → openssl fails to load the-CAfile→ anERRORrow → the action fails closed in both report and enforce mode — a job-blocker on brew-less macs, where the store should simply not be observed (macos-brewis residual-not-gating, so skipping it never weakens the enforce gate).What
probe.go:macos-etc-ssl-cert-pemis always observed;macos-brewis added only whenbrew --prefixsucceeds, returns a non-empty prefix, and the resolved bundle exists on disk (mirrors the existing certifi guard on the Linux branch).TestDiscoverStoresDarwin: five cases (brew unavailable, brew error with output, empty prefix, bundle present with the correct resolved path, bundle absent) using a temporary Homebrew-shaped prefix and real filesystem checks.macos-brewis observed only when Homebrew and its ca-certificates bundle are present.Verification
go vet+ full guard Go suite green incl. the new test (0.34s); image-lock gate green.