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.
- Related to #515224 (closed)
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
How to set up and validate locally
- Create a new project without a
.gitlab-ci.ymlfile - Ensure the Auto DevOps is disabled(Settings > Ci/CD > Auto DevOps)
- Go to Secure > Policies
- Click on New policy
- Select Scan Execution Policy
- 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: []
- Click on Configure with a merge request
- Merge the new MR to add the policy
- Create a MR editing the README.md file
- 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)
- Add a new commit to the MR
- Verify that only a MR pipeline was created(pipeline with the merge request label)
Edited by Marcos Rocha
