Skip to content

Added audit events for update and destroy destinations

Hitesh Raghuvanshi requested to merge 404730-audit-events-instance-dest into master

What does this MR do and why?

Adding audit events for updation and deletion of instance level external audit event destinations.

How to set up and validate locally

  1. Login as instance administrator on gitlab instance, http://gitlab.localdev:3000 .
  2. Open http://gitlab.localdev:3000/admin/audit_logs?tab=log in one browser tab.
  3. Open http://gitlab.localdev:3000/admin/audit_logs?tab=streams in another browser tab and add a new streaming destination.
  4. Open http://gitlab.localdev:3000/-/graphql-explorer for running graphql queries as update is not available on UI currently.
  5. Run following query in graphql explorer for listing down all the destinations and note down the gid of the destination you want to update:
query {
  instanceExternalAuditEventDestinations {
    nodes {
      id
      destinationUrl
      verificationToken      
      headers {
        nodes {
          id
          key
          value
        }
      }
    }
  }
}
  1. Run following mutation to update the destination, replace the gid with one obtained in step 5
mutation {
  instanceExternalAuditEventDestinationUpdate(input: { 
    id: "gid://gitlab/AuditEvents::InstanceExternalAuditEventDestination/<id>",
    destinationUrl: "https://www.newexample.com"
  }) {
    errors
    instanceExternalAuditEventDestination {
      destinationUrl
      id
      verificationToken
    }
  }
}
  1. In http://gitlab.localdev:3000/admin/audit_logs?tab=log, there will be a new audit event related to this update. Please note you might need to refresh the page once.
  2. Now visit http://gitlab.localdev:3000/admin/audit_logs?tab=streams and delete the destination.
  3. In http://gitlab.localdev:3000/admin/audit_logs?tab=log, there will be a new audit event related to destination being deleted. Please note you might need to refresh the page once.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #404730 (closed)

Edited by Hitesh Raghuvanshi

Merge request reports

Loading