-
Notifications
You must be signed in to change notification settings - Fork 442
runtime hooks support for tetragon #695
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Other than minor issues, LGTM.
114f8a5
to
5258052
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we have a workflow doc from how the OCI runtime hooks are triggered and how it propagates and relates to k8s watcher?
Also let's add OCI word here, clear confusion that runtime hooks are OCI runtime hooks right?
This is intended for runtime hooks to pass information to the agent. In this patch we add a CreateContainer call so that the agent can be notified about the creation of a new container. - cgroupsPath: cgroups path - rootDir: root directory of the container - annotations: annotations for the container see https://github.com/opencontainers/runtime-spec/blob/main/config.md#annotations This patch modifies the proto definition and introduces stub functions The next patch will generate the necessary code from the proto file. Signed-off-by: Kornilios Kourtis <[email protected]>
generate code. Signed-off-by: Kornilios Kourtis <[email protected]>
This patch adds pkg/rthooks which can be used by sensors to add callbacks on RuntimeHookRequest (grpc) requests. There is a global runner, where sensors can register their callbacks. The server will serve the request by running all the callbacks registered in the runner, when a grpc request is issued. The callbacks have two arguments: - the grpc request itself - the k8s wathcer, that allows callbacks to retrieve k8s information as needed. For example, a callback may need to retrieve the namespaces or the labels of a pod when a container for that pod starts. Signed-off-by: Kornilios Kourtis <[email protected]>
This patch adds a create-container command to the tetra CLI, which will issue a CreateContainer grpc request to the agent. It's intended for testing/debugging so it's hidden from users. Signed-off-by: Kornilios Kourtis <[email protected]>
5258052
to
5b82ba5
Compare
Updated description. The intended use is for OCI hooks, but that does not mean that we cannot use it from elsewhere. |
This PR introduces a gRPC interface that can be used by run-time hooks to inform the tetragon agent about events such as container creation. Sensors can add hooks into these events so that they can be notified about them.