Skip to content

Isaac-Matthews/rust-keylime

This branch is up to date with keylime/rust-keylime:master.

Folders and files

NameName
Last commit message
Last commit date
May 17, 2022
Dec 12, 2024
Dec 20, 2022
Jan 21, 2025
Feb 12, 2024
Jul 7, 2023
Feb 17, 2025
Jan 10, 2024
Feb 26, 2025
Jan 20, 2025
Feb 14, 2025
Dec 12, 2024
Feb 15, 2022
Feb 26, 2024
Jan 15, 2025
Mar 4, 2021
Jan 24, 2022
Mar 11, 2025
Jan 20, 2025
Oct 30, 2024
Jul 10, 2020
Apr 18, 2022
Feb 12, 2024
Mar 1, 2023
Mar 19, 2021
Mar 12, 2025
Mar 4, 2021
Feb 25, 2025

Repository files navigation

Keylime

License: Apache 2.0

Overview

This is a Rust implementation of keylime agent. Keylime is system integrity monitoring system that has the following features:

  • Exposes TPM trust chain for higher-level use
  • Provides an end-to-end solution for bootstrapping node cryptographic identities
  • Securely monitors system integrity

For more information, visit the keylime website

For now, this project is focusing on the keylime agent component, which is a HTTP server running on the machine that executes keylime operations. Most keylime operations rely on TPM co-processor; therefore, the server needs a physical TPM chip (or a TPM emulator) to perform keylime operations. The TPM emulator is a program that runs in the daemon to mimic TPM commands.

The rust-keylime agent is the official agent (starting with version 0.1.0) and replaces the Python implementation.

Prerequisites

Required Packages

Fedora

The following packages are required for building:

  • clang
  • openssl-devel
  • tpm2-tss-devel
  • (optional for the with-zmq feature): zeromq-devel

To install, use the following command:

$ dnf install clang openssl-devel tpm2-tss-devel zeromq-devel

For runtime, the following packages are required:

  • openssl
  • tpm2-tss
  • systemd (to run as systemd service)
  • util-linux-core (for the mount command)
  • (optional for the with-zmq feature): zeromq

Debian and Ubuntu

For Debian and Ubuntu, use the following packages are required:

  • libclang-dev
  • libssl-dev
  • libtss2-dev
  • pkg-config
  • (optional for the with-zmq feature): libzmq3-dev

To install, use the following command:

$ apt-get install libclang-dev libssl-dev libtss2-dev libzmq3-dev pkg-config

For runtime, the following packages are required:

  • coreutils (for the mount command)
  • libssl
  • libtss2-esys-3.0.2-0
  • (optional for the with-zmq feature): libzmq3
  • systemd (to run as systemd service)

Rust

Make sure Rust is installed before running Keylime. Installation instructions can be found here.

Logging env

To run with pretty-env-logger trace logging active, set cargo run within RUST_LOG, as follows:

$ RUST_LOG=keylime_agent=trace cargo run --bin keylime_agent

Testing

Unit tests are gating in CI for new code submission. To run them:

$ cargo test

Running agent as a systemd-managed service

To make deployment and management of the service easier, this crate comes with a Makefile and systemd unit file.

To install the executables and the unit file, do:

$ make
$ sudo make install

Then you should be able to start the service with:

$ sudo systemctl start keylime_agent

Building Debian package with cargo-deb

Cargo deb requires Rust 1.60, so on Debian you need to install it first from rustup.rs.

# Install cargo-deb
rustup update
cargo install cargo-deb

# Build Debian package
cargo deb -p keylime_agent

About

Rust implementation of the keylime agent

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 94.7%
  • Shell 3.6%
  • Python 0.8%
  • Dockerfile 0.6%
  • Makefile 0.2%
  • Standard ML 0.1%