Loading
Add business_logic to the scan execution policy schema
Why
Business logic scans run only on merge request pipelines, so teams cannot schedule them on a branch.
This lets a scan execution policy declare scan: business_logic on a schedule rule.
Starting the scan comes in Dispatch scheduled business logic scans from sc... (!257271 - merged); until then the action is accepted and skipped.
What changes
- Both policy schemas accept
business_logic. - Validation rejects it on non-
schedulerules, or where the business logic flow is not available (deployment, flag, license, beta opt-in). - Scheduled CI pipelines leave it out, since it runs as a Duo flow, not a CI job.
How to test
In a GDK in GitLab.com mode, with the bl_security_analyzer flag on and the top-level group opted in to beta features:
- Save a policy with a
schedulerule andscan: business_logic→ saved. - Change the rule to
pipeline→ "Business logic scans can only be used with schedule rules". - Turn off the group's beta features → "Business logic scans are not available for this project or group".
- Add
scan: secret_detectionto the schedule policy and let it run → the pipeline has only the secret detection job.
Verified in a GDK with this MR alone on master.
Context
- Part 2 of 3, split from Dispatch scheduled business logic scans from sc... (!257271 - merged). Issue: https://gitlab.com/gitlab-org/gitlab/-/work_items/630266+
Edited by Meir Benayoun