Skip to content

FE: Create `Scan execution` policy page on the `New Policy` page

Why are we doing this work

  • The Scan schedule policy type requires different information than the Container runtime policy type that can currently be created
    1. Users will be able to view Scan Execution policies and will be able to propose changes to Scan Execution policies (create, edit, delete). For this iteration, only yaml mode will be available for Scan Execution type policies.
    1. Creating, editing, or deleting a policy in the UI will result in the automatic creation of an MR for the Security Policy Project.

Relevant links

Design: #267346[4b.createshedule_Updated.png] and #267346[4b.createshedule_NOSCAN.png] https://gitlab.com/groups/gitlab-org/-/uploads/4772966ee0df0cdeb174c53afed03d98/scan-execution-policy.png

Non-functional requirements

  • Documentation
  • Testing

Implementation plan

  • frontend create the component/s for a user to create a Scan schedule policy from the New policy page
  • frontend reuse form actions from network_policy (pull out form action buttons into policy_editor and reuse them)
  • frontend Update the policy_editor component to conditionally render the new Scan schedule comopnents when Scan schedule is selected in the dropdown
  • frontend add default yaml when switching to scan execution policy. Delete when switching back to network policy
type: scan_execution_policy
name: ''
description: ''
enabled: false
rules:
  - type: pipeline
    branches:
      - main
actions:
  - scan: dast
    site_profile: ''
    scanner_profile: ''
  • frontend a user can save the policy (even if there is not a project already configured) (!66416 (merged))
    • details on what the new project will be called is at &5362 (comment 563834386)
    • there are several mutations required to achieve this (details on why)
      • Create a scan policy project if it does not exist for the project
        • Mutations: securityPolicyProjectAssign and securityPolicyProjectCreate
      • Create a policy (update/delete if scan policy project already exists) which creates a new branch in the scan policy project with the policy changes
        • Mutation: scanExecutionPolicyCommit
      • Create a MR with the new branch against the default branch
        • Mutation: mergeRequestCreate
  • frontend a user can modify/delete an existing policy (!66580 (merged))
Edited by Alexander Turinske