Skip to content

Commit bb95d1b

Browse files
authored
Merge pull request #539 from kool-dev/upgrade-deps
Upgrade deps + add govulncheck
2 parents 2494cdf + cde8568 commit bb95d1b

7 files changed

Lines changed: 133 additions & 27 deletions

File tree

.github/workflows/govulncheck.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: govulncheck
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
govulncheck:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
# 1.25.x tracks the same Go minor the Dockerfile builds with
15+
# (golang:1.25, pulled fresh), so CI and a local `kool run govulncheck`
16+
# do not disagree about which stdlib advisories still apply.
17+
- name: Install Go
18+
uses: actions/setup-go@v5
19+
with:
20+
go-version: 1.25.x
21+
22+
- name: Checkout code
23+
uses: actions/checkout@v4
24+
25+
# Installed rather than `go run`, which collapses every non-zero exit to 1
26+
# and would hide the difference between "vulnerabilities found" and
27+
# "the scan itself broke".
28+
- name: Install govulncheck
29+
run: go install golang.org/x/vuln/cmd/govulncheck@latest
30+
31+
# Report-only on purpose. govulncheck has no suppression file (unlike
32+
# grype's .grype.yaml), and GO-2026-5932 -- x/crypto/openpgp is
33+
# unmaintained, reached through rhysd/go-github-selfupdate -- has no fix
34+
# available, so gating on it would pin the build red until that dependency
35+
# is replaced. Stdlib findings also churn with every Go patch release.
36+
# A genuine tool failure still fails the job.
37+
- name: Run govulncheck
38+
run: |
39+
set +e
40+
govulncheck ./... > govulncheck.out 2>&1
41+
status=$?
42+
set -e
43+
44+
cat govulncheck.out
45+
46+
{
47+
echo "## govulncheck"
48+
echo
49+
case "$status" in
50+
0) echo "No reachable vulnerabilities found." ;;
51+
3) echo "Reachable vulnerabilities found. Report-only: this does not fail the build." ;;
52+
*) echo "govulncheck failed to run (exit $status)." ;;
53+
esac
54+
echo
55+
echo "<details><summary>Full output</summary>"
56+
echo
57+
echo '```'
58+
cat govulncheck.out
59+
echo '```'
60+
echo
61+
echo "</details>"
62+
} >> "$GITHUB_STEP_SUMMARY"
63+
64+
# 3 means vulnerabilities were found, which we report without failing.
65+
# Anything else non-zero is the scan breaking, and should fail.
66+
if [ "$status" -ne 0 ] && [ "$status" -ne 3 ]; then
67+
exit "$status"
68+
fi

.github/workflows/scan.yml

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ jobs:
1010
grype:
1111
runs-on: ubuntu-latest
1212

13+
env:
14+
SEVERITY_CUTOFF: critical
15+
1316
steps:
1417
- name: Checkout code
1518
uses: actions/checkout@v4
@@ -18,8 +21,42 @@ jobs:
1821
run: docker build --pull -t kooldev/kool:4scan .
1922

2023
- name: Scan image
24+
id: scan
2125
uses: anchore/scan-action@v6
2226
with:
2327
image: "kooldev/kool:4scan"
2428
fail-build: true
25-
severity-cutoff: critical
29+
severity-cutoff: ${{ env.SEVERITY_CUTOFF }}
30+
# report CVE-2026-46595 rather than GHSA-x527-x647-q7gg
31+
by-cve: true
32+
33+
# The scan step writes its SARIF report to a temp file that is discarded
34+
# when the job ends, and on failure logs only "Failed minimum severity
35+
# level" with no CVE, package or version. Print the findings so a red
36+
# build is diagnosable from the log alone. `always()` is required: the
37+
# scan step fails the job, so anything without it never runs -- precisely
38+
# when the output is needed.
39+
- name: Report findings
40+
if: always()
41+
env:
42+
SARIF: ${{ steps.scan.outputs.sarif }}
43+
run: |
44+
if [ ! -f "$SARIF" ]; then
45+
echo "No SARIF report produced - the scan did not run to completion."
46+
exit 0
47+
fi
48+
49+
echo "Findings by severity:"
50+
jq -r '[.runs[].results[].message.text
51+
| capture("^A (?<s>[a-z]+) vulnerability").s]
52+
| group_by(.) | map(" \(.[0]): \(length)")[]' "$SARIF"
53+
54+
echo
55+
echo "Findings at or above the '$SEVERITY_CUTOFF' cutoff (these fail the build):"
56+
jq -r --arg cutoff "$SEVERITY_CUTOFF" '
57+
["negligible", "low", "medium", "high", "critical"] as $order
58+
| ($order | index($cutoff)) as $min
59+
| .runs[].results[]
60+
| (.message.text | capture("^A (?<s>[a-z]+) vulnerability").s) as $sev
61+
| select(($order | index($sev)) >= $min)
62+
| " \(.ruleId)\n \(.message.text)"' "$SARIF"

