From 5630e8a4c20ca49cdfa7882828045cbdd49a083c Mon Sep 17 00:00:00 2001 From: Ved Ratan Date: Mon, 26 Feb 2024 12:42:44 +0530 Subject: [PATCH 1/5] fixed dockerfile issue Signed-off-by: Ved Ratan --- sentryflow/Dockerfile => Dockerfile | 2 +- .../log-client/Dockerfile => Dockerfile.log-client | 12 +++++++----- .../Dockerfile => Dockerfile.mongo-client | 10 ++++++---- 3 files changed, 14 insertions(+), 10 deletions(-) rename sentryflow/Dockerfile => Dockerfile (94%) rename sentryflow-clients/log-client/Dockerfile => Dockerfile.log-client (88%) rename sentryflow-clients/mongo-client/Dockerfile => Dockerfile.mongo-client (90%) diff --git a/sentryflow/Dockerfile b/Dockerfile similarity index 94% rename from sentryflow/Dockerfile rename to Dockerfile index d6305aa..a509f41 100644 --- a/sentryflow/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ ### Builder -FROM golang:1.19-alpine3.17 as builder +FROM golang:1.22.0-alpine3.19 as builder RUN apk --no-cache update RUN apk add --no-cache git clang llvm make gcc protobuf make diff --git a/sentryflow-clients/log-client/Dockerfile b/Dockerfile.log-client similarity index 88% rename from sentryflow-clients/log-client/Dockerfile rename to Dockerfile.log-client index e0f7f5b..f0ff44f 100644 --- a/sentryflow-clients/log-client/Dockerfile +++ b/Dockerfile.log-client @@ -2,24 +2,26 @@ ### Builder -FROM golang:1.19-alpine3.17 as builder +FROM golang:1.22.0-alpine3.19 as builder RUN apk --no-cache update RUN apk add --no-cache git clang llvm make gcc protobuf +RUN go install github.com/golang/protobuf/protoc-gen-go@latest +RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest RUN mkdir /app RUN mkdir /protobuf WORKDIR /protobuf - COPY /protobuf . +RUN go mod tidy +RUN make build -WORKDIR /app +WORKDIR /app COPY /sentryflow-clients/log-client . -RUN go install github.com/golang/protobuf/protoc-gen-go@latest -RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest +RUN go mod tidy RUN go build -o log-client ### Make executable image diff --git a/sentryflow-clients/mongo-client/Dockerfile b/Dockerfile.mongo-client similarity index 90% rename from sentryflow-clients/mongo-client/Dockerfile rename to Dockerfile.mongo-client index 1a0d3ca..4d744f8 100644 --- a/sentryflow-clients/mongo-client/Dockerfile +++ b/Dockerfile.mongo-client @@ -2,24 +2,26 @@ ### Builder -FROM golang:1.19-alpine3.17 as builder +FROM golang:1.22.0-alpine3.19 as builder RUN apk --no-cache update RUN apk add --no-cache git clang llvm make gcc protobuf +RUN go install github.com/golang/protobuf/protoc-gen-go@latest +RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest RUN mkdir /app RUN mkdir /protobuf WORKDIR /protobuf - COPY /protobuf . +RUN go mod tidy +RUN make build WORKDIR /app COPY /sentryflow-clients/mongo-client . -RUN go install github.com/golang/protobuf/protoc-gen-go@latest -RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest + RUN go build -o mongo-client ### Make executable image From d59bb5e89c0ef38d7b2d92a6f2d4997ab9da6fb9 Mon Sep 17 00:00:00 2001 From: Ved Ratan Date: Thu, 7 Mar 2024 23:08:18 +0530 Subject: [PATCH 2/5] updated makefile Signed-off-by: Ved Ratan --- .gitignore | 2 ++ sentryflow-clients/log-client/Makefile | 2 +- sentryflow-clients/mongo-client/Makefile | 2 +- sentryflow/Makefile | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index e43b0f9..df16c5c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ .DS_Store +go.work +go.work.sum \ No newline at end of file diff --git a/sentryflow-clients/log-client/Makefile b/sentryflow-clients/log-client/Makefile index 7b8bfdb..d941259 100644 --- a/sentryflow-clients/log-client/Makefile +++ b/sentryflow-clients/log-client/Makefile @@ -6,7 +6,7 @@ TAG = v0.1 .PHONY: build build: - docker build -t $(IMAGE_NAME):$(TAG) -f ./Dockerfile ../../ + docker build -t $(IMAGE_NAME):$(TAG) -f ../../Dockerfile.log-client ../../ .PHONY: clean diff --git a/sentryflow-clients/mongo-client/Makefile b/sentryflow-clients/mongo-client/Makefile index c1cba29..03d92a3 100644 --- a/sentryflow-clients/mongo-client/Makefile +++ b/sentryflow-clients/mongo-client/Makefile @@ -6,7 +6,7 @@ TAG = v0.1 .PHONY: build build: - docker build -t $(IMAGE_NAME):$(TAG) -f ./Dockerfile ../../ + docker build -t $(IMAGE_NAME):$(TAG) -f ../../Dockerfile.mongo-client ../../ .PHONY: clean diff --git a/sentryflow/Makefile b/sentryflow/Makefile index 738596d..3831ca6 100644 --- a/sentryflow/Makefile +++ b/sentryflow/Makefile @@ -11,7 +11,7 @@ build: .PHONY: image image: - docker build -t $(IMAGE_NAME):$(TAG) -f ./Dockerfile ../ + docker build -t $(IMAGE_NAME):$(TAG) -f ../Dockerfile ../ .PHONY: clean clean: From 99fca5c63912fd68338383b3380df9779da244f4 Mon Sep 17 00:00:00 2001 From: Ved Ratan Date: Thu, 7 Mar 2024 23:22:06 +0530 Subject: [PATCH 3/5] CI fix Signed-off-by: Ved Ratan --- sentryflow-clients/log-client/go.mod | 2 +- sentryflow-clients/mongo-client/go.mod | 2 +- sentryflow/go.mod | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sentryflow-clients/log-client/go.mod b/sentryflow-clients/log-client/go.mod index 3b9c87b..72c4d15 100644 --- a/sentryflow-clients/log-client/go.mod +++ b/sentryflow-clients/log-client/go.mod @@ -1,6 +1,6 @@ module log-client -go 1.19 +go 1.21.8 replace sentryflow/protobuf => ../../protobuf diff --git a/sentryflow-clients/mongo-client/go.mod b/sentryflow-clients/mongo-client/go.mod index b639d95..dcd14e1 100644 --- a/sentryflow-clients/mongo-client/go.mod +++ b/sentryflow-clients/mongo-client/go.mod @@ -1,6 +1,6 @@ module mongo-client -go 1.19 +go 1.21.8 replace sentryflow/protobuf => ../../protobuf diff --git a/sentryflow/go.mod b/sentryflow/go.mod index d863eaa..b937a4b 100644 --- a/sentryflow/go.mod +++ b/sentryflow/go.mod @@ -1,8 +1,8 @@ module github.com/5GSEC/sentryflow -go 1.21 +go 1.21.8 -toolchain go1.22.0 +toolchain go1.21 replace github.com/5GSEC/sentryflow/protobuf => ../protobuf From a5a5d2cfd8e432aaa727ac6aad678fc619e9fb7e Mon Sep 17 00:00:00 2001 From: Ved Ratan Date: Fri, 8 Mar 2024 10:47:13 +0530 Subject: [PATCH 4/5] CI fix Signed-off-by: Ved Ratan --- sentryflow-clients/log-client/go.mod | 2 +- sentryflow-clients/mongo-client/go.mod | 2 +- sentryflow/go.mod | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/sentryflow-clients/log-client/go.mod b/sentryflow-clients/log-client/go.mod index 72c4d15..3b9c87b 100644 --- a/sentryflow-clients/log-client/go.mod +++ b/sentryflow-clients/log-client/go.mod @@ -1,6 +1,6 @@ module log-client -go 1.21.8 +go 1.19 replace sentryflow/protobuf => ../../protobuf diff --git a/sentryflow-clients/mongo-client/go.mod b/sentryflow-clients/mongo-client/go.mod index dcd14e1..b639d95 100644 --- a/sentryflow-clients/mongo-client/go.mod +++ b/sentryflow-clients/mongo-client/go.mod @@ -1,6 +1,6 @@ module mongo-client -go 1.21.8 +go 1.19 replace sentryflow/protobuf => ../../protobuf diff --git a/sentryflow/go.mod b/sentryflow/go.mod index b937a4b..45a2f35 100644 --- a/sentryflow/go.mod +++ b/sentryflow/go.mod @@ -1,8 +1,6 @@ module github.com/5GSEC/sentryflow -go 1.21.8 - -toolchain go1.21 +go 1.21 replace github.com/5GSEC/sentryflow/protobuf => ../protobuf From fd332caf468b03592b501fdade0f0a630dd08d04 Mon Sep 17 00:00:00 2001 From: Ved Ratan Date: Fri, 8 Mar 2024 11:48:36 +0530 Subject: [PATCH 5/5] CI fix Signed-off-by: Ved Ratan --- protobuf/go.mod | 10 +++++----- protobuf/go.sum | 22 +++++++++++----------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/protobuf/go.mod b/protobuf/go.mod index 6d856bd..986067f 100644 --- a/protobuf/go.mod +++ b/protobuf/go.mod @@ -3,14 +3,14 @@ module github.com/5GSEC/sentryflow/protobuf go 1.19 require ( - google.golang.org/grpc v1.61.1 - google.golang.org/protobuf v1.32.0 + google.golang.org/grpc v1.62.1 + google.golang.org/protobuf v1.33.0 ) require ( github.com/golang/protobuf v1.5.3 // indirect - golang.org/x/net v0.18.0 // indirect - golang.org/x/sys v0.14.0 // indirect + golang.org/x/net v0.20.0 // indirect + golang.org/x/sys v0.16.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/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect ) diff --git a/protobuf/go.sum b/protobuf/go.sum index 3ca0166..0173cce 100644 --- a/protobuf/go.sum +++ b/protobuf/go.sum @@ -2,19 +2,19 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS 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/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= -golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= -golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= -golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= +golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 h1:wpZ8pe2x1Q3f2KyT5f8oP/fa9rHAKgFPr/HZdNuS+PQ= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA= -google.golang.org/grpc v1.61.1 h1:kLAiWrZs7YeDM6MumDe7m3y4aM6wacLzM1Y/wiLP9XY= -google.golang.org/grpc v1.61.1/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= +google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 h1:KAeGQVN3M9nD0/bQXnr/ClcEMJ968gUXJQ9pwfSynuQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s= +google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= +google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= 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.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= -google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=