Skip to main content

Note: Keylime Python modules do not have a stable API and might change without notice!

Keylime

Slack CNCF chat Docs Status

Keylime

Keylime is an open-source scalable trust system harnessing TPM Technology.

Keylime provides an end-to-end solution for bootstrapping hardware rooted cryptographic trust for remote machines, the provisioning of encrypted payloads, and run-time system integrity monitoring. It also provides a flexible framework for the remote attestation of any given PCR (Platform Configuration Register). Users can create their own customized actions that will trigger when a machine fails its attested measurements.

Keylime's mission is to make TPM Technology easily accessible to developers and users alike, without the need for a deep understanding of the lower levels of a TPM's operations. Amongst many scenarios, it well suited to tenants who need to remotely attest machines not under their own full control (such as a consumer of hybrid cloud or a remote Edge / IoT device in an insecure physical tamper prone location.)

Keylime can be driven with a CLI application and a set of RESTful APIs.

Keylime consists of three main components; The Verifier, Registrar and the Agent.

  • The Verifier continuously verifies the integrity state of the machine that the agent is running on.

  • The Registrar is a database of all agents registered with Keylime and hosts the public keys of the TPM vendors.

  • The Agent is deployed to the remote machine that is to be measured or provisioned with secrets stored within an encrypted payload released once trust is established.

Rust based Keylime Agent

The verifier, registrar, and agent are all developed in Python and situated in this repository keylime. The agent was ported to the Rust programming language. The code can be found in the rust-keylime repository.

The decision was made to port the agent to Rust, as rust is a low-level performant systems language designed with security as a central tenet, by means of the rust compiler's ownership model.

Starting with the 0.1.0 release of the Rust based Keylime agent, this agent is now the official agent.

IMPORTANT: The Python version is deprecated and will be removed with the next major version (7.0.0)!

TPM Support

Keylime supports TPM version 2.0.

Keylime can be used with a hardware TPM, or a software TPM emulator for development, testing, or demonstration purposes. However, DO NOT USE Keylime in production with a TPM emulator! A software TPM emulator does not provide a hardware root of trust and dramatically lowers the security benefits of using Keylime.

A hardware TPM should always be used when real secrets and trust is required.

Table of Contents

Installation

To install Keylime refer to the instructions found in the documentation.

Usage

Configuring Keylime

