mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-10-22 20:39:41 +00:00
Merge pull request #11878 from kata-containers/sprt/privileged-docs
docs: Document `privileged_without_host_devices=false` as unsupported
This commit is contained in:
@@ -180,14 +180,12 @@ shim, the Kata agent bind mounts the source path directly from the
|
|||||||
### Privileged containers
|
### Privileged containers
|
||||||
|
|
||||||
Privileged support in Kata is essentially different from `runc` containers.
|
Privileged support in Kata is essentially different from `runc` containers.
|
||||||
The container runs with elevated capabilities within the guest and is granted
|
The container runs with elevated capabilities within the guest.
|
||||||
access to guest devices instead of the host devices.
|
|
||||||
This is also true with using `securityContext privileged=true` with Kubernetes.
|
This is also true with using `securityContext privileged=true` with Kubernetes.
|
||||||
|
|
||||||
The container may also be granted full access to a subset of host devices
|
Importantly, the default behavior to pass the host devices to a
|
||||||
(https://github.com/kata-containers/runtime/issues/1568).
|
privileged container is not supported in Kata Containers and needs to be
|
||||||
|
disabled, see [Privileged Kata Containers](how-to/privileged.md).
|
||||||
See [Privileged Kata Containers](how-to/privileged.md) for how to configure some of this behavior.
|
|
||||||
|
|
||||||
# Appendices
|
# Appendices
|
||||||
|
|
||||||
|
@@ -1,22 +1,25 @@
|
|||||||
# Privileged Kata Containers
|
# Privileged Kata Containers
|
||||||
|
|
||||||
|
> [!WARNING]
|
||||||
|
> Whilst this functionality is supported, it can decrease the security of Kata Containers if not configured correctly.
|
||||||
|
|
||||||
Kata Containers supports creation of containers that are "privileged" (i.e. have additional capabilities and access
|
Kata Containers supports creation of containers that are "privileged" (i.e. have additional capabilities and access
|
||||||
that is not normally granted).
|
that is not normally granted).
|
||||||
|
|
||||||
## Warnings
|
## Enabling privileged containers without host devices
|
||||||
|
|
||||||
**Warning:** Whilst this functionality is supported, it can decrease the security of Kata Containers if not configured
|
> [!TIP]
|
||||||
correctly.
|
> When Kata Containers is installed through
|
||||||
|
> [kata-deploy](/tools/packaging/kata-deploy/helm-chart/README.md#kata-deploy-helm-chart), this mitigation is configured
|
||||||
|
> out of the box, hence there is no action required in that case.
|
||||||
|
|
||||||
### Host Devices
|
By default, a privileged container attempts to expose all devices from the host. This is generally not supported in Kata
|
||||||
|
Containers as the container is running a different kernel than the host.
|
||||||
|
|
||||||
By default, when privileged is enabled for a container, all the `/dev/*` block devices from the host are mounted
|
Instead, the following sections document how to disable this behavior in different container runtimes. Note that this
|
||||||
into the guest. This will allow the privileged container inside the Kata guest to gain access to mount any block device
|
mitigation does not affect a container's ability to mount *guest* devices.
|
||||||
from the host, a potentially undesirable side-effect that decreases the security of Kata.
|
|
||||||
|
|
||||||
The following sections document how to configure this behavior in different container runtimes.
|
## Containerd
|
||||||
|
|
||||||
#### Containerd
|
|
||||||
|
|
||||||
The Containerd allows configuring the privileged host devices behavior for each runtime in the containerd config. This is
|
The Containerd allows configuring the privileged host devices behavior for each runtime in the containerd config. This is
|
||||||
done with the `privileged_without_host_devices` option. Setting this to `true` will disable hot plugging of the host
|
done with the `privileged_without_host_devices` option. Setting this to `true` will disable hot plugging of the host
|
||||||
@@ -43,7 +46,7 @@ See below example config:
|
|||||||
- [How to use Kata Containers and containerd with Kubernetes](how-to-use-k8s-with-containerd-and-kata.md)
|
- [How to use Kata Containers and containerd with Kubernetes](how-to-use-k8s-with-containerd-and-kata.md)
|
||||||
- [Containerd CRI config documentation](https://github.com/containerd/containerd/blob/main/docs/cri/config.md)
|
- [Containerd CRI config documentation](https://github.com/containerd/containerd/blob/main/docs/cri/config.md)
|
||||||
|
|
||||||
#### CRI-O
|
## CRI-O
|
||||||
|
|
||||||
Similar to containerd, CRI-O allows configuring the privileged host devices
|
Similar to containerd, CRI-O allows configuring the privileged host devices
|
||||||
behavior for each runtime in the CRI config. This is done with the
|
behavior for each runtime in the CRI config. This is done with the
|
||||||
|
Reference in New Issue
Block a user