Skip to content

Fix issue with multiple rules with the same values

Alexander Turinske requested to merge 424960-fix-duplicate-across-rules-bug into master

What does this MR do and why?

Fix issue with multiple rules with the same values

  • in an attempt to prevent duplicate values in a single rule, an issue was introduced that prevented duplicates across multiple rules

Changelog: fixed

EE: true

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
allow_duplicates_-_before allow_duplicates_-_after

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Upload a GitLab Ultimate license
  2. Navigate to a project/group => Secure => Policies => New policy => Scan Result Policy => Yaml mode => Copy/paste the below yaml in
yaml
type: scan_result_policy
name: Same rules
description: ''
enabled: true
rules:
  - type: scan_finding
    scanners:
      - dependency_scanning
    vulnerabilities_allowed: 0
    severity_levels:
      - high
    vulnerability_states:
      - detected
      - confirmed
      - dismissed
      - resolved
    branch_type: default
    vulnerability_age:
      operator: greater_than
      value: 30
      interval: day
    vulnerability_attributes:
      fix_available: false
      false_positive: false
  - type: scan_finding
    scanners:
      - dependency_scanning
    vulnerabilities_allowed: 0
    severity_levels:
      - high
    vulnerability_states:
      - detected
      - confirmed
      - dismissed
      - resolved
    branch_type: default
    vulnerability_age:
      operator: greater_than
      value: 30
      interval: day
    vulnerability_attributes:
      fix_available: false
      false_positive: false
actions:
  - type: require_approval
    approvals_required: 1
    role_approvers:
      - developer
      - maintainer
      - owner
  1. Navigate to rule mode
  2. Verify rule mode is not disabled

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

Edited by Alexander Turinske

Merge request reports

Loading