.grype.yaml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,12 @@
44
# and cannot fix ourselves — each entry must link to the upstream tracker and
55
# be revisited (and ideally removed) when upstream rebuilds.
66
#
7+
# Anything in our own code or our own Go dependencies gets fixed, not ignored.
8+
#
79
# See docs/01-Getting-Started/5-CI-Integration.md#known-security-caveat for the
810
# user-facing context.
911

10-
ignore:
11-
# Inherited from docker:29-cli (Docker 29.4.1). The bundled
12-
# /usr/local/libexec/docker/cli-plugins/{docker-compose,docker-buildx}
13-
# are Go binaries built with go1.25.8; CVE-2026-27143 is fixed in go1.25.9.
14-
# Will clear automatically when docker-library/docker rebuilds the 29-cli
15-
# image with a newer Go toolchain. Tracked upstream:
16-
# https://github.com/docker-library/docker
17-
# Remove this entry once `grype kooldev/kool:<tag>` no longer reports it.
18-
- vulnerability: CVE-2026-27143
12+
# Currently empty: the previous entry (CVE-2026-27143, inherited from the
13+
# docker:29-cli compose/buildx plugins built with go1.25.8) cleared once
14+
# docker-library/docker rebuilt the image with a newer Go toolchain.
15+
ignore: []

docs/01-Getting-Started/5-CI-Integration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ jobs:
7575

7676
## Known security caveat
7777

