fix(security): harden CI pipeline trust boundary (EC-2044) - #11
Open
cuipinghuo wants to merge 1 commit into
Open
fix(security): harden CI pipeline trust boundary (EC-2044)#11cuipinghuo wants to merge 1 commit into
cuipinghuo wants to merge 1 commit into
Conversation
Address findings from the e2e-tests security audit (HCMSEC-3528):
- FIND-001 (High): Pin pipelineRef to base repo instead of {{source_url}}/{{revision}}
to prevent PR authors from tampering with the pipeline definition.
- FIND-002 (Medium): Pin all git-resolver revisions (stepactions, konflux-ci-revision)
to immutable commit SHAs with renovate annotations for auto-bumping.
- FIND-003 (Medium): Drop runAsUser:0, add allowPrivilegeEscalation:false,
capabilities drop ALL, and seccomp RuntimeDefault on all task steps.
- FIND-004 (Low): Pin pr-size-label-action to commit SHA instead of mutable tag.
- FIND-005 (Low): Pin ubi9/go-toolset image to digest with renovate annotation.
- FIND-006 (Low): Add computeResources requests/limits (2-4 CPU, 4-8Gi memory).
- T1/T2 credential isolation: Split custom CLI build into a separate trusted step
so the e2e-test step (which runs PR-authored code) no longer has access to
konflux-test-infra registry push credentials. Secret volume mounts are readOnly.
Remaining items requiring infrastructure/operational changes (follow-up):
- OIDC/STS migration for AWS credentials (mapt-kind-secret)
- Scope mapt-kind-secret to dedicated sandbox AWS account
- PaC Repository CR settings (pipelinerun_provenance, ok-to-test) when repo is
onboarded on Konflux
- RBAC restriction for konflux-integration-runner ServiceAccount
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses findings from the e2e-tests security audit (HCMSEC-3528) and threat model, targeting all high/critical threats.
pipelineRefto base repo (https://github.com/conforma/e2e-tests.git@main) instead of{{source_url}}/{{revision}}, preventing PR authors from tampering with the pipeline definitionsecure-push-oci,fail-if-any-step-failedstepactions,konflux-ci-revision) to immutable commit SHAs with# renovate:annotations for auto-bumpingrunAsUser: 0, addallowPrivilegeEscalation: false,capabilities.drop: [ALL],seccompProfile: RuntimeDefaulton all task stepsconforma/pr-size-label-actionto commit SHA instead of mutablev1.0.0tagubi9/go-toolsetimage to@sha256:digest with renovate annotationcomputeResourcesrequests/limits (2-4 CPU, 4-8Gi memory)build-custom-cli) so thee2e-teststep — which runs PR-authored Go code — no longer has access tokonflux-test-infraregistry push credentials. All secret volume mounts arereadOnly: true.Credential isolation (before → after)
konflux-test-infra(push creds)konflux-e2e-secrets(QUAY_TOKEN)e2e-testbuild-custom-clie2e-testsecure-push-ociFollow-up items (require infrastructure/operational changes)
mapt-kind-secret) — requires AWS account OIDC trust setup and upstreamprovision-kind-clustertask changesmapt-kind-secretto a dedicated sandbox AWS account with deny-all SCP outside EC2/kind provisioningpipelinerun_provenance: "default_branch",ok-to-test: "enable") when repo is onboarded on Konflux — PaC GitHub App is currently not installed onconforma/e2e-testskonflux-integration-runnerServiceAccountContext
Test plan
custom-ec-cli-url/custom-ec-cli-revisionset to confirm thebuild-custom-cli→e2e-testhandoff via shared volume worksbuild-custom-clistep exits cleanlye2e-teststep runs successfully as non-root (UID 1001)# renovate:annotations for auto-bumping🤖 Generated with Claude Code