Skip to content

Remove match_on_inclusion from scan_result_policies

Marcos Rocha requested to merge mc_rocha-remove-match-on-inclusion-424513 into master

What does this MR do and why?

This MR removes the support for match_on_inclusion on scan_result_policies as suggested in this comment.

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

How to set up and validate locally

  1. Create a new project
  2. Add a .gitlab-ci.yml file with the content
include:
  - template: Security/Dependency-Scanning.gitlab-ci.yml
  1. Add a new member to the project with developer access
  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: Deny MIT
enabled: true
rules:
  - type: license_finding
    match_on_inclusion_license: true
    license_types:
      - MIT License
    license_states:
      - newly_detected
    branch_type: protected
actions:
  - type: require_approval
    approvals_required: 1
    role_approvers:
      - developer
  1. Click on Configure with a merge request
  2. Merge the new MR to add the policy
  3. Go back to Secure > Policies and verify the new policy is visible
  4. Create a new MR adding a Gemfile.lock file with the following content:
GEM
  remote: https://rubygems.org/
  specs:
    rack (3.0.4.1)

PLATFORMS
  arm64-darwin-22

DEPENDENCIES
  rack

BUNDLED WITH
   2.4.22
  1. Verify the policy blocked the merge
Edited by Marcos Rocha

Merge request reports