Scan Execution Rule mode is not disabled for invalid cron syntax or cron syntax rule mode does not support
Summary
Scan Execution Rule mode is not disabled for invalid cron syntax
Steps to reproduce
- Upload a GitLab Ultimate license
- Navigate to a project => Security & Compliance => Policies => New policy => Scan Execution policy => yaml mode
- Copy/paste one of the below yaml into the text box
type: scan_execution_policy
name: ''
description: ''
enabled: true
rules:
- type: schedule
branches:
- main
cadence: 0 5 * * asdfasdf
actions:
- scan: dast
site_profile: ''
scanner_profile: ''
type: scan_execution_policy
name: ''
description: ''
enabled: true
rules:
- type: schedule
branches:
- main
cadence: * 5 5 5 5
actions:
- scan: dast
site_profile: ''
scanner_profile: ''
- Navigate to rule mode
Example Project
What is the current bug behavior?
The rule mode is not disabled. So when a user changes a cron-related field in rule mode, the entire cron syntax is reset
What is the expected correct behavior?
The rule mode is disabled.
Relevant logs and/or screenshots
Possible fixes
-
frontend update from_yaml.js to -
check for valid cron syntax using cron-validator -
check for rule-mode-supported cron syntax
-
Edited by Alexander Turinske
