Skip to content

Allow to save Security Policy YAML with policy scope

What does this MR do and why?

This MR extends the Security Policy JSON Schema with ability to store policy_scope with options to save compliance frameworks/included projects/excluded projects.

How to set up and validate locally

  1. Create new Project
  2. Create new Policy for the project (for both Scan Execution Policy and Scan Result Policy) [Secure -> Policies -> Create new]
  3. Try to save policy - this should work without any problems
  4. Go to back to creating new policy
  5. Choose YAML-mode in the Policy Editor
  6. Try to add policy_scope:
    ...
    policy_scope:
      compliance_frameworks:
      - id: 12345
      projects:
        including:
        - id: 12345
        excluding:
        - id: 23456
    ...
  7. Policy should be saved without problems.

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 #428477 (closed)

Merge request reports