For the complete documentation index, see llms.txt. This page is also available as Markdown.

CircleCI

Configure Cortex CLI code scanning in CircleCI.

version: 2.1
jobs:
  cortex-code-scan:
    docker:
      - image: <Replace with image supporting node js version 22 or higher>
    environment:
      CORTEX_API_URL: <your_cortex_api_url> 
    steps:
      - checkout
      - run:
          name: Download cortexcli
          command: |
            set -x
            crtx_resp=$(curl "${CORTEX_API_URL}/public_api/v1/unified-cli/releases/download-link?os=linux&architecture=arm64" \
              -H "x-xdr-auth-id: ${CORTEX_API_KEY_ID}" \
              -H "Authorization: ${CORTEX_API_KEY}")
            crtx_url=$(echo $crtx_resp | jq -r ".signed_url")
            curl -o cortexcli $crtx_url
            chmod +x cortexcli
            ./cortexcli --version
      - run:
          name: Run Cortex CLI Code Scan
          command: |
            ./cortexcli \
              --api-base-url "${CORTEX_API_URL}" \
              --api-key "${CORTEX_API_KEY}" \
              --api-key-id "${CORTEX_API_KEY_ID}" \
              code scan \
              --directory "$(pwd)" \
              --repo-id "${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}" \
              --branch "${CIRCLE_BRANCH}" \
              --source "CIRCLE_CI" \
              --create-repo-if-missing
workflows:
  cortex-scan-workflow:
    jobs:
      - cortex-code-scan:
          context: cortex-secrets

Last updated

Was this helpful?