GitLab
On this page
Follow the step-by-step instructions below to set up the Radar CLI in your GitLab pipeline.
Prerequisites
Before configuring your GitLab pipeline, ensure you have:
Required
- Credential Token: Created in Credentials
- You'll need this for the
EUREKA_AGENT_TOKENvariable
- You'll need this for the
Optional
- Any scanner API credential/token for scanners that require them
Step by step instructions
Log in to GitLab.
Navigate to the desired project to integrate the Radar CLI with.
Navigate to Settings → CI/CD in the left sidebar.
Select the Variables dropdown.
Navigate to the Project variables section of the Variables dropdown.
Select the Add variable button to add the following variables:
Required Variables
Add the following credentials created in the prerequisites:
Variable Name Value Description EUREKA_AGENT_TOKENYour token Authentication token for uploading scan results to Eureka Optional Scanner Variables
See below for optional variables associated with scanners you may be using:
Veracode
Variable Name Value Description SRCCLR_API_TOKENYour SCA token Veracode Source Clear (SCA) API token VERACODE_API_KEY_IDYour API key ID Veracode Static Analysis API key ID VERACODE_API_KEY_SECRETYour API secret Veracode Static Analysis API key secret 💡 Click the Masked and hidden option to keep sensitive variables secure.
📚 For more information on adding variables to GitLab, see the official documentation: GitLab CI/CD Variables
After successfully adding the project variables:
- If you do not have an existing Gitlab pipeline yaml, create a new
.gitlab-ci.ymlfile in the root of your repository. - If you have an existing
.gitlab-ci.yml, open it.
- If you do not have an existing Gitlab pipeline yaml, create a new
Add the following code to your new or existing
gitlab-ci.ymlfile:image: node:22 stages: - scan radar_scan: stage: scan services: - docker:dind variables: DOCKER_HOST: tcp://docker:2375 before_script: - apt-get update && apt-get install -y docker.io script: - npm i -g @eurekadevsecops/radar - radar scanCommit and push the changes to your
.gitlab-ci.ymlfile. The Radar CLI is now integrated into your pipeline and will automatically run when triggered for the configured branch.Navigate to CI/CD → Jobs in the left sidebar to view your pipeline jobs.
View the job running for the new or existing
.gitlab-ci.ymlcommit.Once the job is completed, check the Eureka Web Application for your scan results.