/golang:triage-fixed-cvesfrom golang
Cross-references Go stdlib CVEs against an OpenShift release image to determine which CVEs are fixed by the Go version each component was built with.
Ships in golang. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Analyze an OpenShift release image to determine which Go standard library CVE Jira tickets have been addressed by the Go version used to build each component. Produces a per-CVE, per-component cross-reference report.
The user provides a release image pullspec (e.g.
quay.io/openshift-release-dev/ocp-release:4.17.0-x86_64).
Execute every step below in order. Do not skip steps.
oc adm release info <RELEASE_IMAGE> --output=json
Parse the JSON output to get the list of component image references. Each
entry in .references.spec.tags[] provides a name (component name) and
.from.name (image pullspec).
Each tag also carries .annotations metadata. Extract the
io.openshift.build.source-location annotation — this is the canonical
source GitHub repository URL for that component (e.g.
https://github.com/openshift/cluster-version-operator). Also extract
io.openshift.build.commit.id which gives the exact source commit SHA
the image was built from. Record both for every component — they are used
in Steps 2 and 4.
Auth failure: If oc adm release info fails due to an authentication
error, STOP immediately. Report the auth failure to the user and do not
proceed. Do not attempt to locate pull secrets, probe environment variables,
or try alternative credential paths — the RWS pod's registry proxy handles
authentication transparently, so an auth failure means the proxy does not
have credentials for this registry and manual intervention is required.
Collect the full list of (component_name, image_pullspec, source_repo, source_commit) tuples before proceeding.
For each component, identify exactly which binary is built and where it lands in the final image by looking up the component's Dockerfile. Do NOT scan the entire image for all ELF binaries.
Look up the ci-operator config at
github.com/openshift/release/ci-operator/config/openshift/<repo>/.
Match the correct config file for the release branch and build variant (e.g.
openshift-cluster-version-operator-release-4.17.yaml). The config's
images.items[] specifies the dockerfile_path for each image. Fetch that
Dockerfile from the component's own repository at the exact source commit
recorded in io.openshift.build.commit.id from Step 1 — do not use
tree/main or the branch tip, as the release image may have been built from
an older revision.
Builder substitutions: ci-operator configs may declare builder image
overrides via images.items[].inputs.as — these replace FROM targets in
the Dockerfile at build time, which can change the Go toolchain version used.
Note any such substitutions when recording the component's build context.
Check the ocp-build-data config on the matching branch (e.g.
github.com/openshift-eng/ocp-build-data/tree/openshift-4.17/images/<component>.yml).
The from: and dockerfile: fields point to the Dockerfile.
OKD builds: The ocp-build-data image config may contain an
okd_alignment section that specifies a different Dockerfile for OKD
builds. These are typically named Dockerfile.scos or Dockerfile.okd.
When this section is present, use the OKD-specific Dockerfile instead of
the default one for OKD images. As with CI images, fetch the OKD
Dockerfile at the exact source commit from io.openshift.build.commit.id
(Step 1), not from the branch tip.
Look for:
go build -o <binary> or go install commands — these tell you the output
binary name.COPY --from=builder <src> <dest> in multi-stage builds — this tells you
where the binary is placed in the final image.Example: a Dockerfile with go build -o /go/bin/cvo ./cmd/cvo and
COPY --from=builder /go/bin/cvo /usr/bin/cluster-version-operator means
the target binary is /usr/bin/cluster-version-operator.
For each component, extract the Go version from the specific binary identified in Step 2.
podman pull <IMAGE>
podman create --name tmp-extract <IMAGE>
podman cp tmp-extract:<binary_path> /tmp/target-binary
podman rm -f tmp-extract # always remove so the name is freed for the next component
go version /tmp/target-binary
Cleanup: Always run podman rm -f tmp-extract unconditionally after
extraction (even on failure) so the container name is available for the
next component. Wrap the extract-copy-remove sequence in a function or
loop body to ensure cleanup is never skipped.
Parse the output. The format is:
/tmp/target-binary: go1.22.5
Extract the semver-style version (e.g. 1.22.5).
images.items[].inputs.as) mean components can lag
behind or jump ahead of the "default" Go version for a release.N/A — no Go binary found and skip it in later steps.Search for open Jira vulnerability issues that track Go standard library CVEs affecting the components in this release.
Using the io.openshift.build.source-location source repo URLs extracted in
Step 1, map each repo to its corresponding OCPBUGS Jira component name (e.g.
openshift/cluster-version-operator → cluster-version-operator).
Using the discovered component list, query Jira with the coordinator's
query_jira tool:
project = OCPBUGS
AND type = Vulnerability
AND labels in ("arc:stdlib")
AND status not in (Closed, "Release Pending", Verified)
AND component in (<discovered components>)
AND summary ~ "openshift-<version>"
ORDER BY component ASC
Replace <discovered components> with the comma-separated list of Jira
component names from step 4a, and <version> with the target OCP version
(e.g. 4.17).
For each returned issue, record:
OCPBUGS-12345)CVE-2024-24790) — extract the CVE-YYYY-NNNNN pattern
from the issue summaryFilter out CVEs that affect vendored Go dependencies rather than the Go standard library itself. The goal is to keep only CVEs that are fixed by upgrading the Go toolchain version.
golang.org/x/* packages: CVEs affecting golang.org/x/net,
golang.org/x/crypto, golang.org/x/text, golang.org/x/image, etc.
are vendored dependencies, not stdlib. Exclude them.
Hybrid CVEs: Some CVEs affect both stdlib packages AND vendored modules
(e.g. a CVE that affects net/http in stdlib but also
golang.org/x/net/http2). Classify these into a separate "Hybrid"
category — do not list them as both included and excluded:
Detection method: Read the Jira issue description and any linked advisories. Look for:
golang.org/x/ — vendorednet/http, crypto/tls, os, runtime — stdlibProduce three lists from this step:
For each remaining stdlib CVE, determine which Go versions contain the fix, then check each component against those fix versions.
ProdSec and ARC typically attach a pkg.go.dev/vuln/GO-* URL to Go CVE
tracker tickets as a web link (remote link). The coordinator's
get_jira_issue tool returns remote links in its output.
For each CVE's Jira issue:
get_jira_issue(issue_key) (you already have the issue key from
Step 4).pkg.go.dev/vuln/GO-* (e.g.
https://pkg.go.dev/vuln/GO-2024-2887).GO-YYYY-NNNN ID from that URL.This is more reliable than searching the vuln database by CVE text, because
the Go vulnerability database uses GO-* format IDs (not CVE IDs directly)
and text search can miss or return ambiguous results.
Using the GO-* ID, fetch the vulnerability entry:
https://pkg.go.dev/vuln/<GO_ID>
Use web_fetch to retrieve the page content, or fetch the JSON:
curl -s "https://vuln.go.dev/ID/<GO_ID>.json"
The vulnerability entry contains fixed version fields under each affected
module/package. For stdlib entries the module is stdlib (or std). The
fixed field tells you the first Go version where the vulnerability is
patched (e.g. 1.22.5).
Note: there may be multiple fix versions for different Go release branches
(e.g. fixed in 1.21.12 and 1.22.5). Record all of them.
Fallback if no remote link is present: If a Jira ticket does not have a
pkg.go.dev/vuln remote link, try searching the Go vulnerability database
web interface via web_fetch:
https://pkg.go.dev/vuln/list?q=<CVE_ID>
If no Go vulnerability database entry exists for a CVE, note it as "not in Go vuln DB."
For each CVE, compare the fixed Go version(s) against each component's detected Go version from Step 3.
For a given CVE with fixed versions [1.21.12, 1.22.5]:
1.22.5 or later on the 1.22 branch → FIXED1.22.4 on the 1.22 branch → AFFECTED1.21.12 or later on the 1.21 branch → FIXED1.23.0 (a newer minor branch) → FIXED
(Go includes all prior fixes in new minor releases)Version comparison rules:
Build a matrix: CVE × Component → FIXED | AFFECTED | N/A.
Produce a structured Markdown report with the following sections:
For each CVE (sorted by CVE ID):
ALL FIXED | PARTIALLY FIXED (N of M) | ALL AFFECTEDList components whose Go version is notably older than the release majority. These are the highest-risk components for stdlib CVEs and likely need builder image updates.
List CVEs classified as hybrid in Step 5. For each, show:
This section prevents hybrid CVEs from being ambiguously double-listed as both "included" and "excluded."
List CVEs excluded in Step 5 as vendored-only, with the reason for
exclusion (e.g. golang.org/x/net — vendored dependency, not stdlib).
Write the report to a file and store it via store_text with a descriptive
label (e.g. golang-cve-triage-4.17.0) so the coordinator can share it with
the user.
store_text(
local_path="/workspace/golang-cve-report.md",
label="golang-cve-triage-<version>",
description="Go stdlib CVE triage report for OCP <version>"
)
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub openshift-eng/ai-helpers --plugin golang6 skills in this plugin
/analyze-release-go-versionsAnalyze Go builder images, declared Go versions, or Go module versions across an OpenShift release using the golang plugin's release inventory scripts.
Use when the user asks to filter or compare component results.
/fix-cvePatch a Go dependency to fix a CVE using the appropriate strategy based on Go version compatibility.
Use when the user wants to fix a CVE by updating a Go module, replacing it with a patched fork,
or applying a security patch across all go.mod files in a Go project.
Triggers on: 'patch CVE', 'fix CVE', 'replace grpc', 'update vulnerable dependency',
'security patch go module', or any mention of CVE + Go dependency replacement.
/go-lintRun golangci-lint to check Go code quality. Use when the user asks to lint, check for lint issues, or verify code quality in a Go project, or when linting is appropriate before committing Go code changes./go-lint-fixRun golangci-lint and fix all reported issues. Use only when explicitly asked to fix lint issues in a Go project./native-fipsConfigure Go projects to use Go's native FIPS 140 module instead of openssl-based FIPS.
Use when the user wants to enable FIPS compliance in a Go project, migrate from openssl-based FIPS
to native Go FIPS, or when build configs contain GOEXPERIMENT=strictfipsruntime or openssl-based FIPS patterns.
Triggers on: 'native FIPS', 'GOFIPS140', 'FIPS without openssl', 'enable FIPS', 'migrate FIPS',
'GOEXPERIMENT=strictfipsruntime', 'strictfipsruntime', 'fips140', 'Go FIPS module'.
Other plugins' skills for the same job