2.4. Integrating with your CI pipeline


After you have finished these procedures, the next step is to integrate with your CI pipeline.

Each CI system might require a slightly different configuration.

2.4.1. Using Jenkins

Use the StackRox Container Image Scanner Jenkins plugin for integrating with Jenkins. You can use this plugin in both Jenkins freestyle projects and pipelines.

2.4.2. Using CircleCI

You can integrate Red Hat Advanced Cluster Security for Kubernetes with CircleCI.

Prerequisites

  • You have a token with read and write permissions for the Image resource.
  • You have a username and password for your Docker Hub account.

Procedure

  1. Log in to CircleCI and open an existing project or create a new project.
  2. Click Project Settings.
  3. Click Environment variables.
  4. Click Add variable and create the following three environment variables:

    • Name: STACKROX_CENTRAL_HOST - The DNS name or IP address of Central.
    • Name: ROX_API_TOKEN - The API token to access Red Hat Advanced Cluster Security for Kubernetes.
    • Name: DOCKERHUB_PASSWORD - The password for your Docker Hub account.
    • Name: DOCKERHUB_USER - The username for your Docker Hub account.
  5. Create a directory called .circleci in the root directory of your local code repository for your selected project, if you do not already have a CircleCI configuration file.
  6. Create a config.yml configuration file with the following lines in the .circleci directory:

    version: 2
    jobs:
      check-policy-compliance:
        docker:
          - image: 'circleci/node:latest'
            auth:
              username: $DOCKERHUB_USER
              password: $DOCKERHUB_PASSWORD
        steps:
          - checkout
          - run:
              name: Install roxctl
              command: |
                  curl -H "Authorization: Bearer $ROX_API_TOKEN" https://$STACKROX_CENTRAL_HOST:443/api/cli/download/roxctl-linux -o roxctl && chmod +x ./roxctl
          - run:
              name: Scan images for policy deviations and vulnerabilities
              command: |
                  ./roxctl image check --endpoint "$STACKROX_CENTRAL_HOST:443" --image "<your_registry/repo/image_name>"
          - run:
              name: Scan deployment files for policy deviations
              command: |
                  ./roxctl image check --endpoint "$STACKROX_CENTRAL_HOST:443" --image "<your_deployment_file>"
                  # Important note: This step assumes the YAML file you'd like to test is located in the project.
    workflows:
      version: 2
      build_and_test:
        jobs:
          - check-policy-compliance

    where:

    <your_registry/repo/image_name>
    Specifies your registry and image path.
    <your_deployment_file>
    Specifies the path to your deployment file.
    참고

    If you already have a config.yml file for CircleCI in your repository, add a new jobs section with the specified details in your existing configuration file.

  7. After you commit the configuration file to your repository, go to the Jobs queue in your CircleCI dashboard to verify the build policy enforcement.
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 문서 정보

Legal Notice

Theme

© 2026 Red Hat
맨 위로 이동