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

feat: add enable/disable event grpc endpoint #3487

Conversation

josedonizetti
Copy link
Contributor

1. Explain what the PR does

This PR is part of GRPC API. It adds the implementation grpc endpoint to enable/disable event.

2. Explain how to test it

Enable event:

func main() {
	var opts []grpc.DialOption
	opts = append(opts, grpc.WithTransportCredentials(insecure.NewCredentials()))

	conn, err := grpc.Dial(":4466", opts...)
	if err != nil {
		log.Fatalf("fail to dial: %v", err)
	}

	client := pb.NewTraceeServiceClient(conn)
	in := &pb.EnableEventRequest{
		Name: "sched_process_exec",
	}

	_, err = client.EnableEvent(context.Background(), in)
	if err != nil {
		log.Fatal(err)
	}
}

Disable event:

func main() {
	var opts []grpc.DialOption
	opts = append(opts, grpc.WithTransportCredentials(insecure.NewCredentials()))

	conn, err := grpc.Dial(":4466", opts...)
	if err != nil {
		log.Fatalf("fail to dial: %v", err)
	}

	client := pb.NewTraceeServiceClient(conn)

	in := &pb.DisableEventRequest{
		Name: "sched_process_exec",
	}

	_, err = client.DisableEvent(context.Background(), in)
	if err != nil {
		log.Fatal(err)
	}
}

@geyslan
Copy link
Member

geyslan commented Sep 19, 2023

Going to test it.

Copy link
Member

@geyslan geyslan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Tested and works smoothly.

@josedonizetti josedonizetti merged commit d94952f into aquasecurity:main Sep 19, 2023
27 checks passed
@josedonizetti josedonizetti deleted the add-enable-disable-grpc-endpoints branch September 19, 2023 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants