Contact Support


Integrating Netsparker Enterprise with GitLab CI/CD

GitLab is a web-based Git repository manager that provides CI/CD pipeline features, enabling you to add CI configuration to your source control repository using just one file.

You can integrate Netsparker Enterprise with GitLab using cURL or PowerShell scripts, generated by our Integration Script Generator. This topic explains how to generate and use cURL scripts to integrate Netsparker Enterprise with GitLab in order to enable our advanced integration functionality.

For further information, see What Systems Does Netsparker Integrate With?.

Generating and Using Netsparker Enterprise’s GitLab Integration Scripts

Netsparker Enterprise uses cURL and PowerShell command-line tools to integrate with GitLab. These scripts have been tested and approved for GitLab version 9+. In order to integrate with Netsparker Enterprise, GitLab Runner’s execution environment must support cURL or PowerShell.

How to Generate Netsparker Enterprise's GitLab Integration Scripts

  1. Log in to Netsparker Enterprise.
  2. From the main menu, select Integrations, then New Integration.

  1. From the Continuous Integration Systems panel, click GitLab CI/CD. The GitLab Integration window is displayed.

  1. From the Integration Script Generator section, select the relevant Scan Settings:
    • From the Scan Type field, select an option
    • From the Website dropdown, select a website
    • From the Scan Profile dropdown, select a scan profile (this is not displayed if you select Full with Primary Profile as the Scan Type)
    • Enable the Stop the scan if the Build fails, if required
    • Enable the Fail the Build if one of the selected scan severity is detected, if required

  1. In the cURL field, click Copy to clipboard to copy the cURL script. (You will then paste this into the file described in the next How to.)

Using Build Fail in Pipeline Project

It is possible to configure a failure in the GitLab build to stop the scan when a vulnerability severity is detected for pipeline projects.

This can be configured using the MinimumSeverity and CancelScan parameters.

  1. 'MinimumSeverity': With this option, you choose which severity will fail this GitLab build when found in a related scan. If you choose “DoNotFail”, the detected vulnerability does not affect your GitLab build.

    The options for MinimumSeverity are:
    • DoNotFail
    • Critical
    • Critical, High
    • Critical, High, Medium
    • Critical, High, Medium, Low

  2. 'CancelScan': If you set this option to true, if the GitLab build fails because of the CancelScan choice, the related Netsparker scan will be canceled.

    The options for CancelScan are:
    • true
    • false

How to Use Netsparker Enterprise's GitLab Integration Script

  1. Paste the copied script (from the previous How to) into your .gitlab-ci.yml file, as shown in the example. Then commit and push it to the Git repository.
  2. Log in to your GitLab account.
  3. Navigate to your GitLab Project window.

You can copy and paste the cURL script below into your .yml file and use it as an example.

  script: |-
    curl -u "$NETSPARKERUSERID:$NETSPARKERAPITOKEN" -X POST -H 'Content-Type: application/json' -d "{'WebsiteId': 'dd402bac-9602-4545-d238-a9f302b7f81b', 'ScanType': 'FullWithPrimaryProfile', 'VcsCommitInfoModel': {'CiBuildConfigurationName' : '$CI_PROJECT_NAME', 'CiBuildHasChange': '$CI_COMMIT_SHA', 'CiBuildId': '$CI_PIPELINE_ID', 'CiBuildServerVersion': '$CI_SERVER_VERSION', 'CiBuildUrl': '$CI_PROJECT_URL', 'Committer': '$GITLAB_USER_EMAIL', 'IntegrationSystem': 'GitLab', 'VcsName': 'Git', 'VcsVersion': '$CI_COMMIT_SHA'}}"

  1. Click Settings, then CI / CD.
  2. Expand the Variables section. Add your Netsparker Enterprise API credentials as NETSPARKERUSERID and NETSPARKERAPITOKEN variables.


Highly accurate, fast & easy-to-use Web Application Security Scanner

Get a demo