Skip to content

Add scan result policy deprecated warning

Marcos Rocha requested to merge mc_rocha-add-deprecation-warning-srp into master

What does this MR do and why?

This MR updates the deprecation properties method to consider the policy type. With this change, the scan_result_policies will also be displayed with the deprecation warning icon.

Related to #458995 (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

Screenshot_2024-05-01_at_9.39.50_AM

How to set up and validate locally

  1. Create a new project
  2. Go to Secure > Policies
  3. Click on New policy
  4. Select Merge request approval policy
  5. Change to .yaml mode
  6. Copy the yaml below:
type: approval_policy
name: 'policy with deprecated policy type'
description: ''
enabled: true
actions:
  - type: require_approval
    approvals_required: 1
    role_approvers:
      - developer
rules:
  - type: license_finding
    branches: []
    match_on_inclusion_license: true
    license_types:
      - Mozilla Public License 1.0
    license_states:
      - detected
  1. Click on Configure with a merge request

  2. Merge the new MR to add the policy

  3. After merging the policy, in the security policy project, go to Repository

  4. Click on gitlab/security-policies

  5. click on policy.yml

  6. Edit the policy to

---
scan_result_policy:
- name: policy with deprecated policy type
  description: ''
  enabled: true
  actions:
  - type: require_approval
    approvals_required: 1
    role_approvers:
    - developer
  rules:
  - type: license_finding
    branches: []
    match_on_inclusion_license: true
    license_types:
    - Mozilla Public License 1.0
    license_states:
    - newly_detected
  1. Create a merge request and merge the policy
  2. Go back to the project created on step 1
  3. Go to Secure > Policies and check if the invalid policy has a deprecation warning icon
Edited by Marcos Rocha

Merge request reports