Skip to content

Improve cadence validation for scan execution policy

Improve the cadence validation for the scan execution policy creation according to the supported cadences in our documentation.

Feature flag: scan_execution_policy_cadence_validation

Verification steps

  1. Create a new project
  2. Before enabling the feature flag, create a scan execution policy with a unsupported cadence using the yaml mode. A policy like:
type: scan_execution_policy
name: policy
description: ''
enabled: false
rules:
  - type: schedule
    branches:
      - '*'
    cadence: '*/15 * * * *'
actions:
  - scan: secret_detection
  1. Enable the feature flag
  2. Wait for the scheduled time and check the sidekiq logs for the error message "Invalid cadence"
  3. Go to Secure > Policies
  4. Try to save a policy with an unsupported cadence
  5. Verify the error message Cadence is invalid is displayed
Edited by Marcos Rocha