Skip to content

fix(security): harden CI pipeline trust boundary (EC-2044) - #11

Open
cuipinghuo wants to merge 1 commit into
conforma:mainfrom
cuipinghuo:ec-2044
Open

fix(security): harden CI pipeline trust boundary (EC-2044)#11
cuipinghuo wants to merge 1 commit into
conforma:mainfrom
cuipinghuo:ec-2044

Conversation

@cuipinghuo

Copy link
Copy Markdown
Contributor

Summary

Addresses findings from the e2e-tests security audit (HCMSEC-3528) and threat model, targeting all high/critical threats.

  • FIND-001 (High, CVSS 8.5): Pin pipelineRef to base repo (https://github.com/conforma/e2e-tests.git@main) instead of {{source_url}}/{{revision}}, preventing PR authors from tampering with the pipeline definition
  • FIND-002 (Medium): Pin all git-resolver revisions (secure-push-oci, fail-if-any-step-failed 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], seccompProfile: RuntimeDefault on all task steps
  • FIND-004 (Low): Pin conforma/pr-size-label-action to commit SHA instead of mutable v1.0.0 tag
  • FIND-005 (Low): Pin ubi9/go-toolset image to @sha256: 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 (build-custom-cli) so the e2e-test step — which runs PR-authored Go code — no longer has access to konflux-test-infra registry push credentials. All secret volume mounts are readOnly: true.

Credential isolation (before → after)

Step konflux-test-infra (push creds) konflux-e2e-secrets (QUAY_TOKEN) kubeconfig Runs PR code?
Before: e2e-test Yes
After: build-custom-cli ✅ (readOnly) No (trusted params)
After: e2e-test ✅ (readOnly) Yes
After: secure-push-oci ✅ (via volume) No (pinned stepaction)

Follow-up items (require infrastructure/operational changes)

  • OIDC/STS migration for AWS credentials (mapt-kind-secret) — requires AWS account OIDC trust setup and upstream provision-kind-cluster task changes
  • Scope mapt-kind-secret to a dedicated sandbox AWS account with deny-all SCP outside EC2/kind provisioning
  • PaC Repository CR settings (pipelinerun_provenance: "default_branch", ok-to-test: "enable") when repo is onboarded on Konflux — PaC GitHub App is currently not installed on conforma/e2e-tests
  • RBAC restriction for konflux-integration-runner ServiceAccount

Context

  • Jira: EC-2044
  • Security audit: HCMSEC-3528 (2026-06-15)
  • Threat model: 12 threats identified, 5 critical/high — this PR partially mitigates T1, T2, T5 and fully addresses T3, T4

Test plan

  • Verify pipeline YAML is syntactically valid (Tekton parser)
  • Run a pipeline with custom-ec-cli-url/custom-ec-cli-revision set to confirm the build-custom-clie2e-test handoff via shared volume works
  • Run a pipeline without custom CLI params to confirm build-custom-cli step exits cleanly
  • Confirm e2e-test step runs successfully as non-root (UID 1001)
  • Verify renovate/Mintmaker picks up the # renovate: annotations for auto-bumping

🤖 Generated with Claude Code

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>
@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 84c07edf-faf9-41ab-86e2-3ca392aebfb7


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant