6.11. Configuring Keylime for measured boot attestation
When you configure Keylime for measured boot attestation, Keylime checks that the boot process on the measured system corresponds to the state you defined.
Prerequisites
You have network access to the systems where the Keylime components are configured:
- Verifier
- For more information, see Deploying Keylime verifier from a package.
- Registrar
- For more information, see Deploying Keylime registrar from a package.
- Tenant
- For more information, see Deploying Keylime tenant from a package.
- Agent
- For more information, see Deploying Keylime agent from a package.
- Unified Extensible Firmware Interface (UEFI) is enabled on the agent system.
Procedure
On the monitored system where the Keylime agent is configured and running, install the
python3-keylimepackage, which contains thekeylime-policytool:# dnf -y install python3-keylimeOn the monitored system, generate a policy from the measured boot log of the current state of the system by using the
keylime-policytool:# keylime-policy create measured-boot --eventlog-file /sys/kernel/security/tpm0/binary_bios_measurements --output <./measured_boot_reference_state.json>-
Replace
<./measured_boot_reference_state.json>with the path wherekeylime-policysaves the generated policy. If your UEFI system does not have Secure Boot enabled, pass the
--without-securebootargument.중요The policy generated with
keylime-policyis based on the current state of the system and is very strict. Any modifications of the system including kernel updates and system updates will change the boot process and the system will fail the attestation.
-
Replace
Copy the generated policy to the system where the
keylime_tenantutility is configured, for example:# scp root@<agent_ip>:<./measured_boot_reference_state.json> <./measured_boot_reference_state.json>On the system where the Keylime tenant is configured, provision the agent by using the
keylime_tenantutility:# keylime_tenant --command add --targethost <agent_ip> --uuid <agent_uuid> --mb_refstate <./measured_boot_reference_state.json> --cert default-
Replace
<agent_ip>with the agent’s IP address. -
Replace
<agent_uuid>with the agent’s UUID. -
Replace
<./measured_boot_reference_state.json>with the path to the measured boot policy.
If you configure measured boot in combination with runtime monitoring, provide all the options from both use cases when entering the
keylime_tenant --command addcommand.참고You can stop Keylime from monitoring a node by using the
# keylime_tenant --command delete --targethost <agent_ip> --uuid <agent_uuid>command.You can modify the configuration of an already registered agent by using the
keylime_tenant --command updatecommand.-
Replace
Verification
Reboot the monitored system and verify a successful attestation of the agent:
# keylime_tenant --command cvstatus --uuid <agent_uuid> ... {"<agent_uuid>": {"operational_state": "Get Quote"..."attestation_count": 5 ...Replace
<agent_uuid>with the agent’s UUID.If the value of
operational_stateisGet Quoteandattestation_countis nonzero, the attestation of this agent is successful.If the value of
operational_stateisInvalid QuoteorFailedattestation fails, the command displays output similar to the following:{"<agent_uuid>": {"operational_state": "Invalid Quote", ... "ima.validation.ima-ng.not_in_allowlist", "attestation_count": 5, "last_received_quote": 1684150329, "last_successful_attestation": 1684150327}}If the attestation fails, display more details in the verifier log:
# journalctl -u keylime_verifier {"d432fbb3-d2f1-4a97-9ef7-75bd81c00000": {"operational_state": "Tenant Quote Failed", ... "last_event_id": "measured_boot.invalid_pcr_0", "attestation_count": 0, "last_received_quote": 1684487093, "last_successful_attestation": 0}}