From 7535a4c1cb3691a0c067c440f36b57103c8f3e9c Mon Sep 17 00:00:00 2001 From: Pedro Coutinho Date: Mon, 1 Apr 2024 08:32:33 -0700 Subject: [PATCH] Patch CVEs in go.mod of node-driver-registrar --- pod2daemon/Makefile | 4 +- .../0001-Update-go.mod-to-patch-CVEs.patch | 67 +++++++++++++++++++ 2 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 pod2daemon/patches/0001-Update-go.mod-to-patch-CVEs.patch diff --git a/pod2daemon/Makefile b/pod2daemon/Makefile index e4ffdec5e91..a8e4420b541 100644 --- a/pod2daemon/Makefile +++ b/pod2daemon/Makefile @@ -87,7 +87,7 @@ $(BINDIR)/csi-driver-%: $(SRC_FILES) $(call build_binary, csidriver/main.go, $@) UPSTREAM_REGISTRAR_PROJECT ?= kubernetes-csi/$(REGISTRAR_IMAGE) -UPSTREAM_REGISTRAR_TAG ?= v2.9.2 +UPSTREAM_REGISTRAR_TAG ?= v2.10.0 REGISTRAR_TIGERA_BUILD_CMD="cd /go/src/github.com/$(UPSTREAM_REGISTRAR_PROJECT) && \ go build -tags $(TAGS) -buildvcs=false -v -o $(BINDIR)/csi-node-driver-registrar cmd/csi-node-driver-registrar/*.go" @@ -132,6 +132,8 @@ clone-registrar-upstream: ifeq ("$(wildcard ./$(REGISTRAR_IMAGE))", "") @echo "Directory does not exist." git clone --depth 1 --branch $(UPSTREAM_REGISTRAR_TAG) --single-branch https://github.com/$(UPSTREAM_REGISTRAR_PROJECT).git + patch -d node-driver-registrar -p1 < patches/0001-Update-go.mod-to-patch-CVEs.patch + rm -rf node-driver-registrar/vendor else @echo "Upstream repo already cloned." endif diff --git a/pod2daemon/patches/0001-Update-go.mod-to-patch-CVEs.patch b/pod2daemon/patches/0001-Update-go.mod-to-patch-CVEs.patch new file mode 100644 index 00000000000..5089a164786 --- /dev/null +++ b/pod2daemon/patches/0001-Update-go.mod-to-patch-CVEs.patch @@ -0,0 +1,67 @@ +From 9d8ee79ba3d86dd127a7260ebec40aa1a27a9c15 Mon Sep 17 00:00:00 2001 +From: rene-dekker +Date: Fri, 8 Mar 2024 11:19:44 -0800 +Subject: [PATCH] Update go.mod to patch CVEs + +--- + go.mod | 4 ++-- + go.sum | 12 ++++-------- + 2 files changed, 6 insertions(+), 10 deletions(-) + +diff --git a/go.mod b/go.mod +index ee9f938..8090dbb 100644 +--- a/go.mod ++++ b/go.mod +@@ -23,7 +23,7 @@ require ( + github.com/go-openapi/jsonreference v0.20.2 // indirect + github.com/go-openapi/swag v0.22.3 // indirect + github.com/gogo/protobuf v1.3.2 // indirect +- github.com/golang/protobuf v1.5.3 // indirect ++ github.com/golang/protobuf v1.5.4 // indirect + github.com/google/gnostic-models v0.6.8 // indirect + github.com/google/gofuzz v1.2.0 // indirect + github.com/google/uuid v1.3.1 // indirect +@@ -46,7 +46,7 @@ require ( + golang.org/x/net v0.18.0 // indirect + golang.org/x/text v0.14.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect +- google.golang.org/protobuf v1.31.0 // indirect ++ google.golang.org/protobuf v1.33.0 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + k8s.io/apimachinery v0.29.0 // indirect +diff --git a/go.sum b/go.sum +index 90eb7a0..4c92234 100644 +--- a/go.sum ++++ b/go.sum +@@ -34,12 +34,10 @@ github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+ + github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= + github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= + github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +-github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +-github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +-github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= ++github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= ++github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= + github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= + github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= +-github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= + github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= + github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= + github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +@@ -146,10 +144,8 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1: + google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA= + google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= + google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +-google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +-google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +-google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +-google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= ++google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= ++google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= + gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +-- +2.34.1 +