Add warning for invalid scan execution policies
What does this MR do and why?
This MR adds warning for invalid policies
Scan execution policies with exceeding number of actions, from now on will have a warning
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.
| Description | After |
|---|---|
| Banner and error icon | ![]() |
| Single violation | ![]() |
| Stacked violations | ![]() |
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
-
Create a project
-
On the level left sidebar, select Security & Compliance and Policies
-
Select New Policy
-
Select Scan execution policy
-
Switch to .yaml mode.
-
Paste the following policy
type: scan_execution_policy name: test description: '' enabled: true rules: - type: pipeline branches: - '*' actions: - scan: secret_detection - scan: secret_detection - scan: secret_detection - scan: secret_detection - scan: secret_detection - scan: secret_detection - scan: secret_detection - scan: secret_detection - scan: secret_detection - scan: secret_detection - scan: secret_detection -
Select Configure with a merge request
-
Enable the feature flag:
echo "Feature.enable(:scan_execution_policies_action_limit)" | rails c -
Go to policy list, make sure you see the banner and error icon
Related to #472229 (closed) #475021 (closed)


