Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .ci-operator.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
build_root_image:
name: release
namespace: openshift
tag: rhel-9-release-golang-1.25-openshift-4.22
tag: rhel-9-release-golang-1.26-openshift-5.0
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.25-openshift-4.22 AS builder
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.26-openshift-5.0 AS builder
WORKDIR /go/src/github.com/openshift/cluster-network-operator
COPY . .

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Replace broad build-context copy with explicit file copies.

COPY . . can unintentionally pull secrets and unrelated files into the build context. Copy only the files needed for compile (e.g., go.mod, go.sum, pkg/, cmd/, manifests/, bindata/, hack/build-go.sh).

Suggested hardening diff
-WORKDIR /go/src/github.com/openshift/cluster-network-operator
-COPY . .
+WORKDIR /go/src/github.com/openshift/cluster-network-operator
+COPY go.mod go.sum ./
+COPY cmd/ ./cmd/
+COPY pkg/ ./pkg/
+COPY manifests/ ./manifests/
+COPY bindata/ ./bindata/
+COPY hack/build-go.sh ./hack/build-go.sh
 RUN hack/build-go.sh

As per coding guidelines, **/{Dockerfile,Containerfile}* requires copying specific files instead of the entire context.

🤖 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 `@Dockerfile` at line 3, Replace the broad "COPY . ." in the Dockerfile with
explicit COPY directives for only required build inputs (e.g., copy go.mod and
go.sum, then copy pkg/, cmd/, manifests/, bindata/, and hack/build-go.sh) to
avoid including secrets or unrelated files in the image; update the Dockerfile
to first COPY the module files and run go mod download (or equivalent) for layer
caching, then COPY the source directories listed (pkg, cmd, manifests, bindata,
hack/build-go.sh) so the build context is minimal and deterministic.

Source: Coding guidelines

RUN hack/build-go.sh

FROM registry.ci.openshift.org/ocp/4.22:base-rhel9
FROM registry.ci.openshift.org/ocp/5.0:base-rhel9
COPY --from=builder /go/src/github.com/openshift/cluster-network-operator/cluster-network-operator /usr/bin/
COPY --from=builder /go/src/github.com/openshift/cluster-network-operator/cluster-network-check-endpoints /usr/bin/
COPY --from=builder /go/src/github.com/openshift/cluster-network-operator/cluster-network-check-target /usr/bin/
Expand Down
109 changes: 55 additions & 54 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module github.com/openshift/cluster-network-operator

go 1.25.0
go 1.26.0

