Integrate agents with TravisCI
You can create a Veracode SCA agent that scans your repositories as an automated task in your Travis CI pipeline.
Prerequisites
Depending on the build and package managers your repositories use, your agent host has specific requirements depending on the language scanned. To view the requirements, see the code language in Finding and fixing vulnerabilities.
Create your authentication token
By default, the agent you create is only visible to members of the workspace in which you created the agent. To allow visibility, invite teams to your workspace.
To complete this task:
- In the Veracode Platform, select Scans & Analysis > Software Composition Analysis.
- Select Agent-Based Scan.
- Select a workspace.
- Select Agents > Actions > Create > Travis CI.
- Select Create Agent & Generate Token.
- Copy the value in the token field. You use the token to authenticate with Veracode SCA during scans.
Add your token to an environment variable
Setting an environment variable in Travis CI occurs on a per-repository basis.
To complete this task:
- In Travis CI, select the repository you want to scan.
- Go to More Options > Settings.
- For Name, enter
SRCCLR_API_TOKEN. - For Value, enter your Veracode SCA API token.
- Verify Display value in build log is set to OFF. This step ensures your token is hidden.
- Select Add.
Configure your repos
To complete this task:
-
Add this code to your
.travis.ymlfile:addons:
srcclr: true -
If you want verbose output during the scan, add the debug key:
addons:
srcclr:
debug: true -
Commit the changes to start a build and run an SCA scan.