Skip to content
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

mkosi: add support for PKCS7 signed images #798

Merged
merged 9 commits into from
Oct 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

- name: Install
run: |
python3 -m pip install pytest mypy isort pyflakes
python3 -m pip install pytest mypy types-cryptography isort pyflakes
npm install -g pyright

- name: Check that imports are sorted
Expand Down
24 changes: 19 additions & 5 deletions mkosi.md
Original file line number Diff line number Diff line change
Expand Up @@ -528,10 +528,24 @@ a boolean argument: either "1", "yes", or "true" to enable, or "0",

`Verity=`, `--verity`

: Add an "Verity" integrity partition to the image. If enabled, the
root partition is protected with `dm-verity` against off-line
modification, the verification data is placed in an additional GPT
partition. Implies `ReadOnly=yes`.
: Add a "Verity" integrity partition to the image. Takes a boolean or
the special value `signed`, and defaults to disabled. If enabled,
the root partition (or `/usr/` partition, in case `UsrOnly=` is
enabled) is protected with `dm-verity` against offline modification,
the verification data is placed in an additional GPT
partition. Implies `ReadOnly=yes`. If this is enabled, the Verity
root hash is written to an output file with `.roothash` or
`.usrhash` suffix. If set to `signed`, Verity is also enabled, but
the resulting root hash is then also signed (in PKCS#7 format) with
the signature key configured with `SecureBootKey=`. Or in other
words: the SecureBoot key pair is then used to both sign the kernel,
if that is enabled, and the root/`/usr/` file system. This signature
is then stored in an additional output file with the `.roothash.p7s`
or `.usrhash.p7s` suffix in DER format. It is also written to an
additional partition in the image. The latter allows generating
self-contained signed disk images, implementing the Verity
provisions described in the [Discoverable Partitions
Specification](https://systemd.io/DISCOVERABLE_PARTITIONS).

`CompressFs=`, `--compress-fs=`

Expand Down Expand Up @@ -597,7 +611,7 @@ a boolean argument: either "1", "yes", or "true" to enable, or "0",
: Configure the image identifier. This accepts a freeform string that
shall be used to identify the image with. If set the default output
file will be named after it (possibly suffixed with the version). If
this option is used the root, `/usr/` and verity partitions in the
this option is used the root, `/usr/` and Verity partitions in the
image will have their labels set to this (possibly suffixed by the
image version). The identifier is also passed via the `$IMAGE_ID` to
any build scripts invoked (which may be useful to patch it into
Expand Down
Loading