BitBucket

Follow the step-by-step instructions below to set up the Radar CLI in your Bitbucket pipeline.

Prerequisites

Before configuring your Bitbucket pipeline, ensure you have:

Required

  • Credential Token: Created in Credentials
    • You'll need this for the EUREKA_AGENT_TOKEN variable

Optional

  • Any scanner API credential/token for scanners that require them

Step by step instructions

  1. Log in to Bitbucket and select the atlassian BitBucket app.

  2. Navigate to the desired workspace and select the repository to integrate the Radar CLI with.

  3. Navigate to Repository SettingsRepository variables in the left sidebar.

  4. View and add the following variables below for your repository:

    Required Variables

    Add the following credentials created in the prerequisites:

    Variable NameValueDescription
    EUREKA_AGENT_TOKENYour tokenAuthentication token for uploading scan results to Eureka
    Optional Scanner Variables

    See below for optional variables associated with scanners you may be using:

    Veracode
    Variable NameValueDescription
    SRCCLR_API_TOKENYour SCA tokenVeracode Source Clear (SCA) API token
    VERACODE_API_KEY_IDYour API key IDVeracode Static Analysis API key ID
    VERACODE_API_KEY_SECRETYour API secretVeracode Static Analysis API key secret

    💡 Click the Secured checkbox to keep sensitive variables secure.

  5. After successfully adding the repository variables:

    • If you do not have an existing Bitbucket pipeline yaml, create a new bitbucket-pipelines.yml file in the root of your repository of the branch that you want the Radar CLI to scan and open it.
    • If you have an existing bitbucket-pipelines.yml, open it.
  6. Add the following code to your new or existing bitbucket-pipelines.yml file:

    # Run Radar CLI scan via Bitbucket Pipelines
    image: node:22
    
    pipelines:
      branches:
        main:
          - step:
              name: Run Radar Scan
              services:
                - docker
              script:
                - npm i @eurekadevsecops/radar
                - npx radar scan
  7. Commit the changes to your bitbucket-pipelines.yml file to your repository. The Radar CLI should now be apart of your new or existing pipeline.

  8. Navigate to Pipelines in the left sidebar.

  9. Select Run Pipeline.

  10. Select the branch and pipeline that corresponds to the bitbucket-pipeline.yml changes that were previously made.

  11. Select Run to start the pipeline job. The Radar CLI should now start running a scan for your repository. Once the job is completed, check the Eureka Web Application for your scan results.