Contact Support


Integrating Netsparker Enterprise with Travis CI

Travis CI is a hosted continuous integration service. It is used to test and deploy software projects hosted on GitHub and Bitbucket. You can log in to Travis CI with GitHub or Bitbucket, instruct Travis CI to test the code of a project, and then push it to GitHub or Bitbucket. 

Image result for travis ci

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

Generating and Using Netsparker Enterprise’s Travis CI Integration Scripts

Netsparker Enterprise uses cURL and PowerShell command-line tools to integrate with Travis.

How to Generate Netsparker Enterprise's Travis CI Integration Scripts
  1. Log in to Netsparker Enterprise.
  2. From the main menu, select Integrations, then New Integration.

  1. From the Continuous Integration Systems section, click Travis CI. The Travis CI 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 How to Use Netsparker Enterprise’s Travis Integration Script.)
How to Use Netsparker Enterprise's Travis Integration Script
  1. Navigate to your Git project and open .travis.yml file.
  2. Paste the copied script (from How to Generate Netsparker Enterprise’s Travis CI Integration Scripts) into your .travis.yml file. Then commit and push it to the Git repository.
  3. Log in to your Travis account.
  4. Navigate to your Travis 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': '4193d4c3-ba11-4920-576b-abc80256ae2e', 'ScanType': 'FullWithPrimaryProfile', 'VcsCommitInfoModel': {'CiBuildConfigurationName' : '$TRAVIS_JOB_NAME', 'CiBuildHasChange': '$TRAVIS_COMMIT', 'CiBuildId': '$TRAVIS_BUILD_ID', 'CiBuildServerVersion': '$TRAVIS_APP_HOST', 'CiBuildUrl': '$TRAVIS_BUILD_WEB_URL', 'Committer': '$USER', 'IntegrationSystem': 'TravisCI', 'VcsName': 'Git', 'VcsVersion': '$TRAVIS_COMMIT'}}"

  1. Click Project Settings.
  2. Navigate to Environmental Variables and add your Netsparker Enterprise API credentials as NETSPARKERUSERID and NETSPARKERAPITOKEN variables.


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

Get a demo