Commit Graph
22 Commits
Author SHA1 Message Date
Ludwig NusselandAkarithos d1cec47900 pcrlock: add --strict option
Add a --strict option that makes sure all PCRs for which components were
found are indeed included in the set of predicted PCRs. Instead throw an
error. Avoids creating a policy less secure than requested.

Co-authored-by: Akarithos <277667353+Akarithos@users.noreply.github.com>
2026-08-04 14:11:43 -07:00
Ludwig NusselandAkarithos 18fed0d0d4 pcrlock: shorten displayed hash bytes
Shorten number of bytes show of sha256 hashes. Similar to git, makes
output less wide and more readable.

Co-authored-by: Akarithos <277667353+Akarithos@users.noreply.github.com>
2026-08-04 14:11:43 -07:00
Lennart Poettering 19bf12bff3 pcrlock: don't lock PCR 12 by default
This creates a chicken-and-egg problem: we stuff the pcrlock policy into
a credential in the ESP, but credentials get measured into PCR 12, hence
PCR 12 is both input and output of the pcrlock logic, which makes
impossible to calculate.

Let's drop PCR 12 for now.

(We might want to pass the policy some other way one day, to avoid this,
but that's something for another day.)

Note that this still allows locking to PCR12 if people want to (for
example because they don't need this for the rootfs, and hence need no
cred passing via the ESP), this hence only changes the default, nothing
more.

Fixes: #33546
2025-10-30 14:12:41 +00:00
Kai Wohlfahrt 9ba0fd9293 Fix path in docs for local pcrlock.d directory 2025-09-18 10:59:12 +01:00
Yu Watanabe b525942037 man/pcrlock: fix typo
Follow-up for ccd2bf48b2.
2025-06-04 13:13:14 +09:00
Lennart Poettering ccd2bf48b2 pcrlock: add "is-supported" verb that checks if the local TPM supports the commands we need for pcrlock
systemd-pcrlock requires support for the PolicyAuthorizeNV command,
which is not implemented in the first TPM2 releases. We also strictly
require SHA-256 support. Hence add a tool for checking for both of
these.

This is a tighter version of "systemd-analyze has-tpm2", that checks for
the precise feature that systemd-pcrlock needs, on top of basic TPM2
functionality.

Fixes: #37607
2025-06-03 16:12:45 +02:00
Jan Engelhardt c592ebdf4f man: grammar fixes for introductory adverbs/phrases 2024-12-25 17:24:38 +01:00
Yu Watanabe 4ebbb5bfe8 man: asorted fixes
Closes #35307.
2024-11-24 01:11:42 +09:00
MaxHearnden bd96d63787 Use the correct name of CEL
It's Canonical Event Format, not Common
2024-05-08 13:34:07 +02:00
Dmitry V. Levin c309b9e9c3 treewide: fix a few typos in NEWS, docs, comments, and log messages 2024-04-27 12:11:13 +02:00
Lennart Poettering 43a59b8b86 pcrlock: rework --recovery-pin= to take three different arguments
This reworkds --recovery-pin= from a parameter that takes a boolean to
an enum supporting one of "hide", "show", "query".

If "hide" (default behaviour) we'll generate a recovery pin
automatically, but never show it, and thus just seal it and good.

If "show" we'll generate a recovery pin automatically, but display it in
the output, so the user can write it down.

If "query" we'll ask the user for a recovery pin, and not automatically
generate any.

For compatibility the old boolean behaviour is kept.

With this you can now do "systemd-pcrlock make-policy
--recovery-pin=show" to set up the first policy, write down the recovery
PIN. Later, if the PCR prediction didn't work out one day you can then
do "systemd-pcrlock make-policy --recovery-pin=query" and enter the
recovery key and write a new policy.
2024-04-18 18:12:24 +02:00
cunshunxia cc59d1014f man: fix a few issues in manpage
fix: #31482

Signed-off-by: cunshunxia <cunshunxia@tencent.com>
2024-03-20 15:24:11 +01:00
Zbigniew Jędrzejewski-Szmek ec3cf73f30 meson/man: allow man pages to use multiple conditions
This way the man pages are installed only when the corresponding binary is
installed. The conditions in man pages and man/rules/meson.build are adjusted to
match the conditions for units in units/meson.build.
2024-03-06 09:55:01 +00:00
Lennart Poettering 452486cdf6 man: document new rootfs support for pcrlock policies 2024-01-22 15:56:32 +01:00
David Tardon dfa6c32ad9 man: restrict <command> to the actual command 2023-12-26 13:10:35 +01:00
David Tardon 932abebf4d man: fix markup
<arg> is not allowed inside <term>.
2023-12-26 13:10:35 +01:00
David Tardon eea10b26f7 man: use same version in public and system ident. 2023-12-25 15:51:47 +01:00
Yu Watanabe 24f4144a08 Merge pull request #30600 from dtardon/see-also-simplelist
man: use `<simplelist>` for 'See also' sections
2023-12-23 19:08:31 +09:00
Luca Boccassi d45ca9a905 man: conditionalize sd-pcrlock and sd-measure on the same variable as their binaries
The binaries are built and installed if HAVE_TPM2 is set, and ignore ENABLE_BOOTLOADER,
so do the same for the manpages.

For the sd-pcrlock case this also installs the manpage aliases for the units, which
are not installed with -Dbootloader=disabled, but there's no way to conditionalize
the aliases, so on balance it's better to have too much documentation rather than
too little.

Fixes https://github.com/systemd/systemd/issues/30588
2023-12-23 18:04:08 +08:00
David Tardon 13a69c120b man: use <simplelist> for 'See also' sections
This is just a slight markup improvement; there should be no difference
in rendering.
2023-12-23 08:28:57 +01:00
Luca Boccassi dfb4a66fd0 man: fix typo
allows to -> allows one to
2023-11-06 18:50:30 +00:00
Lennart Poettering e206210909 man: document pcrlock 2023-11-03 11:24:58 +01:00