AuditLog two-login hardening: partition roll-forward and SourceNode backfill still use the runtime login #113

Closed
opened 2026-11-09 23:32:36 -05:00 by dohertj2 · 1 comment
Owner

Follow-up from #107 item 3 (c4d7ec9b). With AuditLog:MaintenanceConnectionString set, the chain job, verify/head export, partition switch-out + archive and per-channel purge run on the maintenance login. Two maintenance-type paths still run on the runtime (writer) login:

  • Monthly partition roll-forward (AuditLogPartitionMaintenance, ALTER PARTITION FUNCTION … SPLIT RANGE) — needs ALTER ANY DATASPACE (or ownership of pf_AuditLog_Month/ps_AuditLog_Month) on the runtime login in a hardened setup, or a DBA job.
  • audit backfill-source-node — an UPDATE (SourceNode) on dbo.AuditLog; the writer role's DENY UPDATE blocks it, and neither chainer nor purger has it. Today it must be run by a DBA-privileged principal.

Decide whether to (a) move roll-forward onto AuditMaintenanceContext and grant the purger role the partition-function rights in a migration, and (b) give the backfill its own grant/role or document it as a DBA-only step. Documented as-is in Component-AuditLog.md (Two-login hardening).

Follow-up from #107 item 3 (`c4d7ec9b`). With `AuditLog:MaintenanceConnectionString` set, the chain job, verify/head export, partition switch-out + archive and per-channel purge run on the maintenance login. Two maintenance-type paths still run on the runtime (writer) login: - **Monthly partition roll-forward** (`AuditLogPartitionMaintenance`, `ALTER PARTITION FUNCTION … SPLIT RANGE`) — needs `ALTER ANY DATASPACE` (or ownership of `pf_AuditLog_Month`/`ps_AuditLog_Month`) on the runtime login in a hardened setup, or a DBA job. - **`audit backfill-source-node`** — an `UPDATE (SourceNode)` on `dbo.AuditLog`; the writer role's `DENY UPDATE` blocks it, and neither chainer nor purger has it. Today it must be run by a DBA-privileged principal. Decide whether to (a) move roll-forward onto `AuditMaintenanceContext` and grant the purger role the partition-function rights in a migration, and (b) give the backfill its own grant/role or document it as a DBA-only step. Documented as-is in Component-AuditLog.md (Two-login hardening).
dohertj2 added the type:followuppriority:p3 labels 2026-11-09 23:32:36 -05:00
Author
Owner

Fixed in 533414a1 (main). AuditLogPartitionMaintenance (roll-forward) and the backfill-source-node endpoint now run on AuditMaintenanceContext / the keyed maintenance repository when AuditLog:MaintenanceConnectionString is set (unset = unchanged). New migration AuditMaintenanceGrants grants scadabridge_audit_purger ALTER ANY DATASPACE (ALTER ON SCHEMA::dbo does not cover SPLIT RANGE) and column-level UPDATE (SourceNode) on dbo.AuditLog; documented in Component-AuditLog.md (Two-login hardening). Evidence: AuditMaintenanceLoginTests.RollForwardAndSourceNodeBackfill_RunOnTheMaintenanceLogin_NotTheWriter on local scadabridge-mssql, with writer-login negative controls (both refused); mutation-proved (dropping either grant, or building roll-forward on the runtime context, fails it). Migration NOT applied anywhere (no deploys).

Fixed in 533414a1 (main). AuditLogPartitionMaintenance (roll-forward) and the backfill-source-node endpoint now run on AuditMaintenanceContext / the keyed maintenance repository when AuditLog:MaintenanceConnectionString is set (unset = unchanged). New migration AuditMaintenanceGrants grants scadabridge_audit_purger ALTER ANY DATASPACE (ALTER ON SCHEMA::dbo does not cover SPLIT RANGE) and column-level UPDATE (SourceNode) on dbo.AuditLog; documented in Component-AuditLog.md (Two-login hardening). Evidence: AuditMaintenanceLoginTests.RollForwardAndSourceNodeBackfill_RunOnTheMaintenanceLogin_NotTheWriter on local scadabridge-mssql, with writer-login negative controls (both refused); mutation-proved (dropping either grant, or building roll-forward on the runtime context, fails it). Migration NOT applied anywhere (no deploys).
Sign in to join this conversation.