Phase 4: Emit audit event for admin duo_availability namespace override

Why

Part of Phase 4 of the implementation plan for admin-locked Duo/DAP availability overrides. See planning issue #603135 (closed) and parent epic &22389.

Moved out of #603246 (closed) (SetNamespaceOverrideService), where it was originally listed as How point 5. Audit-event emission is its own concern and is grouped here in Phase 4.

When an admin sets or clears a per-namespace duo_availability override, the change must be recorded as an audit event so it is traceable for compliance and incident response.

What

Emit an audit event when the admin duo_availability namespace override is set or cleared.

How

  • In EE::Admin::DuoAvailability::SetNamespaceOverrideService, emit an audit event via Gitlab::Audit::Auditor after the override is persisted.
  • In EE::Admin::DuoAvailability::ClearNamespaceOverrideService, emit a corresponding audit event when the override is cleared.
  • Capture the actor (current_user), the target namespace, and the new/previous duo_availability state in the audit event.

Audit event names

Action Audit event name
Admin sets the namespace override admin_override_set_for_namespace_duo_availability
Admin clears the namespace override admin_override_cleared_for_namespace_duo_availability

Exit criteria — specs

  • Audit-event emission on set (admin_override_set_for_namespace_duo_availability).
  • Audit-event emission on clear (admin_override_cleared_for_namespace_duo_availability).

Key file pointers

  • EE::Admin::DuoAvailability::SetNamespaceOverrideService and ClearNamespaceOverrideService (Phase 2 services, see #603246 (closed))
  • Gitlab::Audit::Auditor
Edited by 🤖 GitLab Bot 🤖