-
Notifications
You must be signed in to change notification settings - Fork 357
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: Leverage OCI Hooks for Container Events #1390
Comments
Design proposal draft document - https://docs.google.com/document/d/1abw7IwlLCgS1VUQLHM5PtxbaYPwkkIZyQCzbcd7MLUg/edit |
Hey @akshay196, can we also talk about the reasons for not considering PodInformers, Fanotify? (anything else that we considered?) |
Great document. We need to move this document to Wiki. Or we can just push the markdown here in the issue. I am worried about losing doc from the above link. |
Thanks. I have shared the Google document because it is in WIP. It would be easy to get comment/suggestions in Google doc. Once it is ready, I will move it to issue here. |
@Ankurk99 Added section that talks about different options considered. |
Hello @akshay196, |
I noticed that |
The project is added to LFX Mentorship, Term 01 - 2024 March - May. Do submit your application once mentee applications are open.
KubeArmor monitors start, stop, destroy events as per the container runtime in use. Notice |
Thank you so much. |
I have set up a minikube cluster, and have now cloned the repository. I ran Is there a guide I could follow to build, and test the project on a local k8s cluster(minikube)? Thank you. |
|
Hey Folks, Thanks for the interest in the mentorship. We have certain prerequisites which we expect to be included in your application. Please include details or reference to a document for the said prerequisite in your Cover Letter / Mail to the mentors / Submit it in the issue thread / DM Mentors in KubeArmor Slack by 20 Feb. Following are the details. Leverage OCI Hooks for Container Events - https://mentorship.lfx.linuxfoundation.org/project/a604ba9c-565d-4e8c-aed2-dcd4ebedc85d |
Thank you @daemon1024 . For those of us who have already submitted our cover letter, can we provide the reference tobthe prerequisite here once we have it? Or do we have to absolutely submit another cover letter. I would appreciate if we could provide the reference/document detailing our implementation here since the LFX portal will be closing tomorrow. Thank you. |
Definitely it's okay to submit here, mail to us, or just sent it to us over DM in Slack. Apologies for not mentioning it. I have updated the original message |
Thank you. |
@daemon1024 @akshay196 , I'm trying to implement a prestart hook that just sets an environment variable. I am using an Ubuntu VM
I'm working on resolving this, but If you have spotted where I'm missing it, kindly guide me through, thank you sirs. |
How much time do we have to submit this? I just saw it mentioned |
@1awesomeJ It's a bit not straightforward method to make OCI Hooks work with containerd, you can check the design doc it has detailed steps into registering OCI hooks with containerd. Primarily the difference in approach is modifying the base spec and setting the basespec path in containerd config, rather than trying to add hooks to containerd config directly. @ChucklesDroid as mentioned in the comment. The deadline is 20 Feb. |
Wow, thank you so much. This guidance is significant. |
@daemon1024 @akshay196 , I have SUCCESSFULLY implemented an OCI hook that runs with CRIO container runtime! I am using an Ubuntu VM
Kindly review this task, and please let me know if there are other things I need to do. In the meantime, I will work on creating and testing an OCI hook with containerd runtime. Thank you!!! |
@daemon1024 @akshay196, I have updated my documentation at https://github.com/1awesomeJ/KubeArmor/blob/LFX_Mentorship/OCI_Hook_implementation.md Kindly review this updated submission. |
For Docker runtime conatiners, What I have seen is that docker leverages containerd or runc, and there may not yet be an explicit way of integrating hooks with them? What do you say to this? What would you recommend for studying? Thank you. |
Here is a list of the tasks after discussion on KubeArmor slack:
We will start with figuring out which hook we will use from different container lifecycle hooks. Then, starting with CRI-O we will begin with KubeArmor changes, update resource definitions, configuring hook. |
Feature Request
Short Description
Use OCI hooks and get events in context to container start/stop: Currently KubeArmor mounts docker/containerd/crio UNIX domain socket file in KubeArmor to watch for container events. The aim is to use OCI hooks for getting such container events.
Is your feature request related to a problem? Please describe the use case.
Eliminate exposing docker/containerd/crio UNIX domain sockets inside a container.
Describe the solution you'd like
OCI hooks can be used to get containers create/stop events which does not require any access to runtime sockets.
Posix hooks documentation - https://github.com/opencontainers/runtime-spec/blob/v1.1.0/config.md#posix-platform-hooks
Inspektor-gadget runc hook example - https://github.com/inspektor-gadget/inspektor-gadget/tree/main/examples/runc-hook
Describe alternatives you've considered
Nothing.
Note
Created out of #1130. Kept earlier issue for OCI registry feature.
The text was updated successfully, but these errors were encountered: