Verify kernel archive integrity (#1703)

Closes https://github.com/apple/container/issues/1687

The default kernel archive is downloaded from a remote release URL
during first-run setup and via `container system kernel set
--recommended`. Previously, the archive contents were not verified after
download, so integrity depended on HTTPS and the release artifact
remaining unchanged.

This change adds digest verification for kernel archives. The
recommended/default kernel now has pinned digest metadata using an
algorithm-prefixed value such as `sha256:<hex>`. `container system
kernel set --tar` accepts `--digest`; remote tar URLs require it, and
local tar archives can also be verified before unpacking and
installation.

The system config also supports `kernel.digest`, and a custom
`kernel.url` must provide a digest for that archive.
This commit is contained in:
0x4C33
2026-07-13 13:04:39 -07:00
committed by GitHub
parent 5f277a9cbf
commit 57b07fa2ac
15 changed files with 460 additions and 45 deletions
+2 -1
View File
@@ -1543,7 +1543,7 @@ Installs or updates the Linux kernel used by the container runtime on macOS host
**Usage**
```bash
container system kernel set [--arch <arch>] [--binary <binary>] [--force] [--recommended] [--tar <tar>] [--debug]
container system kernel set [--arch <arch>] [--binary <binary>] [--force] [--recommended] [--tar <tar>] [--digest <digest>] [--debug]
```
**Options**
@@ -1553,6 +1553,7 @@ container system kernel set [--arch <arch>] [--binary <binary>] [--force] [--rec
* `--force`: Overwrites an existing kernel with the same name
* `--recommended`: Download and install the recommended kernel as the default (takes precedence over all other flags)
* `--tar <tar>`: Filesystem path or remote URL to a tar archive containing a kernel file
* `--digest <digest>`: Expected digest for the tar archive, for example `sha256:<hex>`. Required when `--tar` is a remote URL.
### `container system property list (ls)`