PSHP-316: update golang and base image for Hypershift Operator CVE remediation#8823
PSHP-316: update golang and base image for Hypershift Operator CVE remediation#8823BraeTroutman wants to merge 1 commit into
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@BraeTroutman: This pull request references PSHP-316 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the vulnerability to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
Skipping CI for Draft Pull Request. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis pull request updates the Go directive in Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error)
✅ Passed checks (10 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8823 +/- ##
==========================================
+ Coverage 42.55% 42.59% +0.03%
==========================================
Files 768 768
Lines 95297 95359 +62
==========================================
+ Hits 40558 40617 +59
- Misses 51932 51934 +2
- Partials 2807 2808 +1 see 3 files with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@go.mod`:
- Line 3: The Go toolchain version is now pinned to 1.25.11 in go.mod, but the
build images still reference older toolchains, so update the pinned Go version
in Containerfile.operator, Containerfile.control-plane, and
Dockerfile.github-actions-runner to 1.25.11 or newer. Make sure the changes are
consistent across these image definitions so any go build or related build step
runs with the same required toolchain version.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 532c08d2-0f91-4683-8dbd-9c194c3134aa
📒 Files selected for processing (2)
Containerfile.operatorgo.mod
ece88ee to
c6e575c
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Containerfile.operator`:
- Line 1: The Red Hat base image in the Containerfile is pinned to a
build-specific tag, so updates will not flow automatically. Update the FROM
reference for the builder stage, and also the runtime base image in the same
Containerfile, to use floating Red Hat tags instead of the fixed versions. Keep
the existing stage names and image sources intact while changing only the tag
values.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: bb672032-e585-4e42-bb10-1e50e0026bd5
⛔ Files ignored due to path filters (1)
hack/workspace/go.workis excluded by!**/*.work
📒 Files selected for processing (3)
Containerfile.control-planeContainerfile.operatorgo.mod
✅ Files skipped from review due to trivial changes (2)
- Containerfile.control-plane
- go.mod
c6e575c to
f7f4c3f
Compare
f7f4c3f to
5d772c6
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Containerfile.control-plane`:
- Line 1: The builder and runtime base images are pinned to specific Red Hat
build tags, which blocks automatic Red Hat security updates. Update the
Containerfile.control-plane FROM directives for both the builder stage and the
ubi-minimal runtime stage to use floating Red Hat tags instead of build-specific
version suffixes, following the Red Hat image policy while keeping non-Red Hat
images pinned by digest.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 2294a0aa-a572-47a5-9ff5-2501443bd361
⛔ Files ignored due to path filters (1)
hack/workspace/go.workis excluded by!**/*.work
📒 Files selected for processing (6)
Containerfile.cliContainerfile.control-planeContainerfile.operatorDockerfile.devDockerfile.e2ego.mod
✅ Files skipped from review due to trivial changes (1)
- Dockerfile.dev
🚧 Files skipped from review as they are similar to previous changes (1)
- go.mod
| @@ -1,4 +1,4 @@ | |||
| FROM registry.access.redhat.com/ubi9/go-toolset:1.25.9-1778054913 AS builder | |||
| FROM registry.access.redhat.com/ubi9/go-toolset:1.26.3-1782305929 AS builder | |||
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Use floating Red Hat base image tags.
Both the go-toolset builder (Line 1) and the ubi-minimal runtime (Line 11) are pinned to build-specific tags (1.26.3-1782305929, 9.8-1782191395). Pinning these Red Hat bases prevents Red Hat-managed security updates from flowing automatically. Use floating Red Hat tags instead.
🔒 Proposed change
-FROM registry.access.redhat.com/ubi9/go-toolset:1.26.3-1782305929 AS builder
+FROM registry.access.redhat.com/ubi9/go-toolset:1.26 AS builder-FROM registry.access.redhat.com/ubi9/ubi-minimal:9.8-1782191395
+FROM registry.access.redhat.com/ubi9/ubi-minimal:9.8Also applies to: 11-11
🧰 Tools
🪛 Trivy (0.69.3)
[error] 1-1: Image user should not be 'root'
Specify at least 1 USER command in Dockerfile with non-root user as argument
Rule: DS-0002
(IaC/Dockerfile)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@Containerfile.control-plane` at line 1, The builder and runtime base images
are pinned to specific Red Hat build tags, which blocks automatic Red Hat
security updates. Update the Containerfile.control-plane FROM directives for
both the builder stage and the ubi-minimal runtime stage to use floating Red Hat
tags instead of build-specific version suffixes, following the Red Hat image
policy while keeping non-Red Hat images pinned by digest.
Source: Path instructions
5d772c6 to
5d91b98
Compare
Test Failure Analysis CompleteJob Information
Test Failure AnalysisErrorSummaryThe Root CausePR #8823 is a Go toolchain and base image upgrade for CVE remediation. It correctly updated:
However, the PR did not update build_root_image:
name: release
namespace: openshift
tag: rhel-9-release-golang-1.25-openshift-4.23This image provides Go 1.25.8 (Red Hat 1.25.8-1.el9_6). The The mismatch is: go.mod requires 1.25.11, but the CI build root only has 1.25.8. Recommendations
Evidence
|
52f66b5 to
a7c96d9
Compare
addressing the below CVEs with golang minor version update, and bump to 9.8 ubi-minimal base image. [ticket here](https://redhat.atlassian.net/browse/PSHP-316) CVE-2026-33846 CVE-2026-33845 CVE-2026-42009 CVE-2026-42010 CVE-2026-4878 CVE-2026-33811 CVE-2026-39836 CVE-2026-27145 CVE-2026-42499 CVE-2026-33814 CVE-2026-42504 CVE-2026-39820
a7c96d9 to
af243dd
Compare
|
@BraeTroutman: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
/approve |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: BraeTroutman, clebs The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
What this PR does / why we need it:
Updates the ubi-minimal base image used for hypershift operator and other images to make use of ubi-minimal:9.8.
Go mod version is bumped to 1.25.11. Since there is no 1.25.11 tag in the go-toolset image, build images are updated to 1.26.3, which works due to golang compilation backwards compatibility guarantees
these bumps address the below CVEs
CVE-2026-33846
CVE-2026-33845
CVE-2026-42009
CVE-2026-42010
CVE-2026-4878
CVE-2026-33811
CVE-2026-39836
CVE-2026-27145
CVE-2026-42499
CVE-2026-33814
CVE-2026-42504
CVE-2026-39820
Which issue(s) this PR fixes:
Fixes #PSHP-316
Special notes for your reviewer:
Checklist:
Summary by CodeRabbit
Summary by CodeRabbit