Skip to content

Collect invalid policy yaml events for the first config only

What does this MR do and why?

A security policy project can be linked to multiple projects. When the policy yaml is invalidated in the security policy project, we don't need to generate duplicate audit events for all the configurations. Instead we can generate one event for the first config only, we do this already for security_policy_manage_audit_events

Ensures invalid policy YAML events are collected only for the first configuration of a management project.

References

#555468 (closed)

Screenshots or screen recordings

Before After

How to set up and validate locally

  1. Enable the feature flag from command line:

    rails runner "Feature.enable(:collect_policy_yaml_invalidated_audit_event)"
  2. Switch to admin mode and set up the audit event streaming

  1. Create a project
  2. Navigate to "Secure => Policies" and create a security policy with a merge request.
  3. Create another project and selected the Security Policy Project created in step 3 as SPP
  4. Manually edit the policy.yml in the SPP with a merge request and make it invalid
  5. Merge the MR with invalid policy.yml file
  6. Verify only one audit event of type policy_yaml_invalidated is recorded.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #555468 (closed)

Edited by Imam Hossain

Merge request reports

Loading