require (
github.com/Masterminds/semver v1.5.0
github.com/Masterminds/sprig/v3 v3.2.3
github.com/containernetworking/cni v0.8.0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

Known HIGH severity CVE in github.com/containernetworking/cni v0.8.0.

Static analysis flags two HIGH severity vulnerabilities in this dependency:

  • GO-2022-0230: Improper limitation of path name
  • GHSA-xjqr-g762-pxwp: containernetworking/cni improper limitation of path name

While this dependency version is pre-existing (not introduced by this PR), as per coding guidelines for supply chain security, known CVEs should be flagged and remediated. Consider updating to a patched version in a follow-up PR.

🧰 Tools
🪛 OSV Scanner (2.3.8)

[HIGH] 8-8: github.com/containernetworking/cni 0.8.0: Improper limitation of path name in github.com/containernetworking/cni

(GO-2022-0230)


[HIGH] 8-8: github.com/containernetworking/cni 0.8.0: containernetworking/cni improper limitation of path name

(GHSA-xjqr-g762-pxwp)

🤖 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 `@go.mod` at line 8, The go.mod entry for the dependency
github.com/containernetworking/cni at version v0.8.0 contains known
HIGH-severity CVEs (GO-2022-0230 / GHSA-xjqr-g762-pxwp); update the module
declaration for github.com/containernetworking/cni to a patched release (replace
v0.8.0 with the latest patched version that fixes GO-2022-0230), then run
dependency cleanup (e.g., go get to the chosen version and go mod tidy) and run
tests to ensure nothing breaks.

Sources: Coding guidelines, Linters/SAST tools

github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32
github.com/go-bindata/go-bindata v3.1.2+incompatible
github.com/onsi/gomega v1.39.1
github.com/onsi/gomega v1.40.0
github.com/openshift/build-machinery-go v0.0.0-20251023084048-5d77c1a5e5af
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.23.2
Expand All @@ -17,16 +17,16 @@ require (
github.com/stretchr/testify v1.11.1
github.com/vishvananda/netlink v1.1.0
github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae // indirect
golang.org/x/net v0.51.0
golang.org/x/net v0.55.1-0.20260602153038-42abb857022c
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.35.2
k8s.io/apimachinery v0.36.0-alpha.2
k8s.io/code-generator v0.35.2
k8s.io/component-base v0.35.2
k8s.io/klog/v2 v2.130.1
k8s.io/kube-proxy v0.35.2
k8s.io/utils v0.0.0-20260210185600-b8788abfbbc2
sigs.k8s.io/controller-runtime v0.23.1
k8s.io/api v0.36.2
k8s.io/apimachinery v0.36.2
k8s.io/code-generator v0.36.2
k8s.io/component-base v0.36.2
k8s.io/klog/v2 v2.140.0
k8s.io/kube-proxy v0.36.2
k8s.io/utils v0.0.0-20260617174310-a95e086a2553
sigs.k8s.io/controller-runtime v0.24.1
)

require (
Expand All @@ -39,16 +39,15 @@ require (
github.com/coreos/go-systemd/v22 v22.7.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.9.0 // indirect
github.com/fsnotify/fsnotify v1.10.0 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-openapi/jsonpointer v0.22.5 // indirect
github.com/go-openapi/jsonpointer v0.23.1 // indirect
github.com/go-openapi/jsonreference v0.21.5 // indirect
github.com/go-openapi/swag v0.25.5 // indirect
github.com/go-openapi/swag v0.26.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/go-cmp v0.7.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.1-0.20210315223345-82c243799c99 // indirect
github.com/huandu/xstrings v1.4.0 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
Expand Down Expand Up @@ -77,36 +76,36 @@ require (
go.opentelemetry.io/proto/otlp v1.9.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.1 // indirect
golang.org/x/crypto v0.48.0 // indirect
golang.org/x/mod v0.33.0 // indirect
golang.org/x/oauth2 v0.35.0 // indirect
golang.org/x/sync v0.19.0 // indirect
golang.org/x/sys v0.41.0 // indirect
golang.org/x/term v0.40.0 // indirect
golang.org/x/text v0.34.0 // indirect
golang.org/x/time v0.14.0 // indirect
golang.org/x/tools v0.42.0 // indirect
golang.org/x/crypto v0.52.0 // indirect
golang.org/x/mod v0.35.0 // indirect
golang.org/x/oauth2 v0.36.0 // indirect
golang.org/x/sync v0.20.0 // indirect
golang.org/x/sys v0.45.0 // indirect
golang.org/x/term v0.43.0 // indirect
golang.org/x/text v0.37.0 // indirect
golang.org/x/time v0.15.0 // indirect
golang.org/x/tools v0.44.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect
google.golang.org/grpc v1.79.1 // indirect
google.golang.org/protobuf v1.36.11 // indirect
google.golang.org/grpc v1.80.0 // indirect
google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af // indirect

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

What is the latest stable release version of google.golang.org/protobuf and is v1.36.12 an official release?

💡 Result:

As of June 16, 2026, the latest stable release version of the google.golang.org/protobuf module is v1.36.11 [1][2][3]. Regarding v1.36.12, it is not an official stable release [3]. While you may see references to v1.36.12 in pseudo-version formats (e.g., v1.36.12-0.20260120151049-f2248ac996af) [2][4], these are automatically generated by the Go module system based on specific commits and do not represent a tagged, official stable release [2]. As of April 2026, there have been community inquiries regarding an official v1.36.12 release, confirming that it has not been officially published as a stable version [5].

Citations:


🏁 Script executed:

#!/bin/bash
# Verify google.golang.org/protobuf version status
# Expect: Confirm whether v1.36.12 is an official release or if the pseudo-version is intentional for K8s 1.36 compatibility

# Check what the pseudo-version resolves to
python3 << 'EOF'
version = "v1.36.12-0.20260120151049-f2248ac996af"
# Parse: vMAJOR.MINOR.PATCH-TIMESTAMP-HASH
parts = version.split("-")
print(f"Base version: {parts[0]}")
print(f"Timestamp: {parts[1]} (format: YYYYMMDDHHMMSS)")
print(f"Commit hash: {parts[2]}")
import datetime
ts = int(parts[1])
if len(parts[1]) == 14:
    dt = datetime.datetime.strptime(parts[1], "%Y%m%d%H%M%S")
    print(f"Resolved to: {dt.isoformat()} UTC")
EOF

Repository: openshift/cluster-network-operator

Length of output: 342


Replace google.golang.org/protobuf with the latest stable release, v1.36.11.

Line 90 pins google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af, a pseudo-version that resolves to a development commit from early January 2026. Version v1.36.12 is not an official stable release; the latest stable version is v1.36.11. Per supply chain security guidelines, production dependencies must pin to released versions, not pre-release or development builds. Update to v1.36.11.

🤖 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 `@go.mod` at line 90, The google.golang.org/protobuf dependency is pinned to a
pseudo-version (v1.36.12-0.20260120151049-f2248ac996af) which is a development
commit from early January 2026, not an official stable release. Replace this
pseudo-version with the latest stable release version v1.36.11 in the go.mod
file on line 90. This ensures the project adheres to supply chain security
guidelines by using only official released versions rather than development
builds.

Source: Coding guidelines

gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/kube-openapi v0.0.0-20260127142750-a19766b6e2d4 // indirect
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.34.0 // indirect
k8s.io/kube-openapi v0.0.0-20260624041617-8f3fa4921821 // indirect
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.36.0 // indirect
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
sigs.k8s.io/kube-storage-version-migrator v0.0.6-0.20230721195810-5c8923c5ff96 // indirect
sigs.k8s.io/yaml v1.6.0 // indirect
)

require (
github.com/openshift/api v0.0.0-20260609121705-d3390bd1109f
github.com/openshift/client-go v0.0.0-20260603140539-6892dc3e1ffc
github.com/openshift/library-go v0.0.0-20260303171201-5d9eb6295ff6
github.com/openshift/api v0.0.0-20260625145753-fcee12291776
github.com/openshift/client-go v0.0.0-20260622130833-df412d4d283e
github.com/openshift/library-go v0.0.0-20260625132832-242448b38f1f
github.com/openshift/machine-config-operator v0.0.1-0.20250724162154-ab14c8e2843b
k8s.io/apiextensions-apiserver v0.35.2
k8s.io/client-go v0.35.2
sigs.k8s.io/controller-tools v0.20.1
k8s.io/apiextensions-apiserver v0.36.2
k8s.io/client-go v0.36.2
sigs.k8s.io/controller-tools v0.21.0
)

require (
Expand All @@ -116,26 +115,27 @@ require (
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
github.com/emicklei/go-restful/v3 v3.13.0 // indirect
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
github.com/fatih/color v1.18.0 // indirect
github.com/fatih/color v1.19.0 // indirect
github.com/felixge/fgprof v0.9.4 // indirect
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
github.com/fxamacker/cbor/v2 v2.9.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/swag/cmdutils v0.25.5 // indirect
github.com/go-openapi/swag/conv v0.25.5 // indirect
github.com/go-openapi/swag/fileutils v0.25.5 // indirect
github.com/go-openapi/swag/jsonname v0.25.5 // indirect
github.com/go-openapi/swag/jsonutils v0.25.5 // indirect
github.com/go-openapi/swag/loading v0.25.5 // indirect
github.com/go-openapi/swag/mangling v0.25.5 // indirect
github.com/go-openapi/swag/netutils v0.25.5 // indirect
github.com/go-openapi/swag/stringutils v0.25.5 // indirect
github.com/go-openapi/swag/typeutils v0.25.5 // indirect
github.com/go-openapi/swag/yamlutils v0.25.5 // indirect
github.com/go-openapi/swag/cmdutils v0.26.0 // indirect
github.com/go-openapi/swag/conv v0.26.0 // indirect
github.com/go-openapi/swag/fileutils v0.26.0 // indirect
github.com/go-openapi/swag/jsonname v0.26.0 // indirect
github.com/go-openapi/swag/jsonutils v0.26.0 // indirect
github.com/go-openapi/swag/loading v0.26.0 // indirect
github.com/go-openapi/swag/mangling v0.26.0 // indirect
github.com/go-openapi/swag/netutils v0.26.0 // indirect
github.com/go-openapi/swag/stringutils v0.26.0 // indirect
github.com/go-openapi/swag/typeutils v0.26.0 // indirect
github.com/go-openapi/swag/yamlutils v0.26.0 // indirect
github.com/gobuffalo/flect v1.0.3 // indirect
github.com/google/btree v1.1.3 // indirect
github.com/google/cel-go v0.27.0 // indirect
github.com/google/gnostic-models v0.7.1 // indirect
github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83 // indirect
github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.1.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.3 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
Expand All @@ -148,16 +148,17 @@ require (
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.41.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.41.0 // indirect
go.yaml.in/yaml/v2 v2.4.3 // indirect
go.yaml.in/yaml/v2 v2.4.4 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/exp v0.0.0-20260218203240-3dfff04db8fa // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20260226221140-a57be14db171 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260226221140-a57be14db171 // indirect
gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect
k8s.io/apiserver v0.35.2 // indirect
k8s.io/gengo/v2 v2.0.0-20251215205346-5ee0d033ba5b // indirect
k8s.io/kms v0.35.2 // indirect
k8s.io/kube-aggregator v0.35.1 // indirect
k8s.io/apiserver v0.36.2 // indirect
k8s.io/gengo/v2 v2.0.0-20260408192533-25e2208e0dc3 // indirect
k8s.io/kms v0.36.2 // indirect
k8s.io/kube-aggregator v0.36.2 // indirect
k8s.io/streaming v0.36.2 // indirect
sigs.k8s.io/randfill v1.0.0 // indirect
sigs.k8s.io/structured-merge-diff/v6 v6.3.2 // indirect
sigs.k8s.io/structured-merge-diff/v6 v6.4.0 // indirect
)
Loading