Skip to content

Add support for SAST in security policies

Alan (Maciej) Paruszewski requested to merge 340722-add-support-for-sast into master

What does this MR do and why?

This change adds new scan type to Security Orchestration Policies: SAST. This MR also adds new way to execute scans in enforced pipeline: in child pipeline.

Screenshots or screen recordings

image

image

How to set up and validate locally

  1. Create new project (you can import ie. https://github.com/digininja/DVWA)
  2. Go to Security Policy -> Policies, click on New Policy, select Scan Execution as Policy type.
  3. Paste policy:
    type: scan_execution_policy
    name: 'SAST test'
    description: 'SAST test'
    enabled: true
    rules:
      - type: pipeline
        branches:
          - master
    actions:
      - scan: sast
  4. Create new MR with updated policy and hit merge.
  5. In your project add .gitlab-ci.yml file and add simple config:
    image: busybox:latest
    
    test:
      stage: test
      script:
        - echo "Do a test here"
  6. Go to your project -> CI/CD -> Pipelines and click Run Pipeline

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 #340722 (closed)

Edited by Alan (Maciej) Paruszewski

Merge request reports