This guide walks you through setting up ZeroThreat with GitLab using a basic example. You can follow this as-is or customize it later based on your team’s workflow.
Before getting started, make sure:
.gitlab-ci.yml
files.Once confirmed, a unique ZT_Token will be generated. This token is used to start scans CI/CD for its associated target from the Ci/CD.
Make sure to select a appropriate working Login template for Authenticated Scan.
Click the GitLab CI/CD icon in ZeroThreat. This will take you to the GitLab CI/CD Catalog page, where you can find the ZeroThreat integration details and required configuration.
.gitlab-ci.yml
configuration file.This is the file where you’ll define how your pipeline runs, and where you’ll add ZeroThreat’s configuration.
In the .gitlab-ci.yml
file:
ZeroThreat AI Security Scan
.Here's a simplified example:
stages:
- build
- test
- deploy
- ZeroThreat AI Security Scan
[SNIP]
include:
- component: $CI_SERVER_FQDN/zerothreatai/gitlab-ci-component/scanner@0.0.3
inputs:
ZT_TOKEN: $ZT_TOKEN
WAIT_FOR_ANALYSIS: false
zerothreatai/gitlab-ci-component
.@0.0.3
with the latest available version.It is advised to not hardcode tokens directly in your config files. Instead, store your ZeroThreat token securely as a GitLab CI/CD variable:
ZT_TOKEN
ZT_TOKEN
. This prevents sensitive data from being exposed in your version control.Once everything is saved and committed:
ZeroThreat AI Security Scan
stage, ZeroThreat will start the scan.The Job will begin and a scan will be triggered in ZeroThreat portal.
This example uses a basic manual setup, but you can customize it further. GitLab allows you to trigger pipelines on:
This gives your team full control over how and when ZeroThreat scans are triggered—making it easy to fit security testing into your existing development process.
Finished setting up your CI/CD integration?
Head over to our guide on Reviewing Scan Reports to learn and analyze different sections of the scan report.