Commit Graph

19 Commits

Author SHA1 Message Date
Richard Hughes
de8d40d602 tpm-eventlog: Do not return a security attr if there is no TPM device
There is literally no point in showing two TPM failures.
2020-05-18 15:43:23 -05:00
Richard Hughes
b246bcaecb Allow client tools to translate the HSI attributes and results
To do this, rely on the AppStream ID to map to a translated string (providing a
fallback for clients that do not care) and switch the free-form result string
into a set of enumerated values that can be translated.

This fixes some of the problems where some things have to be enabled to "pass"
and other attributes have to be some other state. For cases where we want the
user to "do" something, provide a URL to a wiki page that we update out-of-band
of fwupd releases.
2020-05-18 17:03:49 +01:00
Richard Hughes
cae111d1de Save the plugin that created the FwupdSecurityAttr
This is really useful for debugging.
2020-05-15 16:17:27 +01:00
Richard Hughes
c1eda7d516 Add many new plugins to support for the Host Security ID
The HSI specification is currently incomplete and in active development.

Sample output for my Lenovo P50 Laptop:

    Host Security ID: HSI:2+UA!

    HSI-1
    ✔  UEFI dbx: OK
    ✔  TPM: v2.0
    ✔  SPI: Write disabled
    ✔  SPI: Lock enabled
    ✔  SPI: SMM required
    ✔  UEFI Secure Boot: Enabled

    HSI-2
    ✔  TPM Reconstruction: Matched PCR0 reading

    HSI-3
    ✘  Linux Kernel S3 Sleep: Deep sleep available

    HSI-4
    ✘  Intel CET: Unavailable

    Runtime Suffix -U
    ✔  Firmware Updates: Newest release is 8 months old

    Runtime Suffix -A
    ✔  Firmware Attestation: OK

    Runtime Suffix -!
    ✔  fwupd plugins: OK
    ✔  Linux Kernel: OK
    ✔  Linux Kernel: Locked down
    ✘  Linux Swap: Not encrypted
2020-05-12 21:20:18 +01:00
Richard Hughes
f58ac7316c hsi: Abstract out the list of FwupdSecurityAttr objects for plugins
This exports FuSecurityAttrs into libfwupdplugin so that we can pass the plugins
this object rather than a 'bare' GPtrArray. This greatly simplifies the object
ownership, and also allows us to check the object type before adding.

In the future we could also check for duplicate appstream IDs or missing
properties at insertion time.

This change also changes the fu_plugin_add_security_attrs() to not return an
error. This forces the plugin to handle the error, storing the failure in the
attribute itself.

Only the plugin know if a missing file it needs to read indicates a runtime
problem or a simple failure to obtain a specific HSI level.
2020-05-12 16:47:24 +01:00
Richard Hughes
99cc658a75 tpm-eventlog: Add an HSI attr for reconstruction failure 2020-05-12 12:29:42 +01:00
Mario Limonciello
825c04df73 trivial: tpm-eventlog: Modify -p argument behavior
If using this argument, only display the final calculated value.
2020-04-29 13:18:53 -05:00
Mario Limonciello
38c80baff5 tpm-eventlog: Disambiguate the output at the end of fwupdtpmevlog
It's not obvious to users if this is the same value as tpm2-tools or the reconstructed value.
2020-04-29 13:18:53 -05:00
Mario Limonciello
e1c8c018a5 tpm-eventlog: Correct the display of final calculated PCRs
Although the calculation matched on my machine the actual numbers didn't
match PCR0 values from the tpm2-tools.  This was a display error.
2020-04-29 13:18:53 -05:00
Mario Limonciello
b87d48a042 When TPM PCR0 measurements fail, query if secure boot is available and enabled
If the measurements are missing but it's a UEFI system, it's a good indication
that the user has secure boot turned off.
Notify the user on the UEFI device through a non-fatal `UpdateMessage`

To accomplish this, move fu-uefi-vars into the plugin library for other plugins to use
2020-03-05 07:54:15 -06:00
Mario Limonciello
29e085f441 trivial: send users to a wiki page for TPM PCR0 construction errors 2020-03-02 11:53:18 -06:00
Mario Limonciello
9ee0e63e53 trivial: add some better descriptions for man pages
Since more utilities are now in `bindir`, they should be more descriptive.
2020-02-20 09:34:10 -06:00
Mario Limonciello
b2dc3d481f Improve the description of fwupdtpmevlog for man page 2020-02-20 09:02:11 -06:00
Mario Limonciello
9fa7b38ac1 Move fwupdtpmevlog into bindir 2020-02-20 09:02:11 -06:00
Richard Hughes
59d947ac24 tpm-eventlog: Replay the TPM event log to get the PCRx values
In theory, these should always match the reported PCRx values from the TPM.

If the reconstructed event log checksum does not match the TPM value then
something is either implemented wrongly, or something bad has happened.
2020-02-04 11:54:27 +00:00
Richard Hughes
ca3e785c40 tpm-eventlog: Store the eventlog hashes in binary form
This means we use half the amount of memory to store the event hashes, and also
means we can process the raw data in future patches without parsing back out
of ASCII format.
2020-02-04 11:54:27 +00:00
Mario Limonciello
0dd8db545e trivial: tpm-eventlog: correct a typographical error 2020-01-09 10:42:08 -06:00
Richard Hughes
0cc22a5ff6 trivial: Document the use of vendor-id in each plugin 2019-12-11 18:10:44 +00:00
Richard Hughes
f5c6e1d276 Add a new plugin that can parse the TPM event log
Some devices do not have a stable PCR0 for the same firmware version, and I'd
like to collect the TPM event log for affected machines to debug why.
2019-12-06 15:05:16 +00:00