Skip to content

feat: audit P1 — event filtering presets, read events, auth_success default, config before_hash parity #375

Description

@millerjp

Context

Spun off from #365 — all P0 audit gaps are resolved. These are the remaining P1 items.

P1 Gaps

1. Config before_hash asymmetry

before_hash for config operations only hashes the compatibility level string, while after_hash hashes the full config struct (compat level + normalize + aliases + default metadata + default rule set). This means before_hash and after_hash are not comparable.

Fix: Hash the full config struct for before_hash as well, matching the after_hash approach.

2. auth_success not in default enabled events

auth_success events are defined but not included in the default enabled event set. Operators who enable auth and auditing would reasonably expect successful logins to be audited by default.

Fix: Add auth_success to the default enabled events list.

3. Preset keywords and category tagging not implemented

The design calls for preset keywords (all, writes, reads, security) and event category tagging, allowing operators to configure enabled_events: [writes, security] instead of listing individual event types. This is not yet implemented.

Deliverables:

  • Event category tags (e.g., write, read, security, lifecycle)
  • Preset keywords that expand to category groups
  • Config support: enabled_events: [writes, security]

4. Read event types missing

Approximately 10+ read-only routes have no audit event generation:

  • KEK/DEK GET endpoints
  • Exporter GET endpoints
  • Admin user/API key GET endpoints
  • Analysis endpoints
  • Schema/subject/config/mode GET endpoints (if reads preset is enabled)

Note: Read events SHOULD only fire when the reads preset or explicit read event types are enabled — they MUST NOT be emitted by default.

5. audit_filtering.feature BDD file does not exist

No BDD coverage for event filtering configuration (enabled/disabled event types, presets).

Deliverables:

  • tests/bdd/features/mcp/audit_filtering.feature (or REST equivalent)
  • Scenarios covering: default events, preset expansion, individual event enable/disable

Acceptance Criteria

  • Config before_hash uses full struct hashing matching after_hash
  • auth_success included in default enabled events
  • Preset keywords (all, writes, reads, security) implemented
  • Event category tags assigned to all event types
  • Read event types defined for applicable GET endpoints
  • Read events only fire when explicitly enabled
  • audit_filtering.feature BDD file with comprehensive scenarios
  • All existing audit BDD tests still pass

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions