From 41dd3bd6c81d961e4b92f85395658297824feb5e Mon Sep 17 00:00:00 2001 From: Moritz Clasmeier Date: Wed, 28 Oct 2026 21:07:59 +0100 Subject: [PATCH 1/6] Deploy with roxie --- .github/workflows/e2e.yml | 65 ++++++++++++++++++++++----------------- 1 file changed, 36 insertions(+), 29 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 2be09a6..af8b340 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -9,9 +9,8 @@ on: - cron: '0 5 * * 0' env: - # The certificate is valid for this host so in order to use "secure" mode we add this to hosts and use for calling central - ROX_HOST: 'central.stackrox' - ROX_PORT: 8000 + # StackRox internal certificate for central is issued for this name. + ROX_INTERNAL_CENTRAL_NAME: 'central.stackrox' jobs: e2e: @@ -22,10 +21,6 @@ jobs: steps: - uses: actions/checkout@v7 - - name: Set up hostname - run: | - echo "127.0.0.1 ${ROX_HOST}" | sudo tee -a /etc/hosts >/dev/null - - name: Create k8s Kind Cluster uses: helm/kind-action@v1 @@ -33,34 +28,44 @@ jobs: with: repository: stackrox/stackrox path: stackrox + # We need the following for `make tag` to work. Previously it wasn't needed, because the operator bundle wasn't required/pulled. + # Fetching 'latest' tag for the stackrox images simply worked. + # For the operator bundle we need a proper image tag, i.e. a resolved version of 'latest'. + fetch-depth: 0 + fetch-tags: true + + - name: Install roxie + uses: stackrox/actions/roxie/install-cli@bcda9b2d6d2b644c267e699479656973e84ef7fa # ratchet:stackrox/actions@v1 + with: + version: v0.4.17 + gh-token: ${{ secrets.GITHUB_TOKEN }} - name: Install Stackrox - env: - MAIN_IMAGE_TAG: 'latest' - SENSOR_HELM_DEPLOY: 'true' - ROX_SCANNER_V4: 'false' run: | - stackrox/deploy/k8s/deploy-local.sh - ROX_PASSWORD=$(cat stackrox/deploy/k8s/central-deploy/password) - echo "::add-mask::$ROX_PASSWORD" - echo "ROX_PASSWORD=$ROX_PASSWORD" >> $GITHUB_ENV - echo "ROX_URL=https://${ROX_HOST}:${ROX_PORT}" >> $GITHUB_ENV + envrc_file="$(mktemp)" + cd stackrox + roxie deploy central \ + --envrc "$envrc_file" \ + --resources tiny \ + --set roxie.imageRegistry=quay.io/stackrox-io \ + --set central.spec.scannerV4.scannerComponent=Disabled + source "$envrc_file" - - name: Install and trust Central certificate - run: | - # Extract the server certificate and save it as a new CA file - echo | \ - openssl s_client -showcerts -servername $ROX_HOST -connect $ROX_HOST:8000 2>/dev/null | \ - awk '/-----BEGIN CERTIFICATE-----/,/-----END CERTIFICATE-----/ { print $0 }' > central.crt + echo "::add-mask::$ROX_ADMIN_PASSWORD" + + # Split on last colon. ROX_ENDPOINT is expected to be of the form ":". + export ROX_CENTRAL_HOST="${ROX_ENDPOINT%:*}" + export ROX_CENTRAL_PORT="${ROX_ENDPOINT##*:}" - # Install the certificate into the system trust store - sudo cp central.crt /usr/local/share/ca-certificates/central.crt - sudo update-ca-certificates + env | grep "^ROX_" >> $GITHUB_ENV - name: Add machine to machine configuration in Central run: | - curl -u admin:${ROX_PASSWORD} \ - ${ROX_URL}/v1/auth/m2m \ + curl \ + --cacert "$ROX_CA_CERT_FILE" \ + --resolve "${ROX_INTERNAL_CENTRAL_NAME}:${ROX_CENTRAL_PORT}:${ROX_CENTRAL_HOST}" \ + -u admin:${ROX_ADMIN_PASSWORD} \ + https://${ROX_INTERNAL_CENTRAL_NAME}:${ROX_CENTRAL_PORT}/v1/auth/m2m \ -d \ '{ "config": { @@ -81,14 +86,16 @@ jobs: uses: ./ with: audience: central.stackrox.io - endpoint: ${{ env.ROX_URL }} + endpoint: ${{ env.ROX_BASE_URL }} - name: Install roxctl uses: stackrox/roxctl-installer-action@v1 with: - central-endpoint: ${{ env.ROX_URL }} + central-endpoint: ${{ env.ROX_BASE_URL }} central-token: ${{ env.ROX_API_TOKEN }} + skip-tls-verify: true # The action doesn't support providing certs. Doing the whole update-tls dance just for this seems unnecessary. - name: Check the current user with roxctl run: | + unset ROX_ADMIN_PASSWORD # Otherwise roxctl will be confused about which authentication method to use. roxctl central whoami From 399eced644c7c68d04c33db602d1566cdf40ef7e Mon Sep 17 00:00:00 2001 From: Moritz Clasmeier Date: Thu, 5 Nov 2026 09:12:55 +0100 Subject: [PATCH 2/6] Add TODO comment --- .github/workflows/e2e.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index af8b340..76294e5 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -34,6 +34,7 @@ jobs: fetch-depth: 0 fetch-tags: true + # TODO(ROX-37886): Remove this and rely on stackrox/stackrox's scripts/roxie.sh instead. - name: Install roxie uses: stackrox/actions/roxie/install-cli@bcda9b2d6d2b644c267e699479656973e84ef7fa # ratchet:stackrox/actions@v1 with: From f71dc19cee9b1ef5a31afa5bec57807378485e41 Mon Sep 17 00:00:00 2001 From: Moritz Clasmeier Date: Thu, 5 Nov 2026 09:13:36 +0100 Subject: [PATCH 3/6] Deploy into stackrox namespace --- .github/workflows/e2e.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 76294e5..3911ee9 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -49,6 +49,7 @@ jobs: --envrc "$envrc_file" \ --resources tiny \ --set roxie.imageRegistry=quay.io/stackrox-io \ + --set central.namespace=stackrox \ --set central.spec.scannerV4.scannerComponent=Disabled source "$envrc_file" From 36241d523657b94df35b0f57649f2ffc7f2b6efd Mon Sep 17 00:00:00 2001 From: Moritz Clasmeier <111092021+mclasmeier@users.noreply.github.com> Date: Thu, 5 Nov 2026 09:17:28 +0100 Subject: [PATCH 4/6] Update .github/workflows/e2e.yml Co-authored-by: Marcin Owsiany --- .github/workflows/e2e.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 3911ee9..9417ac3 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -28,9 +28,7 @@ jobs: with: repository: stackrox/stackrox path: stackrox - # We need the following for `make tag` to work. Previously it wasn't needed, because the operator bundle wasn't required/pulled. - # Fetching 'latest' tag for the stackrox images simply worked. - # For the operator bundle we need a proper image tag, i.e. a resolved version of 'latest'. + # We need the following for `make tag` to generate a proper image tag of operator bundle. fetch-depth: 0 fetch-tags: true From 5b4b6a273bc71f23edddfd386b8a2dd15d24b95e Mon Sep 17 00:00:00 2001 From: Moritz Clasmeier Date: Thu, 5 Nov 2026 09:27:07 +0100 Subject: [PATCH 5/6] Minimize diff --- .github/workflows/e2e.yml | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 9417ac3..52ec016 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -9,8 +9,8 @@ on: - cron: '0 5 * * 0' env: - # StackRox internal certificate for central is issued for this name. - ROX_INTERNAL_CENTRAL_NAME: 'central.stackrox' + # The certificate is valid for this host so in order to use "secure" mode we add this to hosts and use for calling central + ROX_HOST: 'central.stackrox' jobs: e2e: @@ -21,6 +21,10 @@ jobs: steps: - uses: actions/checkout@v7 + - name: Set up hostname + run: | + echo "127.0.0.1 ${ROX_HOST}" | sudo tee -a /etc/hosts >/dev/null + - name: Create k8s Kind Cluster uses: helm/kind-action@v1 @@ -53,19 +57,33 @@ jobs: echo "::add-mask::$ROX_ADMIN_PASSWORD" + # This workflow expects a different name. + export ROX_PASSWORD="$ROX_ADMIN_PASSWORD" + unset ROX_ADMIN_PASSWORD + # Split on last colon. ROX_ENDPOINT is expected to be of the form ":". export ROX_CENTRAL_HOST="${ROX_ENDPOINT%:*}" export ROX_CENTRAL_PORT="${ROX_ENDPOINT##*:}" + echo "ROX_URL=https://${ROX_HOST}:${ROX_CENTRAL_PORT}" >> "$GITHUB_ENV" + env | grep "^ROX_" >> $GITHUB_ENV + - name: Install and trust Central certificate + run: | + # Extract the server certificate and save it as a new CA file + echo | \ + openssl s_client -showcerts -servername $ROX_HOST -connect $ROX_HOST:$ROX_CENTRAL_PORT 2>/dev/null | \ + awk '/-----BEGIN CERTIFICATE-----/,/-----END CERTIFICATE-----/ { print $0 }' > central.crt + + # Install the certificate into the system trust store + sudo cp central.crt /usr/local/share/ca-certificates/central.crt + sudo update-ca-certificates + - name: Add machine to machine configuration in Central run: | - curl \ - --cacert "$ROX_CA_CERT_FILE" \ - --resolve "${ROX_INTERNAL_CENTRAL_NAME}:${ROX_CENTRAL_PORT}:${ROX_CENTRAL_HOST}" \ - -u admin:${ROX_ADMIN_PASSWORD} \ - https://${ROX_INTERNAL_CENTRAL_NAME}:${ROX_CENTRAL_PORT}/v1/auth/m2m \ + curl -u admin:${ROX_PASSWORD} \ + ${ROX_URL}/v1/auth/m2m \ -d \ '{ "config": { @@ -86,16 +104,14 @@ jobs: uses: ./ with: audience: central.stackrox.io - endpoint: ${{ env.ROX_BASE_URL }} + endpoint: ${{ env.ROX_URL }} - name: Install roxctl uses: stackrox/roxctl-installer-action@v1 with: - central-endpoint: ${{ env.ROX_BASE_URL }} + central-endpoint: ${{ env.ROX_URL }} central-token: ${{ env.ROX_API_TOKEN }} - skip-tls-verify: true # The action doesn't support providing certs. Doing the whole update-tls dance just for this seems unnecessary. - name: Check the current user with roxctl run: | - unset ROX_ADMIN_PASSWORD # Otherwise roxctl will be confused about which authentication method to use. roxctl central whoami From 4f40c8801f4022eac5780b997e2b30ec1e808ded Mon Sep 17 00:00:00 2001 From: Moritz Clasmeier Date: Thu, 5 Nov 2026 12:43:08 +0100 Subject: [PATCH 6/6] Curl retries --- .github/workflows/e2e.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 52ec016..080aa74 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -83,6 +83,7 @@ jobs: - name: Add machine to machine configuration in Central run: | curl -u admin:${ROX_PASSWORD} \ + --retry 3 --retry-connrefused --retry-delay 5 \ ${ROX_URL}/v1/auth/m2m \ -d \ '{