Do not allow to override jobs defined by Security Policies
What does this MR do and why?
This MR fixes the problem where user could modify .gitlab-ci.yml
file and disable the job enforced by security policy.
How to set up and validate locally
-
Create new project
-
Create new Policy for this project that will include SAST job for every branch
-
In your project create
.gitlab-ci.yml
file that will includesast-0
job, with rules section defined as:rules: - if: $CI when: never
-
sast-0
job should work normally and be executed.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #366600 (closed)
Edited by Alan (Maciej) Paruszewski