Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Make sure the Jenkins agent that will be running Data Theorme Theorem SAST scans has access to this credential

...

Code Block
pipeline {
    agent any
    
    environment {
        DT_SAST_API_KEY = credentials('DT_SAST_API_KEY')
    }

    stages {
        stage('DT SAST') {
            steps {
                sh '''
                    docker run \
                     -e DT_SAST_API_KEY=$DT_SAST_API_KEY \
                     -e DT_SAST_REPOSITORY_NAME="<YOUR_ORG_NAME>/<YOUR_REPO_NAME>" \
                     -e DT_SAST_REPOSITORY_PLATFORM=BITBUCKET \
                     -e DT_SAST_REPOSITORY_ID="<YOUR-BITBUCKET-REPOSITORY_ID>" \
                     -e DT_SAST_REPOSITORY_HTML_URL="https://bitbucket.org/<YOUR_ORG_NAME>/<YOUR_REPO_NAME>" \
                     -e DT_SAST_REPOSITORY_DEFAULT_BRANCH_NAME="main" \
                     -e DT_SAST_SCANNED_BRANCH=$GIT_BRANCH \
                     -e DT_SAST_SCAN_HEAD_REF=$GIT_COMMIT \
                     --mount type=bind,source="$(pwd)"/,target=/target \
                     us-central1-docker.pkg.dev/prod-scandal-us/datatheorem-sast/datatheorem-sast:latest \
                     data_theorem_sast_analyzer scan /target
                '''
            }
        }
    }
}

...