forked from kata-containers/documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add documentation for privileged and host devices
This commit adds documentation for privileged containers and the mounting of host devices when privileged is used. It has instructions for disabling this functionality when using Containerd and CRI. Fixes kata-containers#529 Signed-off-by: Alex Price <[email protected]>
- Loading branch information
Showing
3 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Privileged Kata Containers | ||
|
||
Kata Containers supports creation of containers that are "privileged" - i.e. have additional capabilities and access | ||
that isn't normally granted. | ||
|
||
* [Caveats](#caveats) | ||
* [Host Devices](#host-devices) | ||
* [Containerd and CRI](#containerd-and-cri) | ||
|
||
## Warnings | ||
|
||
**Warning:** Whilst this functionality is supported, it can decrease the security of Kata Containers if not configured | ||
correctly. | ||
|
||
### Host Devices | ||
|
||
By default, when privileged is enabled for a container, all of the `/dev/*` block devices from the host are mounted | ||
into the guest. This will allow the privileged container inside the Kata guest to gain access to mount any block device | ||
from the host, a potentially undesirable side-effect that decreases the security of Kata. | ||
|
||
The following sections document how to configure this behaviour in different container runtimes. | ||
|
||
#### Containerd and CRI | ||
|
||
The Containerd CRI allows configuring the privileged host devices behaviour for each runtime in the CRI config. This is | ||
done with the `privileged_without_host_devices` option. Setting this to `true` will disable hot plugging of the host | ||
devices into the guest, even when privileged is enabled. | ||
|
||
See below example config: | ||
|
||
```toml | ||
[plugins] | ||
[plugins.cri] | ||
[plugins.cri.containerd] | ||
[plugins.cri.containerd.runtimes.runc] | ||
runtime_type = "io.containerd.runc.v1" | ||
privileged_without_host_devices = false | ||
[plugins.cri.containerd.runtimes.kata] | ||
runtime_type = "io.containerd.kata.v2" | ||
privileged_without_host_devices = true | ||
[plugins.cri.containerd.runtimes.kata.options] | ||
ConfigPath = "/opt/kata/share/defaults/kata-containers/configuration.toml" | ||
``` | ||
|
||
- [Kata Containers with Containerd and CRI documentation](how-to-use-k8s-with-cri-containerd-and-kata.md) | ||
- [Containerd CRI config documentation](https://github.com/containerd/cri/blob/master/docs/config.md) |