Run a DAST Scan using ZAProxy
Following is an example GitHub Action to run a ZAProxy (DAST) scan on your application, and send the results to the Start Left Platform. This Action leverages the official zaproxy/action-af Action for running ZAP Automation Framework plans. The action requires a file path to the Automation Framework plan to run.Getting Started
The first step to perform a DAST scan is to create a Domain/URL asset in the SLS Platform. To do this, click on Assets in the side menu, then the New Asset button and select Domain. Enter the URL which will be the target of the scan. The new asset must be mapped to a product to be able to view the results.Create a configuration file for the ZAP Automation Framework
The action below uses the .github/workflows/zap/zap-env.yaml file to configure the ZAP Automation Framework. This file should be created in your repository using the example below as a starting point.Setup the Github Action to run a scan
Setup the required secrets and variables.
- Navigate to Repo Settings -> Secrets and Variables -> Actions
- Select Variables then New repository variable and add the following:
- SCAN_URL - the value should be set to the Target URL you want to scan.
- Then select Secrets then New repository secret and add the following:
- SLS_API_KEY - The API Key is available on the Account details page in Start Left.
- SLS_SCAN_KEY - The Asset Scan Key is available on the Asset details page for the Domain (URL) Asset.
Create the Github Action.
- Create the dast.yml under Actions -> New Workflow then choose set up a workflow yourself
- Replace main.yml with a meaningful name e.g. dast.yml
- Paste the script below into the file contents:
- Commit changes.
- Run the scan.
- scan-key - the Asset Scan Key for the Domain (URL) Asset.
- api-key - the API Key for your Start Left account.
- file-path - the path to the SARIF report file. This should match the reportDir and reportFile parameters in the ZAP Automation Framework plan.