Skip to content

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

  1. Create new project

  2. Create new Policy for this project that will include SAST job for every branch

  3. In your project create .gitlab-ci.yml file that will include sast-0 job, with rules section defined as:

    rules:
    - if: $CI
      when: never
  4. 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.

Related to #366600 (closed)

Edited by Alan (Maciej) Paruszewski

Merge request reports

Loading