Adding new audit event scope for instance level audit events
Compare changes
- Hitesh Raghuvanshi authored
This MR is introducing a new scope instance_scope
for audit events representing changes to instance level settings.
Here scope of an audit event represents the level where the change is made, already present scopes were user, group and project.
We have created an abstract scope here as explained in #404730 (closed).
For testing it out, currently I have added one audit event which is using this new scope while creating a new instance level external destination as part of issue #404730 (closed).
::Feature.enable(:ff_external_audit_events)
in rails console, this is not required for the scope but for creating the instance destination which will create audit event using this scope.https://www.example.com
with your own webhook urlmutation {
instanceExternalAuditEventDestinationCreate(input: { destinationUrl: "https://www.example.com"}) {
errors
instanceExternalAuditEventDestination {
destinationUrl
id
}
}
}
{
"id": 5300,
"author_id": 1,
"entity_id": 1,
"entity_type": "Gitlab::Audit::InstanceScope",
"details": {
"author_name": "Administrator",
"author_class": "User",
"target_id": 25,
"target_type": "AuditEvents::InstanceExternalAuditEventDestination",
"target_details": "Destination_e8ba8b07-de7b-4a49-ab32-997528f05628",
"custom_message": "Create instance event streaming destination https://www.example.com",
"ip_address": "127.0.0.1",
"entity_path": "gitlab_instance"
},
"ip_address": "127.0.0.1",
"author_name": "Administrator",
"entity_path": "gitlab_instance",
"target_details": "Destination_e8ba8b07-de7b-4a49-ab32-997528f05628",
"created_at": "2023-06-27T11:33:59.069Z",
"target_type": "AuditEvents::InstanceExternalAuditEventDestination",
"target_id": 25,
"event_type": "create_instance_event_streaming_destination"
}
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)