project-akri / akri

A Kubernetes Resource Interface for the Edge
https://docs.akri.sh/
Apache License 2.0
1.11k stars 146 forks source link

containerd.socket mounting inside container - security concern / best practice deviation? #682

Open huornlmj opened 11 months ago

huornlmj commented 11 months ago

Describe the bug Not a bug, not a feature request, not a security vulnerability announcement with a fix I can provide, but security related so this is the closest fit available

Additional context During threat modelling of the Akri installation with my cluster I observed the containerd.sock file is mounted inside the container. Mounting the containerisation socket file inside a container is a deviation from security best practices, and so I wanted to check with the community what protections or mitigations are in place to balance the issue? In a nutshell, do you know this is happening and are you OK with it?

diconico07 commented 11 months ago

The containerd socket is mounted inside the agent's container to allow for slot reconciliation, the need for this socket is specified in the documentation as well : https://docs.akri.sh/user-guide/cluster-setup#configure-crictl

In a nutshell, as the DevicePlugin system doesn't call the agent when de-allocating the resource, we have to get the information about really used resources from the CRI endpoint.

There are future developments that will close this gap, namely the DRA (Dynamic Resource Allocation) mode that is currently planned will replace the DevicePlugin system with DRA that do notify the driver on de-allocation of resources.

Please note that DRA will not be on by default until it is out of alpha stage on all supported kubernetes versions.

kate-goldenring commented 10 months ago

This may point out that Akri cannot achieve 1.0 until it has moved to DRA due to this security concern.

kate-goldenring commented 10 months ago

@diconico07 is investigating a new approach in https://github.com/project-akri/akri/pull/684 which does not mount the containerd.socket

github-actions[bot] commented 7 months ago

Issue has been automatically marked as stale due to inactivity for 90 days. Update the issue to remove label, otherwise it will be automatically closed.

huornlmj commented 7 months ago

Not stale, still an issue.