Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gRPC GetVersion() RPC method of TraceeService returns Tracee version wrapped in double quotes #3755

Closed
denisgersh opened this issue Dec 12, 2023 · 1 comment · Fixed by #3764
Labels

Comments

@denisgersh
Copy link

denisgersh commented Dec 12, 2023

Description

Run a simple gRPC client which will call GetVersion() RPC method of TraceeService.

package main

import (
        "context"
        "fmt"
        "os"
         "time"

        traceeApi "github.com/aquasecurity/tracee/api/v1beta1"

        "google.golang.org/grpc"
        "google.golang.org/grpc/credentials/insecure"
)

func main() {
        ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
        defer cancel()

        clientConnection, err := grpc.DialContext(ctx, "<path-to-tracee.sock>",
            	grpc.WithTransportCredentials(insecure.NewCredentials()),
                grpc.WithBlock(),
        )
        if err != nil {
	        _, _ = fmt.Fprintf(os.Stderr, "Failed to connect to Tracee: %s", err)
                os.Exit(1)
        }
        defer func() { _ = clientConnection.Close() }()

        ctx2, cancel2 := context.WithTimeout(context.Background(), 5*time.Second)
        defer cancel2()

        traceeServiceClient := traceeApi.NewTraceeServiceClient(clientConnection)
        response, err := traceeServiceClient.GetVersion(ctx2, &traceeApi.GetVersionRequest{})
        if err != nil {
	        _, _ = fmt.Fprintf(os.Stderr, "Failed to get Tracee version: %s", err)
                os.Exit(1)
        }

        _, _ = fmt.Fprintf(os.Stdout, "Tracee version: %s", response.GetVersion())
}

The output will be (notice the double quotes):

Tracee version: "v0.19.0-1-g47951f66"

Expected: Not wrapped in double quotes Tracee version.
Actual: Wrapped in double quotes Tracee version.

Output of tracee version:

$ ./tracee version
Tracee version: "v0.19.0-1-g47951f66"

Output of uname -a:

$ uname -a
Linux ip-10-0-1-8 6.2.0-1017-aws #17~22.04.1-Ubuntu SMP Fri Nov 17 21:07:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Additional details

N/A

@denisgersh
Copy link
Author

@josedonizetti - FYI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant