From 29ad9b65b56535b445b53ff7a78f094db71dbafa Mon Sep 17 00:00:00 2001 From: Jose Donizetti Date: Mon, 17 Jul 2023 07:26:03 +0000 Subject: [PATCH] feature: add list events GRPC api --- Makefile | 19 ++ cmd/grpc-client/main.go | 67 ++++++ cmd/tracee-ebpf/main.go | 2 +- cmd/tracee-rules/main.go | 6 +- cmd/tracee/cmd/root.go | 14 +- go.mod | 4 +- go.sum | 6 +- pkg/cmd/cobra/cobra.go | 11 +- pkg/cmd/flags/grpc.go | 26 +++ pkg/cmd/flags/server/server.go | 19 +- pkg/cmd/tracee.go | 27 ++- pkg/cmd/urfave/urfave.go | 6 +- pkg/server/grpc/server.go | 80 ++++++++ pkg/server/grpc/server_test.go | 57 ++++++ pkg/server/{ => http}/server.go | 2 +- pkg/server/{ => http}/server_test.go | 2 +- types/api/v1beta1/tracee.pb.go | 294 +++++++++++++++++++++++++++ types/api/v1beta1/tracee.proto | 24 +++ types/api/v1beta1/tracee_grpc.pb.go | 105 ++++++++++ types/go.mod | 11 +- types/go.sum | 21 +- 21 files changed, 762 insertions(+), 41 deletions(-) create mode 100644 cmd/grpc-client/main.go create mode 100644 pkg/cmd/flags/grpc.go create mode 100644 pkg/server/grpc/server.go create mode 100644 pkg/server/grpc/server_test.go rename pkg/server/{ => http}/server.go (99%) rename pkg/server/{ => http}/server_test.go (98%) create mode 100644 types/api/v1beta1/tracee.pb.go create mode 100644 types/api/v1beta1/tracee.proto create mode 100644 types/api/v1beta1/tracee_grpc.pb.go diff --git a/Makefile b/Makefile index 12ea1c5f0199..a43cc849b81f 100644 --- a/Makefile +++ b/Makefile @@ -36,6 +36,7 @@ CMD_STATICCHECK ?= staticcheck CMD_STRIP ?= llvm-strip CMD_TOUCH ?= touch CMD_TR ?= tr +CMD_PROTOC ?= protoc .check_%: # @@ -165,6 +166,7 @@ env: @echo "CMD_STRIP $(CMD_STRIP)" @echo "CMD_TOUCH $(CMD_TOUCH)" @echo "CMD_TR $(CMD_TR)" + @echo "CMD_PROTOC $(CMD_PROTOC)" @echo --------------------------------------- @echo "LIB_ELF $(LIB_ELF)" @echo "LIB_ZLIB $(LIB_ZLIB)" @@ -227,6 +229,8 @@ env: @echo "E2E_INST_DIR $(E2E_INST_DIR)" @echo "E2E_INST_SRC $(E2E_INST_SRC)" @echo --------------------------------------- + @echo "TRACE_PROTO $(TRACEE_PROTO)" + @echo --------------------------------------- # # usage @@ -393,6 +397,8 @@ GO_ENV_EBPF += GOARCH=$(GO_ARCH) GO_ENV_EBPF += CGO_CFLAGS=$(CUSTOM_CGO_CFLAGS) GO_ENV_EBPF += CGO_LDFLAGS=$(CUSTOM_CGO_LDFLAGS) +TRACEE_PROTO = ./types/api/v1beta1/tracee.proto + # # btfhub (expensive: only run if ebpf obj changed) # @@ -902,3 +908,16 @@ clean: $(CMD_RM) -f .*.md5 $(CMD_RM) -f .check* $(CMD_RM) -f .*-pkgs* + +# +# tracee.proto +# + +.PHONY: protoc +protoc: +# + $(CMD_PROTOC) \ + --go_out=. \ + --go_opt=paths=source_relative \ + --go-grpc_out=. \ + --go-grpc_opt=paths=source_relative $(TRACEE_PROTO) diff --git a/cmd/grpc-client/main.go b/cmd/grpc-client/main.go new file mode 100644 index 000000000000..8212ae2c61c4 --- /dev/null +++ b/cmd/grpc-client/main.go @@ -0,0 +1,67 @@ +package main + +import ( + "encoding/json" + "fmt" + "log" + + v1beta1 "github.com/aquasecurity/tracee/types/api/v1beta1" +) + +type CloudContext struct { + Provider string +} + +type Context_Cloud struct { + Cloud *CloudContext + v1beta1.IContextContext `json:"-"` +} + +func main() { + e := v1beta1.Event{ + Id: 123, + Name: "ptrace", + } + + e.SetProcessContext(&v1beta1.ProcessContext{ + Binary: "/bin/bash", + Pid: 10, + NamespacePid: 1, + UserId: 1, + UserName: "root", + }) + // process := e.GetProcessContext() + + e.SetContainerContext(&v1beta1.ContainerContext{ + Id: "lala", + Name: "xx", + Started: true, + }) + // container := e.GetContainerContext() + + e.SetKubernetesContext(&v1beta1.KubernetesContext{ + Name: "pod-name", + Namespace: "prod", + Uid: "uid", + Sandbox: "sandbox", + }) + // kubernetes := e.GetKubernetesContext() + + // fmt.Printf("process: %+v\n", process) + // fmt.Printf("container: %+v\n", container) + // fmt.Printf("kubernetes: %+v\n", kubernetes) + + cloud := CloudContext{Provider: "gcloud"} + // fmt.Printf("cloud: %+v\n\n", cloud) + // fmt.Printf("before len: %d\n", len(e.Context)) + e.Context = append(e.Context, &v1beta1.Context{Context: &Context_Cloud{Cloud: &cloud}}) + // fmt.Printf("after len: %d\n", len(e.Context)) + + // fmt.Printf("event: %+v\n", e) + + b, err := json.Marshal(e) + if err != nil { + log.Fatal(err) + } + fmt.Println(string(b)) +} diff --git a/cmd/tracee-ebpf/main.go b/cmd/tracee-ebpf/main.go index 7b65f0548034..c59ba2a3e783 100644 --- a/cmd/tracee-ebpf/main.go +++ b/cmd/tracee-ebpf/main.go @@ -133,7 +133,7 @@ func main() { Value: false, }, &cli.StringFlag{ - Name: server.ListenEndpointFlag, + Name: server.HTTPListenEndpointFlag, Usage: "listening address of the metrics endpoint server", Value: ":3366", }, diff --git a/cmd/tracee-rules/main.go b/cmd/tracee-rules/main.go index c951acda902b..cd3e0d3fd03d 100644 --- a/cmd/tracee-rules/main.go +++ b/cmd/tracee-rules/main.go @@ -149,8 +149,8 @@ func main() { return fmt.Errorf("constructing engine: %w", err) } - httpServer, err := server.PrepareServer( - c.String(server.ListenEndpointFlag), + httpServer, err := server.PrepareHTTPServer( + c.String(server.HTTPListenEndpointFlag), c.Bool(server.MetricsEndpointFlag), c.Bool(server.HealthzEndpointFlag), c.Bool(server.PProfEndpointFlag), @@ -252,7 +252,7 @@ func main() { Value: false, }, &cli.StringFlag{ - Name: server.ListenEndpointFlag, + Name: server.HTTPListenEndpointFlag, Usage: "listening address of the metrics endpoint server", Value: ":4466", }, diff --git a/cmd/tracee/cmd/root.go b/cmd/tracee/cmd/root.go index e300b4aee038..f43bc1770616 100644 --- a/cmd/tracee/cmd/root.go +++ b/cmd/tracee/cmd/root.go @@ -256,11 +256,21 @@ func initCmd() error { } rootCmd.Flags().String( - server.ListenEndpointFlag, + server.HTTPListenEndpointFlag, ":3366", "\t\t\t\tListening address of the metrics endpoint server", ) - err = viper.BindPFlag(server.ListenEndpointFlag, rootCmd.Flags().Lookup(server.ListenEndpointFlag)) + err = viper.BindPFlag(server.HTTPListenEndpointFlag, rootCmd.Flags().Lookup(server.HTTPListenEndpointFlag)) + if err != nil { + return errfmt.WrapError(err) + } + + rootCmd.Flags().String( + server.GRPCListenEndpointFlag, + "", // disabled by default + "Listening address of the grpc server [protocol:addr] eg: tcp:4466, unix:/tmp/tracee.sock (default: disabled)", + ) + err = viper.BindPFlag(server.GRPCListenEndpointFlag, rootCmd.Flags().Lookup(server.GRPCListenEndpointFlag)) if err != nil { return errfmt.WrapError(err) } diff --git a/go.mod b/go.mod index 7d5646c510bd..cb37db1bb310 100644 --- a/go.mod +++ b/go.mod @@ -28,7 +28,7 @@ require ( go.uber.org/zap v1.24.0 golang.org/x/sys v0.8.0 google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 - google.golang.org/grpc v1.55.0 + google.golang.org/grpc v1.56.2 google.golang.org/protobuf v1.30.0 gopkg.in/yaml.v2 v2.4.0 gotest.tools v2.2.0+incompatible @@ -172,3 +172,5 @@ require ( ) replace github.com/kubernetes/cri-api => k8s.io/cri-api v0.23.5-rc.0 + +replace github.com/aquasecurity/tracee/types v0.0.0-20230602152109-e48d0a548fbf => ./types diff --git a/go.sum b/go.sum index ab713b927b31..c0e2c23dd5a4 100644 --- a/go.sum +++ b/go.sum @@ -69,8 +69,6 @@ github.com/aquasecurity/libbpfgo v0.4.8-libbpf-1.2.0.0.20230509162948-80f41e18e6 github.com/aquasecurity/libbpfgo v0.4.8-libbpf-1.2.0.0.20230509162948-80f41e18e690/go.mod h1:UD3Mfr+JZ/ASK2VMucI/zAdEhb35LtvYXvAUdrdqE9s= github.com/aquasecurity/libbpfgo/helpers v0.4.6-0.20230321190037-f591a2c5734f h1:l127H3NqJBmw+XMt+haBOeZIrBppuw7TJz26cWMI9kY= github.com/aquasecurity/libbpfgo/helpers v0.4.6-0.20230321190037-f591a2c5734f/go.mod h1:j/TQLmsZpOIdF3CnJODzYngG4yu1YoDCoRMELxkQSSA= -github.com/aquasecurity/tracee/types v0.0.0-20230602152109-e48d0a548fbf h1:bSWqjqjFPGyn+thqof/rph4A5jSqd2d7xWJK5MGMb0I= -github.com/aquasecurity/tracee/types v0.0.0-20230602152109-e48d0a548fbf/go.mod h1:kHvgUMXGq5QEqSLPgu4RwGSJEoCuMQJnEkGk8OAcSUc= github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q= github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= @@ -817,8 +815,8 @@ google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA5 google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= -google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= +google.golang.org/grpc v1.56.2 h1:fVRFRnXvU+x6C4IlHZewvJOVHoOv1TUuQyoRsYnB4bI= +google.golang.org/grpc v1.56.2/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/pkg/cmd/cobra/cobra.go b/pkg/cmd/cobra/cobra.go index 3becbe6a0c8c..2de512d54bd1 100644 --- a/pkg/cmd/cobra/cobra.go +++ b/pkg/cmd/cobra/cobra.go @@ -216,19 +216,24 @@ func GetTraceeRunner(c *cobra.Command, version string) (cmd.Runner, error) { // Prepare the server - httpServer, err := server.PrepareServer( - viper.GetString(server.ListenEndpointFlag), + httpServer, err := server.PrepareHTTPServer( + viper.GetString(server.HTTPListenEndpointFlag), viper.GetBool(server.MetricsEndpointFlag), viper.GetBool(server.HealthzEndpointFlag), viper.GetBool(server.PProfEndpointFlag), viper.GetBool(server.PyroscopeAgentFlag), ) + if err != nil { + return runner, err + } + grpcServer, err := flags.PrepareGRPCServer(viper.GetString(server.GRPCListenEndpointFlag)) if err != nil { return runner, err } - runner.Server = httpServer + runner.HTTPServer = httpServer + runner.GRPCServer = grpcServer runner.TraceeConfig = cfg runner.Printer = p diff --git a/pkg/cmd/flags/grpc.go b/pkg/cmd/flags/grpc.go new file mode 100644 index 000000000000..8f4785d5262e --- /dev/null +++ b/pkg/cmd/flags/grpc.go @@ -0,0 +1,26 @@ +package flags + +import ( + "strings" + + "github.com/aquasecurity/tracee/pkg/errfmt" + "github.com/aquasecurity/tracee/pkg/server/grpc" +) + +func PrepareGRPCServer(listenAddr string) (*grpc.Server, error) { + if len(listenAddr) == 0 { + return nil, nil + } + + addr := strings.SplitN(listenAddr, ":", 2) + + if addr[0] != "tcp" && addr[0] != "unix" { + return nil, errfmt.Errorf("grpc supported protocols are tcp or unix. eg: tcp:4466, unix:/tmp/tracee.sock") + } + + if len(addr[1]) == 0 { + return nil, errfmt.Errorf("grpc addr cannot be empty") + } + + return grpc.New(addr[0], addr[1]) +} diff --git a/pkg/cmd/flags/server/server.go b/pkg/cmd/flags/server/server.go index 31597e4ffff0..7b5400fe3898 100644 --- a/pkg/cmd/flags/server/server.go +++ b/pkg/cmd/flags/server/server.go @@ -3,15 +3,16 @@ package server import ( "github.com/aquasecurity/tracee/pkg/errfmt" "github.com/aquasecurity/tracee/pkg/logger" - "github.com/aquasecurity/tracee/pkg/server" + "github.com/aquasecurity/tracee/pkg/server/http" ) const ( - MetricsEndpointFlag = "metrics" - HealthzEndpointFlag = "healthz" - PProfEndpointFlag = "pprof" - ListenEndpointFlag = "listen-addr" - PyroscopeAgentFlag = "pyroscope" + MetricsEndpointFlag = "metrics" + HealthzEndpointFlag = "healthz" + PProfEndpointFlag = "pprof" + HTTPListenEndpointFlag = "http-listen-addr" + GRPCListenEndpointFlag = "grpc-listen-addr" + PyroscopeAgentFlag = "pyroscope" ) // TODO: this should be extract to be under 'pkg/cmd/flags' once we remove the binary tracee-rules. @@ -20,13 +21,13 @@ const ( // 'pkf/cmd/flags' directly libbpfgo becomes a dependency and we need to compile it with // tracee-rules. -func PrepareServer(listenAddr string, metrics, healthz, pprof, pyro bool) (*server.Server, error) { +func PrepareHTTPServer(listenAddr string, metrics, healthz, pprof, pyro bool) (*http.Server, error) { if len(listenAddr) == 0 { - return nil, errfmt.Errorf("listen address cannot be empty") + return nil, errfmt.Errorf("http listen address cannot be empty") } if metrics || healthz || pprof { - httpServer := server.New(listenAddr) + httpServer := http.New(listenAddr) if metrics { logger.Debugw("Enabling metrics endpoint") diff --git a/pkg/cmd/tracee.go b/pkg/cmd/tracee.go index 04bbd73fec7f..8eefaf1913a2 100644 --- a/pkg/cmd/tracee.go +++ b/pkg/cmd/tracee.go @@ -11,14 +11,16 @@ import ( tracee "github.com/aquasecurity/tracee/pkg/ebpf" "github.com/aquasecurity/tracee/pkg/errfmt" "github.com/aquasecurity/tracee/pkg/logger" - "github.com/aquasecurity/tracee/pkg/server" + "github.com/aquasecurity/tracee/pkg/server/grpc" + "github.com/aquasecurity/tracee/pkg/server/http" "github.com/aquasecurity/tracee/pkg/utils" ) type Runner struct { TraceeConfig config.Config Printer printer.EventPrinter - Server *server.Server + HTTPServer *http.Server + GRPCServer *grpc.Server } func (r Runner) Run(ctx context.Context) error { @@ -30,20 +32,23 @@ func (r Runner) Run(ctx context.Context) error { } // Readiness Callback: Tracee is ready to receive events - t.AddReadyCallback( func(ctx context.Context) { logger.Debugw("Tracee is ready callback") - if r.Server == nil { - return - } - if r.Server.MetricsEndpointEnabled() { - r.TraceeConfig.MetricsEnabled = true // TODO: is this needed ? - if err := t.Stats().RegisterPrometheus(); err != nil { - logger.Errorw("Registering prometheus metrics", "error", err) + if r.HTTPServer != nil { + if r.HTTPServer.MetricsEndpointEnabled() { + r.TraceeConfig.MetricsEnabled = true // TODO: is this needed ? + if err := t.Stats().RegisterPrometheus(); err != nil { + logger.Errorw("Registering prometheus metrics", "error", err) + } } + go r.HTTPServer.Start(ctx) + } + + // start server if one is configured + if r.GRPCServer != nil { + go r.GRPCServer.Start(ctx) } - go r.Server.Start(ctx) }, ) diff --git a/pkg/cmd/urfave/urfave.go b/pkg/cmd/urfave/urfave.go index e22efca900ec..3461e170c299 100644 --- a/pkg/cmd/urfave/urfave.go +++ b/pkg/cmd/urfave/urfave.go @@ -163,8 +163,8 @@ func GetTraceeRunner(c *cli.Context, version string) (cmd.Runner, error) { cfg.ChanEvents = make(chan trace.Event, 1000) - httpServer, err := server.PrepareServer( - c.String(server.ListenEndpointFlag), + httpServer, err := server.PrepareHTTPServer( + c.String(server.HTTPListenEndpointFlag), c.Bool(server.MetricsEndpointFlag), c.Bool(server.HealthzEndpointFlag), c.Bool(server.PProfEndpointFlag), @@ -175,7 +175,7 @@ func GetTraceeRunner(c *cli.Context, version string) (cmd.Runner, error) { return runner, err } - runner.Server = httpServer + runner.HTTPServer = httpServer runner.TraceeConfig = cfg runner.Printer = broadcast diff --git a/pkg/server/grpc/server.go b/pkg/server/grpc/server.go new file mode 100644 index 000000000000..332e7bcf668a --- /dev/null +++ b/pkg/server/grpc/server.go @@ -0,0 +1,80 @@ +package grpc + +import ( + "context" + "net" + + "google.golang.org/grpc" + + "github.com/aquasecurity/tracee/pkg/events" + "github.com/aquasecurity/tracee/pkg/logger" + pb "github.com/aquasecurity/tracee/types/api/v1beta1" +) + +type Server struct { + pb.UnimplementedTraceeServer + listener net.Listener + protocol string + listenAddr string +} + +func New(protocol, listenAddr string) (*Server, error) { + if protocol == "tcp" { + listenAddr = ":" + listenAddr + } + + lis, err := net.Listen(protocol, listenAddr) + if err != nil { + return nil, err + } + + return &Server{listener: lis, protocol: protocol, listenAddr: listenAddr}, nil +} + +func (s *Server) Start(ctx context.Context) { + srvCtx, srvCancel := context.WithCancel(ctx) + defer srvCancel() + + // TODO: allow grpc keep alive configuration from CLI/Configfile + grpcServer := grpc.NewServer() + pb.RegisterTraceeServer(grpcServer, s) + + go func() { + logger.Debugw("Starting grpc server", "protocol", s.protocol, "address", s.listenAddr) + + if err := grpcServer.Serve(s.listener); err != nil { + logger.Errorw("GRPC server", "error", err) + } + + srvCancel() + }() + + select { + case <-ctx.Done(): + logger.Debugw("Context cancelled, shutting down grpc server") + grpcServer.GracefulStop() + // if server error occurred while base ctx is not done, we should exit via this case + case <-srvCtx.Done(): + } +} + +func (s *Server) ListEventDefinitions(ctx context.Context, in *pb.ListEventDefinitionRequest) (*pb.ListEventDefinitionResponse, error) { + eventDefinitions := make([]*pb.EventDefinition, 0) + + for _, evtDefinition := range events.Core.GetDefinitions() { + if evtDefinition.IsInternal() { + continue + } + + args := make([]string, 0, len(evtDefinition.GetParams())) + for _, p := range evtDefinition.GetParams() { + args = append(args, p.Name) + } + + def := &pb.EventDefinition{Name: evtDefinition.GetName(), Sets: evtDefinition.GetSets(), Arguments: args} + + eventDefinitions = append(eventDefinitions, def) + } + + return &pb.ListEventDefinitionResponse{Events: eventDefinitions}, nil +} diff --git a/pkg/server/grpc/server_test.go b/pkg/server/grpc/server_test.go new file mode 100644 index 000000000000..63ccb49005d6 --- /dev/null +++ b/pkg/server/grpc/server_test.go @@ -0,0 +1,57 @@ +package grpc + +import ( + "context" + "log" + "os" + "testing" + + "github.com/stretchr/testify/assert" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" + + "github.com/aquasecurity/tracee/pkg/events" + pb "github.com/aquasecurity/tracee/types/api/v1beta1" +) + +func TestServer(t *testing.T) { + tempDir, err := os.MkdirTemp("", "tracee-tests") + if err != nil { + t.Fatal(err) + } + defer os.RemoveAll(tempDir) + + unixSock := tempDir + "/tracee.sock" + defer os.Remove(unixSock) // clean up + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + grpcServer, err := New("unix", unixSock) + if err != nil { + t.Fatal(err) + } + + go grpcServer.Start(ctx) + + c := grpcClient("unix", unixSock) + + listEventsResponse, err := c.ListEventDefinitions(ctx, &pb.ListEventDefinitionRequest{}) + assert.NoError(t, err) + + expectedEvents := events.Definitions.NamesToIDs() + + for _, evtDefinition := range listEventsResponse.Events { + _, ok := expectedEvents[evtDefinition.Name] + assert.True(t, ok) + } +} + +func grpcClient(protocol, addr string) pb.TraceeClient { + sock := protocol + ":" + addr + conn, err := grpc.Dial(sock, grpc.WithTransportCredentials(insecure.NewCredentials())) + if err != nil { + log.Fatalf("did not connect: %v", err) + } + return pb.NewTraceeClient(conn) +} diff --git a/pkg/server/server.go b/pkg/server/http/server.go similarity index 99% rename from pkg/server/server.go rename to pkg/server/http/server.go index 2df8d52c0227..898344591fed 100644 --- a/pkg/server/server.go +++ b/pkg/server/http/server.go @@ -1,4 +1,4 @@ -package server +package http import ( "context" diff --git a/pkg/server/server_test.go b/pkg/server/http/server_test.go similarity index 98% rename from pkg/server/server_test.go rename to pkg/server/http/server_test.go index 32d6b238f32e..3a709b7cf55a 100644 --- a/pkg/server/server_test.go +++ b/pkg/server/http/server_test.go @@ -1,4 +1,4 @@ -package server +package http import ( "fmt" diff --git a/types/api/v1beta1/tracee.pb.go b/types/api/v1beta1/tracee.pb.go new file mode 100644 index 000000000000..7f7aeccb25a9 --- /dev/null +++ b/types/api/v1beta1/tracee.pb.go @@ -0,0 +1,294 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.12.4 +// source: types/api/v1beta1/tracee.proto + +package v1beta1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type EventDefinition struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Sets []string `protobuf:"bytes,2,rep,name=sets,proto3" json:"sets,omitempty"` + Arguments []string `protobuf:"bytes,3,rep,name=arguments,proto3" json:"arguments,omitempty"` // TODO: perhaps metadata should be part of the definition +} + +func (x *EventDefinition) Reset() { + *x = EventDefinition{} + if protoimpl.UnsafeEnabled { + mi := &file_types_api_v1beta1_tracee_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventDefinition) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventDefinition) ProtoMessage() {} + +func (x *EventDefinition) ProtoReflect() protoreflect.Message { + mi := &file_types_api_v1beta1_tracee_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EventDefinition.ProtoReflect.Descriptor instead. +func (*EventDefinition) Descriptor() ([]byte, []int) { + return file_types_api_v1beta1_tracee_proto_rawDescGZIP(), []int{0} +} + +func (x *EventDefinition) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *EventDefinition) GetSets() []string { + if x != nil { + return x.Sets + } + return nil +} + +func (x *EventDefinition) GetArguments() []string { + if x != nil { + return x.Arguments + } + return nil +} + +type ListEventDefinitionRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ListEventDefinitionRequest) Reset() { + *x = ListEventDefinitionRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_types_api_v1beta1_tracee_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListEventDefinitionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListEventDefinitionRequest) ProtoMessage() {} + +func (x *ListEventDefinitionRequest) ProtoReflect() protoreflect.Message { + mi := &file_types_api_v1beta1_tracee_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListEventDefinitionRequest.ProtoReflect.Descriptor instead. +func (*ListEventDefinitionRequest) Descriptor() ([]byte, []int) { + return file_types_api_v1beta1_tracee_proto_rawDescGZIP(), []int{1} +} + +type ListEventDefinitionResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Events []*EventDefinition `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"` +} + +func (x *ListEventDefinitionResponse) Reset() { + *x = ListEventDefinitionResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_types_api_v1beta1_tracee_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListEventDefinitionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListEventDefinitionResponse) ProtoMessage() {} + +func (x *ListEventDefinitionResponse) ProtoReflect() protoreflect.Message { + mi := &file_types_api_v1beta1_tracee_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListEventDefinitionResponse.ProtoReflect.Descriptor instead. +func (*ListEventDefinitionResponse) Descriptor() ([]byte, []int) { + return file_types_api_v1beta1_tracee_proto_rawDescGZIP(), []int{2} +} + +func (x *ListEventDefinitionResponse) GetEvents() []*EventDefinition { + if x != nil { + return x.Events + } + return nil +} + +var File_types_api_v1beta1_tracee_proto protoreflect.FileDescriptor + +var file_types_api_v1beta1_tracee_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x0e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x22, 0x57, 0x0a, 0x0f, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x65, 0x74, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x73, 0x65, 0x74, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x61, + 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, + 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x1c, 0x0a, 0x1a, 0x4c, 0x69, 0x73, + 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x56, 0x0a, 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x65, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x66, + 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x32, + 0x7b, 0x0a, 0x06, 0x54, 0x72, 0x61, 0x63, 0x65, 0x65, 0x12, 0x71, 0x0a, 0x14, 0x4c, 0x69, 0x73, + 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x12, 0x2a, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x66, 0x69, + 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, + 0x74, 0x72, 0x61, 0x63, 0x65, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x2b, 0x5a, 0x29, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x2f, 0x61, 0x71, 0x75, 0x61, 0x73, 0x65, + 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x65, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_types_api_v1beta1_tracee_proto_rawDescOnce sync.Once + file_types_api_v1beta1_tracee_proto_rawDescData = file_types_api_v1beta1_tracee_proto_rawDesc +) + +func file_types_api_v1beta1_tracee_proto_rawDescGZIP() []byte { + file_types_api_v1beta1_tracee_proto_rawDescOnce.Do(func() { + file_types_api_v1beta1_tracee_proto_rawDescData = protoimpl.X.CompressGZIP(file_types_api_v1beta1_tracee_proto_rawDescData) + }) + return file_types_api_v1beta1_tracee_proto_rawDescData +} + +var file_types_api_v1beta1_tracee_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_types_api_v1beta1_tracee_proto_goTypes = []interface{}{ + (*EventDefinition)(nil), // 0: tracee.v1beta1.EventDefinition + (*ListEventDefinitionRequest)(nil), // 1: tracee.v1beta1.ListEventDefinitionRequest + (*ListEventDefinitionResponse)(nil), // 2: tracee.v1beta1.ListEventDefinitionResponse +} +var file_types_api_v1beta1_tracee_proto_depIdxs = []int32{ + 0, // 0: tracee.v1beta1.ListEventDefinitionResponse.events:type_name -> tracee.v1beta1.EventDefinition + 1, // 1: tracee.v1beta1.Tracee.ListEventDefinitions:input_type -> tracee.v1beta1.ListEventDefinitionRequest + 2, // 2: tracee.v1beta1.Tracee.ListEventDefinitions:output_type -> tracee.v1beta1.ListEventDefinitionResponse + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_types_api_v1beta1_tracee_proto_init() } +func file_types_api_v1beta1_tracee_proto_init() { + if File_types_api_v1beta1_tracee_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_types_api_v1beta1_tracee_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EventDefinition); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_types_api_v1beta1_tracee_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListEventDefinitionRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_types_api_v1beta1_tracee_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListEventDefinitionResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_types_api_v1beta1_tracee_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_types_api_v1beta1_tracee_proto_goTypes, + DependencyIndexes: file_types_api_v1beta1_tracee_proto_depIdxs, + MessageInfos: file_types_api_v1beta1_tracee_proto_msgTypes, + }.Build() + File_types_api_v1beta1_tracee_proto = out.File + file_types_api_v1beta1_tracee_proto_rawDesc = nil + file_types_api_v1beta1_tracee_proto_goTypes = nil + file_types_api_v1beta1_tracee_proto_depIdxs = nil +} diff --git a/types/api/v1beta1/tracee.proto b/types/api/v1beta1/tracee.proto new file mode 100644 index 000000000000..49baff71ea5e --- /dev/null +++ b/types/api/v1beta1/tracee.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; + +option go_package = "github.co/aquasecurity/tracee/api/v1beta1"; + +package tracee.v1beta1; + +message EventDefinition { + string name = 1; + repeated string sets = 2; + repeated string arguments = 3; + // TODO: perhaps metadata should be part of the definition +} + +message ListEventDefinitionRequest { + // TODO: Allow filtering +} + +message ListEventDefinitionResponse { + repeated EventDefinition events = 1; +} + +service Tracee { + rpc ListEventDefinitions(ListEventDefinitionRequest) returns (ListEventDefinitionResponse) {} +} diff --git a/types/api/v1beta1/tracee_grpc.pb.go b/types/api/v1beta1/tracee_grpc.pb.go new file mode 100644 index 000000000000..1929961012e0 --- /dev/null +++ b/types/api/v1beta1/tracee_grpc.pb.go @@ -0,0 +1,105 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.12.4 +// source: types/api/v1beta1/tracee.proto + +package v1beta1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// TraceeClient is the client API for Tracee service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type TraceeClient interface { + ListEventDefinitions(ctx context.Context, in *ListEventDefinitionRequest, opts ...grpc.CallOption) (*ListEventDefinitionResponse, error) +} + +type traceeClient struct { + cc grpc.ClientConnInterface +} + +func NewTraceeClient(cc grpc.ClientConnInterface) TraceeClient { + return &traceeClient{cc} +} + +func (c *traceeClient) ListEventDefinitions(ctx context.Context, in *ListEventDefinitionRequest, opts ...grpc.CallOption) (*ListEventDefinitionResponse, error) { + out := new(ListEventDefinitionResponse) + err := c.cc.Invoke(ctx, "/tracee.v1beta1.Tracee/ListEventDefinitions", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// TraceeServer is the server API for Tracee service. +// All implementations must embed UnimplementedTraceeServer +// for forward compatibility +type TraceeServer interface { + ListEventDefinitions(context.Context, *ListEventDefinitionRequest) (*ListEventDefinitionResponse, error) + mustEmbedUnimplementedTraceeServer() +} + +// UnimplementedTraceeServer must be embedded to have forward compatible implementations. +type UnimplementedTraceeServer struct { +} + +func (UnimplementedTraceeServer) ListEventDefinitions(context.Context, *ListEventDefinitionRequest) (*ListEventDefinitionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListEventDefinitions not implemented") +} +func (UnimplementedTraceeServer) mustEmbedUnimplementedTraceeServer() {} + +// UnsafeTraceeServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to TraceeServer will +// result in compilation errors. +type UnsafeTraceeServer interface { + mustEmbedUnimplementedTraceeServer() +} + +func RegisterTraceeServer(s grpc.ServiceRegistrar, srv TraceeServer) { + s.RegisterService(&Tracee_ServiceDesc, srv) +} + +func _Tracee_ListEventDefinitions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListEventDefinitionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TraceeServer).ListEventDefinitions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tracee.v1beta1.Tracee/ListEventDefinitions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TraceeServer).ListEventDefinitions(ctx, req.(*ListEventDefinitionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Tracee_ServiceDesc is the grpc.ServiceDesc for Tracee service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Tracee_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "tracee.v1beta1.Tracee", + HandlerType: (*TraceeServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListEventDefinitions", + Handler: _Tracee_ListEventDefinitions_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "types/api/v1beta1/tracee.proto", +} diff --git a/types/go.mod b/types/go.mod index 6c75ca069823..47e06c0c70cd 100644 --- a/types/go.mod +++ b/types/go.mod @@ -2,10 +2,19 @@ module github.com/aquasecurity/tracee/types go 1.19 -require github.com/stretchr/testify v1.7.0 +require ( + github.com/stretchr/testify v1.7.0 + google.golang.org/grpc v1.56.2 + google.golang.org/protobuf v1.30.0 +) require ( github.com/davecgh/go-spew v1.1.0 // indirect + github.com/golang/protobuf v1.5.3 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect + golang.org/x/net v0.9.0 // indirect + golang.org/x/sys v0.7.0 // indirect + golang.org/x/text v0.9.0 // indirect + google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/types/go.sum b/types/go.sum index 579979996cfc..b72a5839a6e0 100644 --- a/types/go.sum +++ b/types/go.sum @@ -1,13 +1,32 @@ github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +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/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= +golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= +golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= +golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= +google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= +google.golang.org/grpc v1.56.2 h1:fVRFRnXvU+x6C4IlHZewvJOVHoOv1TUuQyoRsYnB4bI= +google.golang.org/grpc v1.56.2/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= +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.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= +google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=