78-
The `kooldev/kool` image is built `FROM docker:29-cli`, which bundles `docker-compose` and `docker-buildx` CLI plugins as pre-built Go binaries that we inherit as-is. At any given time those plugins may have been compiled with a Go toolchain that has since received CVE advisories — for example a `go1.25.8` build of the bundled compose plugin triggers `CVE-2026-27143` until the upstream [`docker-library/docker`](https://github.com/docker-library/docker) image is rebuilt with a newer Go toolchain.
78+
The `kooldev/kool` image is built `FROM docker:29-cli`, which bundles `docker-compose` and `docker-buildx` CLI plugins as pre-built Go binaries that we inherit as-is. At any given time those plugins may have been compiled with a Go toolchain that has since received CVE advisories, and a scanner will report them against our image. Such findings clear on their own once the upstream [`docker-library/docker`](https://github.com/docker-library/docker) image is rebuilt with a newer Go toolchain — there is no action we can take on our side beyond following the base image.
7979

80-
**The advisory is in the Go standard library of Docker's own plugin binaries, not in kool.** For security-sensitive pipelines, consider either:
80+
**Those advisories are in the Go standard library of Docker's own plugin binaries, not in kool.** Anything in kool's own code or dependencies we fix rather than suppress. For security-sensitive pipelines, consider either:
8181

8282
- Installing **kool** as a native binary on the runner (`curl -fsSL https://kool.dev/install | bash`) instead of using the image, which avoids the upstream plugin surface entirely,
8383
- Pinning a specific `kooldev/kool:VERSION` tag and re-scanning when you adopt a new version.

go.mod

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@ require (
1818
github.com/rhysd/go-github-selfupdate v1.2.3
1919
github.com/spf13/afero v1.15.0
2020
github.com/spf13/cobra v1.10.2
21-
golang.org/x/net v0.53.0 // indirect
2221
golang.org/x/oauth2 v0.36.0 // indirect
23-
golang.org/x/sys v0.43.0
24-
golang.org/x/term v0.42.0
25-
golang.org/x/text v0.36.0 // indirect
22+
golang.org/x/sys v0.45.0
23+
golang.org/x/term v0.43.0
24+
golang.org/x/text v0.39.0 // indirect
2625
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
2726
gopkg.in/yaml.v2 v2.4.0
2827
gopkg.in/yaml.v3 v3.0.1
@@ -51,5 +50,5 @@ require (
5150
github.com/tcnksm/go-gitconfig v0.1.2 // indirect
5251
github.com/ulikunitz/xz v0.5.15 // indirect
5352
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
54-
golang.org/x/crypto v0.50.0 // indirect
53+
golang.org/x/crypto v0.52.0 // indirect
5554
)

go.sum

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
118118
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
119119
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
120120
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
121-
golang.org/x/crypto v0.50.0 h1:zO47/JPrL6vsNkINmLoo/PH1gcxpls50DNogFvB5ZGI=
122-
golang.org/x/crypto v0.50.0/go.mod h1:3muZ7vA7PBCE6xgPX7nkzzjiUq87kRItoJQM1Yo8S+Q=
121+
golang.org/x/crypto v0.52.0 h1:RMs7fP2rXdep0CftQlK8Uf+kibLm7qkCcradZWYz988=
122+
golang.org/x/crypto v0.52.0/go.mod h1:1QgfPxDqh0T2M/elOJtp9RvuR95kVjir0e6/BvEmGbc=
123123
golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1 h1:MGwJjxBy0HJshjDNfLsYO8xppfqWlA5ZT9OhtUUhTNw=
124124
golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
125125
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
@@ -130,8 +130,8 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
130130
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
131131
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
132132
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
133-
golang.org/x/net v0.53.0 h1:d+qAbo5L0orcWAr0a9JweQpjXF19LMXJE8Ey7hwOdUA=
134-
golang.org/x/net v0.53.0/go.mod h1:JvMuJH7rrdiCfbeHoo3fCQU24Lf5JJwT9W3sJFulfgs=
133+
golang.org/x/net v0.54.0 h1:2zJIZAxAHV/OHCDTCOHAYehQzLfSXuf/5SoL/Dv6w/w=
134+
golang.org/x/net v0.54.0/go.mod h1:Sj4oj8jK6XmHpBZU/zWHw3BV3abl4Kvi+Ut7cQcY+cQ=
135135
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
136136
golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
137137
golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs=
@@ -148,20 +148,20 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc
148148
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
149149
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
150150
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
151-
golang.org/x/sys v0.43.0 h1:Rlag2XtaFTxp19wS8MXlJwTvoh8ArU6ezoyFsMyCTNI=
152-
golang.org/x/sys v0.43.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
151+
golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY=
152+
golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
153153
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
154154
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
155155
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
156-
golang.org/x/term v0.42.0 h1:UiKe+zDFmJobeJ5ggPwOshJIVt6/Ft0rcfrXZDLWAWY=
157-
golang.org/x/term v0.42.0/go.mod h1:Dq/D+snpsbazcBG5+F9Q1n2rXV8Ma+71xEjTRufARgY=
156+
golang.org/x/term v0.43.0 h1:S4RLU2sB31O/NCl+zFN9Aru9A/Cq2aqKpTZJ6B+DwT4=
157+
golang.org/x/term v0.43.0/go.mod h1:lrhlHNdQJHO+1qVYiHfFKVuVioJIheAc3fBSMFYEIsk=
158158
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
159159
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
160160
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
161161
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
162162
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
163-
golang.org/x/text v0.36.0 h1:JfKh3XmcRPqZPKevfXVpI1wXPTqbkE5f7JA92a55Yxg=
164-
golang.org/x/text v0.36.0/go.mod h1:NIdBknypM8iqVmPiuco0Dh6P5Jcdk8lJL0CUebqK164=
163+
golang.org/x/text v0.39.0 h1:UbZz4pLOvn600D6Oh6GGEI6VAmndrEBLv8/6BEXzyus=
164+
golang.org/x/text v0.39.0/go.mod h1:3UwRclnC2g0TU9x8PZiyfOajCd1zaUNHF9cvqcQZ+ZM=
165165
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
166166
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
167167
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=

kool.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ scripts:
1616
install: mv ./kool-cli /usr/local/bin/kool
1717
fmt: kool run go:linux fmt ./...
1818
lint: kool docker --volume=kool_gopath:/go golangci/golangci-lint:v2.11.4 golangci-lint run -v
19+
# Reachability-aware vulnerability scan of our own code and Go dependencies.
20+
# Complements the grype image scan in CI: grype matches Go modules at module
21+
# granularity from the binary's buildinfo and cannot tell which packages are
22+
# actually linked, while govulncheck resolves down to called symbols.
23+
govulncheck: kool run go:linux run golang.org/x/vuln/cmd/govulncheck@latest ./...
1924
test: kool run test:path ./...
2025
test:path: kool run go:linux test -race
2126
test-coverage: kool run go:linux test -v -race -coverprofile=coverage.txt -covermode=atomic ./...

0 commit comments

Comments
 (0)