Skip to content

Add scan result policy into policy editor

Zamir Martins requested to merge add_scan_result_policy_into_policy_editor into master

What does this MR do and why?

Add scan result policy into policy editor similar to scan execution policies.

utils.js and some constants are moved to the parent directory in order to be shared by both files.

Follow up from !77810 (merged) Related issue: #346072 (closed)

Screenshots or screen recordings

Screen_Shot_2022-01-07_at_5.19.04_PM

How to set up and validate locally

  1. It requires an orchestration policy as described in https://docs.gitlab.com/ee/user/application_security/policies/#policies.
  2. This yaml can be used as an example:
---
scan_result_policy:
- name: critical vulnerability CS approvals
  description: critical severity level only for container scanning
  enabled: true
  rules:
  - type: scan_finding
    branches:
    - master
    scanners:
    - container_scanning
    vulnerabilities_allowed: 1
    severity_levels:
    - critical
    vulnerability_states:
    - newly_detected
  actions:
  - type: require_approval
    approvals_required: 1
    user_approvers:
    - o.lecia.conner

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Zamir Martins

Merge request reports