Skip to content

Commit bbaff03

Browse files
authored
fix(go-dependencies): CVEs (#6867)
* fix: operator CVEs * CVE fixes * fix tests * fix setup env * test against all supported k8s versions * fix executor CVEs * fix linter * fix downgrade of controller-gen * lint
1 parent 8f2380a commit bbaff03

26 files changed

+972
-636
lines changed

.github/workflows/images.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
required: false
1313

1414
env:
15-
GOLANG_VERSION: 1.20.9
15+
GOLANG_VERSION: 1.24.7
1616

1717
jobs:
1818
operator:
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: V1 Security code Tests
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
security-python:
12+
runs-on: ubuntu-latest
13+
container: snyk/snyk:python-3.8
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: security-python
17+
env:
18+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
19+
run: |
20+
pip install -e python/.
21+
snyk test --file=python/setup.py --fail-on=upgradable --severity-threshold=high
22+
23+
security-operator:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v2
27+
- name: security-operator
28+
# NOTE: We use the Snyk action (instead of the Snyk base image) so that
29+
# it respects the Go version we use.
30+
uses: snyk/actions/golang@master
31+
with:
32+
args: --fail-on=upgradable
33+
--severity-threshold=high
34+
--file=operator/go.mod
35+
env:
36+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
37+
38+
security-executor:
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v2
42+
- uses: snyk/actions/setup@master
43+
- uses: actions/setup-go@v3
44+
with:
45+
go-version: '^1.24.7'
46+
- name: Set up executor's environment
47+
# NOTE: The executor needs a couple extra steps before we can build it,
48+
# like copying the operator's package into the executor's folder so that
49+
# it's accessible.
50+
run: make -C executor/ executor
51+
- name: security-executor
52+
run: snyk test \
53+
--fail-on=upgradable
54+
--severity-threshold=high
55+
--file=executor/go.mod
56+
env:
57+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

.github/workflows/security_tests.yml renamed to .github/workflows/security_image_tests_v1.yml

Lines changed: 1 addition & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,12 @@
1-
name: V1 Security Tests
1+
name: V1 Security docker image tests
22

33
on:
44
push:
55
branches: [ master ]
66
workflow_dispatch:
77

88
jobs:
9-
security-python:
10-
11-
runs-on: ubuntu-latest
12-
container: snyk/snyk:python-3.8
13-
14-
steps:
15-
- uses: actions/checkout@v2
16-
- name: security-python
17-
env:
18-
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
19-
run: |
20-
pip install -e python/.
21-
snyk test --file=python/setup.py --fail-on=upgradable --severity-threshold=high
22-
23-
security-operator:
24-
25-
runs-on: ubuntu-latest
26-
27-
steps:
28-
- uses: actions/checkout@v2
29-
- name: security-operator
30-
# NOTE: We use the Snyk action (instead of the Snyk base image) so that
31-
# it respects the Go version we use.
32-
uses: snyk/actions/golang@master
33-
with:
34-
args: --fail-on=upgradable
35-
--severity-threshold=high
36-
--file=operator/go.mod
37-
env:
38-
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
39-
40-
security-executor:
41-
42-
runs-on: ubuntu-latest
43-
44-
steps:
45-
- uses: actions/checkout@v2
46-
- uses: snyk/actions/setup@master
47-
- uses: actions/setup-go@v3
48-
with:
49-
go-version: '^1.17.0'
50-
- name: Set up executor's environmnet
51-
# NOTE: The executor needs a couple extra steps before we can build it,
52-
# like copying the operator's package into the executor's folder so that
53-
# it's accessible.
54-
run: make -C executor/ executor
55-
- name: security-executor
56-
run: snyk test \
57-
--fail-on=upgradable
58-
--severity-threshold=high
59-
--file=executor/go.mod
60-
env:
61-
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
62-
639
security-image-executor:
64-
6510
runs-on: ubuntu-latest
6611
steps:
6712
- uses: actions/checkout@v2
@@ -74,7 +19,6 @@ jobs:
7419
args: --fail-on=upgradable --app-vulns --severity-threshold=high --file=executor/Dockerfile.executor
7520

7621
security-image-operator:
77-
7822
runs-on: ubuntu-latest
7923
steps:
8024
- uses: actions/checkout@v2
@@ -87,7 +31,6 @@ jobs:
8731
args: --fail-on=upgradable --app-vulns --severity-threshold=high --file=operator/Dockerfile
8832

8933
security-image-python-base:
90-
9134
runs-on: ubuntu-latest
9235
steps:
9336
- uses: actions/checkout@v2
@@ -100,7 +43,6 @@ jobs:
10043
args: --fail-on=upgradable --app-vulns --severity-threshold=high --file=wrappers/s2i/python/Dockerfile
10144

10245
security-image-python-sklearn:
103-
10446
runs-on: ubuntu-latest
10547
steps:
10648
- name: security-image-python-sklearn
@@ -112,7 +54,6 @@ jobs:
11254
args: --fail-on=upgradable --app-vulns --severity-threshold=high
11355

11456
security-image-python-mlflow:
115-
11657
runs-on: ubuntu-latest
11758
steps:
11859
- name: security-image-python-mlflow
@@ -124,7 +65,6 @@ jobs:
12465
args: --fail-on=upgradable --app-vulns --severity-threshold=high
12566

12667
security-image-python-xgboost:
127-
12868
runs-on: ubuntu-latest
12969
steps:
13070
- name: security-image-python-xgboost
@@ -136,7 +76,6 @@ jobs:
13676
args: --fail-on=upgradable --app-vulns --severity-threshold=high
13777

13878
security-image-alibi-explain:
139-
14079
runs-on: ubuntu-latest
14180
steps:
14281
- uses: actions/checkout@v2
@@ -149,7 +88,6 @@ jobs:
14988
args: --fail-on=upgradable --app-vulns --severity-threshold=high --file=components/alibi-explain-server/Dockerfile
15089

15190
security-image-alibi-detect:
152-
15391
runs-on: ubuntu-latest
15492
steps:
15593
- uses: actions/checkout@v2
@@ -162,7 +100,6 @@ jobs:
162100
args: --fail-on=upgradable --app-vulns --severity-threshold=high --file=components/alibi-detect-server/Dockerfile
163101

164102
security-image-initializer-rclone:
165-
166103
runs-on: ubuntu-latest
167104
steps:
168105
- uses: actions/checkout@v2

.github/workflows/test-executor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
workflow_dispatch:
1111

1212
env:
13-
GOLANG_VERSION: 1.20.9
13+
GOLANG_VERSION: 1.24.7
1414

1515
jobs:
1616
executor-lint:

.github/workflows/test-operator.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
workflow_dispatch:
1111

1212
env:
13-
GOLANG_VERSION: 1.20.9
13+
GOLANG_VERSION: 1.24.7
1414

1515
jobs:
1616
operator-lint:

executor/Dockerfile.executor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build the manager binary
2-
FROM golang:1.20.9 as builder
2+
FROM golang:1.24.7 as builder
33

44
WORKDIR /workspace
55
# Copy the Go Modules manifests

executor/Makefile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ DOCKER_REGISTRY ?= seldonio
77
IMAGE_NAME_BASE=seldon-core-executor
88
IMG ?= ${DOCKER_REGISTRY}/${IMAGE_NAME_BASE}:${VERSION}
99

10-
EXECUTOR_FOLDERS ?= ./api/... ./predictor/... ./k8s/... ./logger/...
11-
1210
KIND_NAME ?= kind
1311

1412
# # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
@@ -20,11 +18,11 @@ KIND_NAME ?= kind
2018

2119
# Run go fmt against code
2220
fmt:
23-
go fmt ${EXECUTOR_FOLDERS}
21+
go fmt ./...
2422

2523
# Run go vet against code
2624
vet:
27-
go vet ${EXECUTOR_FOLDERS}
25+
go vet ./...
2826

2927

3028
# Build manager binary
@@ -82,7 +80,7 @@ add_protos:
8280

8381
# Run tests
8482
test: copy_operator fmt vet
85-
go test ${EXECUTOR_FOLDERS} -coverprofile cover.out
83+
go test ./... -coverprofile cover.out
8684

8785
copy_openapi_resources:
8886
mkdir -p api/rest/openapi

executor/go.mod

Lines changed: 40 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
module github.com/seldonio/seldon-core/executor
22

3-
go 1.20
3+
go 1.24.7
44

55
require (
66
github.com/cloudevents/sdk-go v1.2.0
77
github.com/confluentinc/confluent-kafka-go v1.8.2
88
github.com/ghodss/yaml v1.0.0
9-
github.com/go-logr/logr v1.2.4
10-
github.com/golang/protobuf v1.5.3
11-
github.com/google/uuid v1.3.0
9+
github.com/go-logr/logr v1.4.2
10+
github.com/golang/protobuf v1.5.4
11+
github.com/google/uuid v1.6.0
1212
github.com/gorilla/mux v1.8.0
1313
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
14-
github.com/onsi/gomega v1.27.10
14+
github.com/onsi/gomega v1.36.2
1515
github.com/opentracing/opentracing-go v1.2.0
1616
github.com/pkg/errors v0.9.1
1717
github.com/prometheus/client_golang v1.16.0
@@ -20,30 +20,30 @@ require (
2020
github.com/tensorflow/tensorflow/tensorflow/go/core v0.0.0-00010101000000-000000000000
2121
github.com/uber/jaeger-client-go v2.25.0+incompatible
2222
go.uber.org/automaxprocs v1.4.0
23-
go.uber.org/zap v1.25.0
23+
go.uber.org/zap v1.27.0
2424
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2
25-
google.golang.org/grpc v1.54.0
25+
google.golang.org/grpc v1.56.3
2626
gotest.tools v2.2.0+incompatible
2727
k8s.io/api v0.28.4
2828
sigs.k8s.io/controller-runtime v0.16.3
2929
)
3030

3131
require (
3232
github.com/beorn7/perks v1.0.1 // indirect
33-
github.com/cespare/xxhash/v2 v2.2.0 // indirect
33+
github.com/cespare/xxhash/v2 v2.3.0 // indirect
3434
github.com/codahale/hdrhistogram v0.0.0-00010101000000-000000000000 // indirect
3535
github.com/davecgh/go-spew v1.1.1 // indirect
3636
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
3737
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
3838
github.com/fsnotify/fsnotify v1.6.0 // indirect
39-
github.com/go-logr/zapr v1.2.4 // indirect
40-
github.com/go-openapi/jsonpointer v0.19.6 // indirect
39+
github.com/go-logr/zapr v1.3.0 // indirect
40+
github.com/go-openapi/jsonpointer v0.21.0 // indirect
4141
github.com/go-openapi/jsonreference v0.20.2 // indirect
42-
github.com/go-openapi/swag v0.22.3 // indirect
42+
github.com/go-openapi/swag v0.23.0 // indirect
4343
github.com/gogo/protobuf v1.3.2 // indirect
4444
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
45-
github.com/google/gnostic-models v0.6.8 // indirect
46-
github.com/google/go-cmp v0.5.9 // indirect
45+
github.com/google/gnostic-models v0.7.0 // indirect
46+
github.com/google/go-cmp v0.7.0 // indirect
4747
github.com/google/gofuzz v1.2.0 // indirect
4848
github.com/imdario/mergo v0.3.12 // indirect
4949
github.com/josharian/intern v1.0.1-0.20211109044230-42b52b674af5 // indirect
@@ -53,48 +53,51 @@ require (
5353
github.com/mailru/easyjson v0.7.7 // indirect
5454
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
5555
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
56-
github.com/modern-go/reflect2 v1.0.2 // indirect
56+
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
5757
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
5858
github.com/prometheus/client_model v0.4.0 // indirect
5959
github.com/prometheus/procfs v0.10.1 // indirect
60-
github.com/spf13/pflag v1.0.5 // indirect
60+
github.com/spf13/pflag v1.0.6 // indirect
6161
github.com/uber/jaeger-lib v2.2.0+incompatible // indirect
6262
go.opencensus.io v0.23.0 // indirect
6363
go.uber.org/atomic v1.10.0 // indirect
6464
go.uber.org/multierr v1.11.0 // indirect
65+
go.yaml.in/yaml/v2 v2.4.2 // indirect
66+
go.yaml.in/yaml/v3 v3.0.4 // indirect
6567
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
66-
golang.org/x/net v0.17.0 // indirect
67-
golang.org/x/oauth2 v0.8.0 // indirect
68-
golang.org/x/sys v0.13.0 // indirect
69-
golang.org/x/term v0.13.0 // indirect
70-
golang.org/x/text v0.13.0 // indirect
71-
golang.org/x/time v0.3.0 // indirect
68+
golang.org/x/net v0.44.0 // indirect
69+
golang.org/x/oauth2 v0.25.0 // indirect
70+
golang.org/x/sys v0.36.0 // indirect
71+
golang.org/x/term v0.35.0 // indirect
72+
golang.org/x/text v0.29.0 // indirect
73+
golang.org/x/time v0.9.0 // indirect
7274
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
73-
google.golang.org/appengine v1.6.7 // indirect
7475
google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect
75-
google.golang.org/protobuf v1.31.0 // indirect
76+
google.golang.org/protobuf v1.36.5 // indirect
7677
gopkg.in/inf.v0 v0.9.1 // indirect
7778
gopkg.in/yaml.v2 v2.4.0 // indirect
7879
gopkg.in/yaml.v3 v3.0.1 // indirect
7980
k8s.io/apiextensions-apiserver v0.28.3 // indirect
80-
k8s.io/apimachinery v0.28.4 // indirect
81+
k8s.io/apimachinery v0.34.1 // indirect
8182
k8s.io/client-go v12.0.0+incompatible // indirect
8283
k8s.io/component-base v0.28.3 // indirect
83-
k8s.io/klog/v2 v2.100.1 // indirect
84-
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
85-
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
84+
k8s.io/klog/v2 v2.130.1 // indirect
85+
k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b // indirect
86+
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 // indirect
8687
knative.dev/pkg v0.0.0-20220502225657-4fced0164c9a // indirect
87-
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
88-
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
89-
sigs.k8s.io/yaml v1.3.0 // indirect
88+
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
89+
sigs.k8s.io/randfill v1.0.0 // indirect
90+
sigs.k8s.io/structured-merge-diff/v4 v4.6.0 // indirect
91+
sigs.k8s.io/yaml v1.6.0 // indirect
9092
)
9193

92-
replace github.com/tensorflow/tensorflow/tensorflow/go/core => ./proto/tensorflow/core
93-
94-
replace github.com/seldonio/seldon-core/operator => ./_operator
95-
96-
replace k8s.io/client-go => k8s.io/client-go v0.28.4
97-
98-
replace github.com/codahale/hdrhistogram => github.com/HdrHistogram/hdrhistogram-go v1.1.2
94+
replace (
95+
github.com/codahale/hdrhistogram => github.com/HdrHistogram/hdrhistogram-go v1.1.2
96+
github.com/seldonio/seldon-core/operator => ./_operator
97+
github.com/tensorflow/tensorflow/tensorflow/go/core => ./proto/tensorflow/core
98+
k8s.io/apimachinery => k8s.io/apimachinery v0.29.0-alpha.3
99+
k8s.io/client-go => k8s.io/client-go v0.28.4
100+
k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20250628140032-d90c4fd18f59
101+
)
99102

100103
exclude github.com/go-logr/logr v1.0.0

0 commit comments

Comments
 (0)