Skip to content

Audit key destroy action

Tan Le requested to merge 220127-audit-ssh-keys-destroy into master

What does this MR do?

Audit successful key destroy action.

When an SSH key is successfully destroyed, an audit event will be created. Additionally, we introduce a domain object Audit::Target to handle a more flexible resolution of the target's details. Previously, it is assumed that all audit target has name but this is no longer valid for Key (i.e. Key has title).

How to test

  1. Authenticated to the RESTFul API, and execute the following curl command
# As a normal user
curl -i -H Authorization\:\ Bearer\ y2SAvz9c2nPRcg6FjxWV -XDELETE http\://gdk.test\:3000/api/v4/user/keys/13

# As an admin user
curl -i -H Authorization\:\ Bearer\ y2SAvz9c2nPRcg6FjxWV -XDELETE http\://gdk.test\:3000/api/v4/users/123/keys/13
  1. Navigate to Admin Area > Monitoring > Audit Events and view the newly created audit events

Screenshots or Screencasts (strongly suggested)

key destroy audit event

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Related to #220127 (closed)

Edited by Tan Le

Merge request reports