Fix SecurityPolicyDefault to work with mr pipelines

What does this MR do and why?

Fix SecurityPolicyDefault to work with mr pipelines

References

Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.

MR acceptance checklist

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

Screenshots or screen recordings

Screenshot_2025-01-29_at_4.08.45_PM

How to set up and validate locally

  1. Create a new project without a .gitlab-ci.yml file
  2. Ensure the Auto DevOps is disabled(Settings > Ci/CD > Auto DevOps)
  3. Go to Secure > Policies
  4. Click on New policy
  5. Select Scan Execution Policy
  6. Create a policy to run a secret_detection scan with the latest template:
type: scan_execution_policy
name: policy
description: ''
enabled: true
rules:
  - type: pipeline
    branches:
      - '*'
actions:
  - scan: secret_detection
    template: latest
skip_ci:
  allowed: true
  allowlist:
    users: []
  1. Click on Configure with a merge request
  2. Merge the new MR to add the policy
  3. Create a MR editing the README.md file
  4. Verify that a new branch pipeline was created(pipeline without the merge request label) and a MR pipeline was created(pipeline with the merge request label)
  5. Add a new commit to the MR
  6. Verify that only a MR pipeline was created(pipeline with the merge request label)
Edited by Marcos Rocha

Merge request reports

Loading