Deploy-time guard: reject a Sql DriverConfig blob carrying a connectionString key (FF-3) #498
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The 'a pasted literal connection string is never persisted' guarantee for the Sql driver is enforced only at the typed-DTO layer (SqlDriverConfigDto has no connectionString property + UnmappedMemberHandling.Skip drops it on read). That protects the read path, not the write path: if the AdminUI ever persists a raw-JSON DriverConfig blob (the fallback pattern unmapped drivers use), an operator pasting {"connectionString":"Server=...;Password=..."} would write a credential into the ConfigDb DriverConfig column even though the runtime factory never reads it back. Add a DraftValidator deploy-time check that rejects any persisted Sql DriverConfig blob carrying a connectionString key (defence-in-depth regardless of how the authoring UI evolves). Surfaced by the Task 14 (SqlDriverBrowser) review.
Fixed on
fix/sql-driver-followups(1919a8e5).DraftValidator.ValidateSqlConnectionStringNotPersistedfails the deploy (SqlConnectionStringPersisted) when a Sql-typed driver instance carries a top-levelconnectionStringkey.Beyond the report:
Device.DeviceConfigis checked too, not justDriverInstance.DriverConfig.DeviceConfigis merged ontoDriverConfigbefore the DTO sees it, so a credential pasted into the device blob is the identical leak.System.Text.JsonbindsConnectionStringto aconnectionStringproperty by default, so an ordinal match would have left the obvious bypass wide open.16 tests. Verified falsifiable: with the rule disabled, the 6 positive assertions fail and the 10 negatives stay green, so none passes vacuously.
Design §8.2’s “if an inline
connectionStringis ever permitted (dev convenience only), the AdminUI redacts it” carve-out is withdrawn in the same change — redaction only hides a credential that has already been written.Not covered, filed separately as #499:
ClusterNode.DriverConfigOverridesJsonis a third persistence surface for a driver config blob, but it is not part ofDraftSnapshot, so this validator cannot see it.