Refuse to serve the Halibut identity committed to this repository
Summary
-
appsettings.jsonships a real, working PKCS#12 underSelfCert:Base64with its password beside it. That certificate is the Halibut server identity — the thumbprint every Tentacle pins for mTLS. A deployment is expected to override it, but nothing enforced that, so a deploy that forgot silently served the public identity: anyone with repository read access could impersonate the server to every agent trusting that thumbprint and dispatch scripts across the fleet. -
SelfCertValidatorrejects it at startup. An absent identity is refused unconditionally (no mode substitutes for a missing one, and this beats an opaqueFormatExceptionfrom inside the loader). A known-published thumbprint followsSQUID_SELFCERT_ENFORCEMENT:offallows silently,warnallows and logs,strictrefuses. Any other certificate is allowed in every mode. - The default is
strict, not the sharedwarn— a warning about a published server identity is easy to miss and the consequence is fleet-wide impersonation. Same call the master-key guard made.
Operational consequence
A server whose config still carries the committed certificate will now refuse to start, naming the thumbprint and the env var that overrides the decision. Deployments that template their own appsettings are unaffected. Rotating the committed certificate must add its old thumbprint to KnownPublishedThumbprints, never replace it, so operators still running the previous one keep being told.
Test plan
-
Unit: full (certificate × mode) matrix, including that a deployment-specific certificate is allowed in every mode -
Unit: drift guard recomputes the thumbprint from the real appsettings.jsonrather than trusting the pinned constant -
Unit: wiring tests resolve HalibutRuntimefrom a real Autofac container, so the guard being on the identity path is pinned, not just the guard itself -
Mutation: deleting either call site from HalibutModuleleft the whole suite green before those wiring tests; each of the three mutants now fails -
Hermetic under SQUID_SELFCERT_ENFORCEMENTunset,offandwarn— 17/17 in all three -
Full unit suite green