admin_audit_log

This table stores the immutable, append-only audit trail for super-admin actions performed through DirtView’s internal admin systems. It is one of the highest-trust tables in the platform.

Domain: Global Admin Layer
Scope: Global
Status: Reviewed
Last Updated: 11 Apr 2026
Mutable: No
Primary Owner: Internal Admin Dashboard / Audit Service
RLS Applies: No, service-role only
Storage Pattern: Append-only

Purpose

The purpose of this table is to preserve a tamper-resistant record of all high-privilege platform actions taken by super-admins, including tenant lifecycle changes, feature-flag changes, impersonation, and other cross-tenant operations.

What this table does

  • Records privileged platform actions by super-admins
  • Captures who did what, when, and to which target
  • Stores optional before/after state for sensitive changes
  • Supports operational forensics, trust, and compliance readiness

Why this table is defined

Super-admins have cross-tenant authority and access to the most sensitive operational controls in the platform. A normal tenant-scoped audit trail is not sufficient. These actions must be captured separately in a service-role-protected log.

Columns

Column Type Required Description Example
iduuidYesPrimary key for audit rowaaudit_001
super_admin_iduuidYesSuper-admin who performed the actionsadmin_001
super_admin_nametextYesDenormalized admin name at write timeAlice Johnson
actiontextYesMachine-readable action codeadmin.tenant_suspended
descriptiontextYesHuman-readable descriptionAlice suspended tenant BuildRight GC
target_tenant_iduuidNoTenant affected by the actiontenant_002
target_user_iduuidNoUser affected by the actionuser_456
before_statejsonbNoOptional state before the action{"status":"active"}
after_statejsonbNoOptional state after the action{"status":"suspended"}
ip_addresstextNoOrigin IP address203.0.113.10
created_attimestamptzYesWhen the action occurred2026-04-11 16:00:00+00

Relationships

  • super_admin_idsuper_admins.id
  • target_tenant_idtenants.id
  • target_user_id references the affected platform user where applicable

How it is used

  • Written whenever a super-admin performs a platform-level action
  • Used for forensic review, support, and internal accountability
  • Queried only through internal admin systems or trusted operational tooling
  • Can support external archive/backups for maximum tamper resistance

Access and security

  • This table must be immutable and append-only
  • No UPDATE or DELETE path should exist
  • Service-role only access is strongly recommended
  • High-trust backups or append-only archival storage are recommended
  • This table should never be exposed via public client APIs

Immutable here means once a row is inserted, it cannot be edited or removed.

Example scenarios

Scenario 1: Tenant suspension

A super-admin suspends a tenant and the state change is recorded permanently.

Scenario 2: Feature flag override

A super-admin enables a beta feature for one tenant, and the action is logged here.

Scenario 3: User impersonation

An internal support session begins and the impersonation event is captured in this log.

Notes and assumptions

  • This is the platform-level counterpart to tenant-scoped audit_log
  • Human-readable descriptions should be generated when the event is written
  • Keep this table small in schema shape but strong in integrity guarantees