CircleCI

Common Build Integration Documentation

This documentation is specific to CircleCI. Common build server documentation should be reviewed before proceeding further.

Environment Variables

Environment variable values can be found in your user profile.

  • THREATRIX_OID - Your organization ID.

  • THREATRIX_EID - Your entityID (if you wish to override your default).

  • THREATRIX_API_KEY - Personal or organization API key.

Install Environment Variables

This step may require administrative privileges within CircleCI

From within CircleCI navigate to "Organization Settings->Contexts"

Click the Create Context button and create a new Context named "Threatrix"

After creating the context, click on the name to add environment variables to the context.

From within the Add Environment Variable dialog, enter the necessary variable values.

  • THREATRIX_OID - Your organization ID.

  • THREATRIX_EID - Your entityID (if you wish to override your default).

  • THREATRIX_API_KEY - Personal or organization API key.

Add the Threatrix Agent to your build server.

First,Add threatrix context to your job

Option 1: Add CLI Threat Agent

From within your SCM repository, add the following snippet to your .circleci/config.yml file or download a full example here:

# Execute Threat Scan
- run:
    name: Install Threatrix ThreatAgent & Scan
    command: |
        curl -LJO https://github.com/threatrix/threat-matrix/releases/download/agent-release-latest/threat-agent-latest.jar
        java -jar /tmp/threatagent.jar --progress
        

Option 2: Add Docker Threat Agent Step to your build

Prerequisite: In order to use our Docker image, your build executor must be of type machine otherwise, we'll be unable to create the necessary Docker volume

Add the following code snippet as a step to your existing build job. The threatrix scan agent should run either before or in parallel with your build job.

- run:
    name: Threatrix Scan
    command: |
        printenv > host.env
        docker run -v $(pwd):/app --env-file=host.env threatrix/threat-agent ./

Last updated