Keylime puts its configuration in /etc/keylime/*.conf or /usr/etc/keylime/*.conf. It will also take an alternate location for the config in the environment var keylime_{VERIFIER,REGISTRAR,TENANT,CA,LOGGING}_CONFIG.

Those files are documented with comments and should be self-explanatory in most cases.

Running Keylime

Keylime has three major component services that run: the registrar, verifier, and the agent:

  • The registrar is a simple HTTPS service that accepts TPM public keys. It then presents an interface to obtain these public keys for checking quotes.

  • The verifier is the most important component in Keylime. It does initial and periodic checks of system integrity and supports bootstrapping a cryptographic key securely with the agent. The verifier uses mutual TLS for its control interface.

    By default, the verifier will create appropriate TLS certificates for itself in /var/lib/keylime/cv_ca/. The registrar and tenant will use this as well. If you use the generated TLS certificates then all the processes need to run as root to allow reading of private key files in /var/lib/keylime/.

  • The agent is the target of bootstrapping and integrity measurements. It puts its stuff into /var/lib/keylime/.

Provisioning

To kick everything off you need to tell Keylime to provision a machine. This can be done with the Keylime tenant.

Provisioning with keylime_tenant

The keylime_tenant utility can be used to provision your agent.

As an example, the following command tells Keylime to provision a new agent at 127.0.0.1 with UUID d432fbb3-d2f1-4a97-9ef7-75bd81c00000 and talk to a verifier at 127.0.0.1. Finally, it will encrypt a file called filetosend and send it to the agent allowing it to decrypt it only if the configured TPM policy is satisfied:

keylime_tenant -c add -t 127.0.0.1 -v 127.0.0.1 -u D432fbb3-d2f1-4a97-9ef7-75bd81c00000 -f filetosend

To stop Keylime from requesting attestations:

keylime_tenant -c delete -t 127.0.0.1 -u d432fbb3-d2f1-4a97-9ef7-75bd81c00000

For additional advanced options for the tenant utility run:

keylime_tenant -h

Documentation on how to create runtime and measured boot policies can be found in the Keylime User Guide.

Systemd service support

The directory services/ includes systemd service files for the verifier, agent and registrar.

You can install the services with the following command:

sudo ./services/installer.sh

Once installed, you can run and inspect the services keylime_verifier and keylime_registrar via systemctl. The Rust agent repository also contains a systemd service file for the agent.

Request a feature

Keylime feature requests are tracked as enhancements in the enhancements repository

The enhancement process has been implemented to provide a way to review and assess the impact(s) of significant changes to Keylime.

Security Vulnerability Management Policy

If you have found a security vulnerability in Keylime and would like to report, first of all: thank you.

Please contact us directly at security@keylime.groups.io for any bug that might impact the security of this project. Do not use a Github issue to report any potential security bugs.

Project Meetings

We meet on the fourth Wednesday each month @ 16:00 UK time (GMT/BST) to 17:00. Anyone is welcome to join the meeting.

The meeting is normally announced on CNCF chat (Slack)

Meeting agenda are hosted and archived in the meetings repo as GitHub issues.

Contributing: First Timers Support

We welcome new contributors to Keylime of any form, including those of you who maybe new to working in an open source project.

So if you are new to open source development, don't worry, there are a myriad of ways you can get involved in our open source project. As a start, try exploring issues with good first issue label. We understand that the process of creating a Pull Request (PR) can be a barrier for new contributors. These issues are reserved for new contributors like you. If you need any help or advice in making the PR, feel free to jump into our chat room and ask for help there.

Your contribution is our gift to make our project even more robust. Check out CONTRIBUTING.md to find out more about how to contribute to our project.

Keylime uses Semantic Versioning. It is recommended you also read the RELEASE.md file to learn more about it and familiarise yourself with simple of examples of using it.

Testing

Please, see TESTING.md for details.

Additional Reading

Errata from the ACSAC Paper

We discovered a typo in Figure 5 of the published ACSAC paper. The final interaction between the Tenant and Cloud Verifier showed an HMAC of the node's ID using the key K_e. This should be using K_b. The paper in this repository and the ACSAC presentation have been updated to correct this typo.

The software that runs on the system with the TPM is now called the Keylime agent rather than the node. We have made this change in the documentation and code. The ACSAC paper will remain as it was published using node.

Disclaimer

DISTRIBUTION STATEMENT A. Approved for public release: distribution unlimited.

This material is based upon work supported by the Assistant Secretary of Defense for Research and Engineering under Air Force Contract No. FA8721-05-C-0002 and/or FA8702-15-D-0001. Any opinions, findings, conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the Assistant Secretary of Defense for Research and Engineering.

Keylime's license was changed from BSD Clause-2 to Apache 2.0. The original BSD Clause-2 licensed code can be found on the MIT GitHub organization.

Metadata

Release files for keylime 7.14.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for keylime 7.14.3
File Size Uploaded
keylime-7.14.3.tar.gz 669.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for keylime 7.14.3
File Interpreter ABI Platform
keylime-7.14.3-py3-none-any.whl Python 3 none any Details

Total release size: 1.2 MB

Release files / keylime-7.14.3.tar.gz

Download URL keylime-7.14.3.tar.gz
Size 669.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0e7085b7c8b6b0380ad5634c097d37c64695e2ac2d0362de386d84c0fea7eb62
BLAKE2b-256 checksum
How to use checksums
528f28019fa32f59abb94f90969ff3ff6eeb6231ef1bdd2eee7e3fe577411643
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.8

Release files / keylime-7.14.3-py3-none-any.whl

Download URL keylime-7.14.3-py3-none-any.whl
Size 501.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
38596188f7950ae7d095b162a3ecc61345cd6f419b8302f5cf1c961d8e586e8d
BLAKE2b-256 checksum
How to use checksums
0f4ed258f8b89c8078eb38d36abb1783c78650de7692bbd1049d7eb276825e1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.8

Release history Release notifications | RSS feed

This release

7.14.3 This release

2 release files

7.14.1

2 release files

7.13.0

2 release files

7.12.1

2 release files

7.12.0

2 release files

7.10.0

2 release files

7.9.0

2 release files

7.8.0

2 release files

7.7.0

2 release files

7.6.0

2 release files

7.5.0

2 release files

7.4.0

2 release files

7.3.0

2 release files

7.2.5

2 release files

7.0.0

2 release files

6.8.0

2 release files

6.6.0

2 release files

6.5.3

2 release files

6.5.2

2 release files

6.5.1

2 release files

6.5.0

2 release files

6.4.3

2 release files

6.4.2

2 release files

6.4.1

2 release files

6.4.0

2 release files

6.3.2

2 release files

6.3.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page