Skip to main content
← Back to list
01Issue
FeatureOpenSwamp CLIPublic
AssigneesNone

Relationships

#1745 vault: audit trail should record put, delete, and annotate operations

Opened by stack72 · 8/20/2026

Problem

The vault audit trail only records read operations (secret get), not write operations (put, delete, annotate). Additionally, audit recording requires the vault's audit flag to be enabled (auditFlags.get(vaultName)), which may not be set by default.

This means the dashboard's vault audit trail panel shows no entries even after secrets are created or updated through serve.

Current Behavior

In src/domain/vaults/vault_service.ts:

  • recordAuditEntry is only called from the get path (lines 246 and 265)
  • It is NOT called from put, delete, or annotate operations
  • Line 278: if (!this.auditRepository || !this.auditFlags.get(vaultName)) return; — audit is gated on a per-vault flag that must be explicitly enabled

Expected Behavior

The audit trail should record all vault operations:

  • put — secret created or updated (record key name, timestamp, principal — never the value)
  • delete — secret deleted
  • annotate — metadata changed
  • get — secret read (already implemented)

Each entry should include:

  • action: "put" | "get" | "delete" | "annotate"
  • key: the secret key name
  • timestamp: when the operation occurred
  • principal: who performed it (from the serve connection principal, or "cli" for local operations)
  • vaultName: which vault

Files to Change

  • src/domain/vaults/vault_service.ts — add recordAuditEntry calls to put, delete, and annotate paths
  • src/domain/vaults/vault_audit_entry.ts — ensure the entry type supports an action field
  • Consider whether audit should be enabled by default for all vaults, or require an explicit opt-in

Context

The dashboard's Vaults view has an audit trail panel that's currently always empty because no write operations are recorded. The dashboard code is ready to display entries — it just needs the backend to produce them.

02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED

Open

8/20/2026, 6:59:23 AM

No activity in this phase yet.

03Sludge Pulse

Sign in to post a ripple.