Skip to content

[18.0][IMP] vault: NIS2 compliance step; read and access auditing (vault.access.log) - #1048

Open
bosd wants to merge 1 commit into
OCA:18.0from
bosd:18.0-vault-access-log
Open

bosd wants to merge 1 commit into
OCA:18.0from
bosd:18.0-vault-access-log

Conversation

@bosd

@bosd bosd commented Oct 21, 2026

Copy link
Copy Markdown

What

Adds read and access auditing to the vault module. Today vault tracks CRUD
on secrets but not who actually revealed, copied or exported a value. This
records that, which is what NIS2 and ISO 27001 reviews ask for.

How

  • New model vault.access.log holding secret, user, timestamp, source IP
    and access type (reveal, copy, export). Logs are read-only for end users
    and written via sudo, so the trail cannot be edited or deleted by users.
  • vault.entry.action_log_access(access_type) records the event and also
    emits a single-line JSON log line for SIEM collectors. The source IP is
    resolved server-side from the HTTP request, not the browser.
  • OWL patch on the secret field calls that method on reveal and on copy.
    Only the record id and access type leave the browser, never the plaintext.
  • New Vault Manager group. Standard users read only their own logs,
    managers read all of them.
  • UI: a manager-only Access Logs tab on the secret form, plus a dedicated
    list and search view under Vault > Access Logs (filter by type, date, user).

Tests

New tests cover logging on access, rejection of an invalid access type,
per-user visibility via record rules, and immutability for non-managers.
Run with --test-tags /vault.

Record when and by whom a vault secret is revealed, copied or exported,
not just CRUD on the record. Supports NIS2 and ISO 27001 audit needs.

- New model vault.access.log (secret, user, timestamp, IP, access type),
  read-only to end users and created via sudo so the trail is immutable.
- vault.entry.action_log_access logs the event and emits a single-line
  JSON record for SIEM collectors. Source IP is read server-side.
- OWL patch on the secret field fires on reveal and copy. Only the record
  id and access type are sent, never the decrypted value.
- New Vault Manager group. Users see their own logs, managers see all.
- Manager-only Access Logs tab on the secret form plus a list and search
  view under Vault > Access Logs.
- Tests for logging, invalid type, per-user visibility and immutability.
@bosd bosd changed the title [18.0][ADD] vault: read and access auditing (vault.access.log) [18.0][IMP] vault: NIS2 compliance step; read and access auditing (vault.access.log) Oct 21, 2026
@bosd
bosd marked this pull request as ready for review October 21, 2026 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants