Integrating Acunetix 360 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 Acunetix 360 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 Acunetix 360 with GitLab in order to enable our advanced integration functionality.

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

Generating and Using Acunetix 360’s GitLab Integration Scripts

Acunetix 360 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 Acunetix 360, GitLab Runner’s execution environment must support cURL or PowerShell.

How to Generate Acunetix 360’s GitLab Integration Scripts
  1. Log in to Acunetix 360.
  2. From the main menu, select Integrations, then New Integration.

  1. From the Continuous Integration Systems section, 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)

  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.)
How to Use Acunetix 360’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.
  1. Log in to your GitLab account.
  2. 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.

ScanJob:

   script: |-

    curl -u "$ACUNETIXUSERID:$ACUNETIXAPITOKEN" -X POST https://online.acunetix360.com/api/1.0/scans/CreateFromPluginScanRequest -H 'Content-Type: application/json' -d "{'WebsiteId': '19084b2b-4941-4d31-85a4-ab4102a4c135', '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 Acunetix 360 API credentials as ACUNETIXUSERID and ACUNETIXAPITOKEN variables.

 

« Back to the Acunetix Support Page