Skip to content

Add template selection to scan execution actions

What does this MR do and why?

Add template selection to scan execution actions

  • add criteria to allow users to select between the default and latest security job template
  • remove yaml if default is selected

Changelog: added

EE: true

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

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

Screenshots
default
latest

How to set up and validate locally

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

Project-level

  1. Upload a GitLab Ultimate license
  2. Enable the project feature flag echo "Feature.enable(:scan_execution_policies_with_latest_templates)" | rails c
  3. Navigate to a project/group => Secure => Policies => New policy => Scan execution => Under "Action", click "Add new criteria" => Template criteria
  4. Verify the yaml updates
  5. Change the value
  6. Verify the yaml updates
  7. Navigate to yaml mode => Modify the template => Navigate back to rule mode
  8. Verify rule mode is disabled for an invalid template value
  9. Verify rule mode is changed for a valid template value

Group-level

  1. Upload a GitLab Ultimate license
  2. Enable the group feature flag echo "Feature.enable(:scan_execution_policies_with_latest_templates_group)" | rails c
  3. Navigate to a group => Secure => Policies => New policy => Scan execution => Under "Action", click "Add new criteria" => Template criteria
  4. Verify the yaml updates
  5. Change the value
  6. Verify the yaml updates
  7. Navigate to yaml mode => Modify the template => Navigate back to rule mode
  8. Verify rule mode is disabled for an invalid template value
  9. Verify rule mode is changed for a valid template value

Related to #415427 (closed)

Edited by Alexander Turinske

Merge request reports