Skip to content

Add validation for timezone in scan execution policies

Martin Čavoj requested to merge 398259-add-timezone-validation into master

What does this MR do and why?

This MR adds validation for timezone in scan execution policies.

Screenshots or screen recordings

CleanShot_2023-06-15_at_12.41.29_2x

How to set up and validate locally

  1. Navigate to Security & Compliance -> Policies -> New policy -> Scan execution policy

  2. Switch to .yaml mode

  3. Paste a policy with timezone. Example:

    type: scan_execution_policy
    name: Test with TZ
    description: ''
    enabled: true
    rules:
      - type: schedule
        branches:
          - main
        cadence: 0 0 * * *
        timezone: invalid
    actions:
      - scan: dast
        tags: [ ]
        site_profile: Default
        scanner_profile: Default      
  4. Error should be displayed after submitting such policy

  5. Changing the timezone to a valid timezone, for example America/New_York, Europe/Amsterdam, or UTC should submit successfully

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #398259 (closed)

Merge request reports