Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
29ca42b
Initial implementation of add and delete commands
ansasaki Aug 4, 2025
9673c4d
keylimectl: documentation and tests improvement
ansasaki Aug 4, 2025
c00795f
keylimectl: Implement measured-boot command
ansasaki Aug 4, 2025
150cfd8
keylimectl: test and document remaining commands
ansasaki Aug 4, 2025
a0ef36d
keylimectl: fix linting warnings
ansasaki Aug 4, 2025
4dea6ec
keylimectl: Make configuration file optional
ansasaki Aug 4, 2025
77a03fe
keylimectl: Use keylimectl.conf instead of tenant.conf
ansasaki Aug 4, 2025
7a2ecf0
keylimectl: Add example configuration file
ansasaki Aug 4, 2025
d97a922
keylimectl: add support for multiple API versions
ansasaki Aug 4, 2025
ad72ec3
keylimectl: Use default TLS keys and certificates
ansasaki Aug 4, 2025
71f2a6a
keylimeclt: Add communication with agent for API < 3.0
ansasaki Aug 4, 2025
22cf1c6
keylimectl: refactor client and error handling
ansasaki Aug 5, 2025
d3c3821
keylimectl: Integrate builder usage and cleanup
ansasaki Aug 5, 2025
79b9d11
keylimectl: Remove more unused code
ansasaki Aug 5, 2025
2e1f054
keylimectl: Disable hostname checking in clients
ansasaki Aug 5, 2025
1c33521
keylimectl: Remove UUID format enforcing
ansasaki Aug 6, 2025
192da0a
keylimectl: Fix agent retrieval from registrar
ansasaki Aug 6, 2025
f8b3a40
keylimeclt: add support for --tpm-policy
ansasaki Aug 6, 2025
e125ef3
keylimectl: use structures instead of building JSON ad-hoc
ansasaki Aug 6, 2025
8197358
keylimeclt: Fix requests for API version 3.0
ansasaki Aug 6, 2025
fa19010
keylimectl: Fix API 3.0 detection on verifier
ansasaki Aug 7, 2025
1e9ff3b
keylimectl: Add debug messages with requests info
ansasaki Aug 7, 2025
390bdf0
keylimectl: Fix agent add URL for API version 3.0
ansasaki Aug 7, 2025
3cc637c
keylimectl: Fix the API version detection for API < 3.0
ansasaki Aug 7, 2025
14cb21a
keylimectl: Fix API version detection on agent
ansasaki Aug 7, 2025
bac656f
keylimectl: Fix agent add operation
ansasaki Aug 7, 2025
06c25d4
bump cargo.lock
ansasaki Aug 14, 2025
38cfc05
Fix clippy warnings
ansasaki Aug 27, 2025
6571e13
keylimectl: Encode runtime policy using base64
ansasaki Oct 6, 2025
599e769
keylimectl: do not make requests to the agent in push model
ansasaki Oct 6, 2025
fb37c73
keylimectl: Use API v3.0 when --push-model is passed
ansasaki Oct 6, 2025
0691eb6
keylimectl: Implement singleton for config and clients
ansasaki Oct 6, 2025
dab4ad4
keylimectl: Use detected API version for verifier in push-mode
ansasaki Oct 6, 2025
7d47231
keylimectl: Add required fields to the add command request
ansasaki Oct 6, 2025
d1ff80a
keylimectl: Add required fields to the "add" request
ansasaki Oct 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ members = [
"keylime-agent", "keylime-macros",
"keylime-ima-emulator",
"keylime-push-model-agent",
"keylimectl",
]
resolver = "2"

Expand Down
4 changes: 2 additions & 2 deletions keylime-agent/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ config.workspace = true
futures.workspace = true
glob.workspace = true
hex.workspace = true
keylime.workspace = true
keylime = { workspace = true, features = [] }
libc.workspace = true
log.workspace = true
openssl.workspace = true
Expand All @@ -40,7 +40,7 @@ actix-rt.workspace = true
[features]
# The features enabled by default
default = []
testing = []
testing = ["keylime/testing"]
# Whether the agent should be compiled with support to listen for notification
# messages on ZeroMQ
#
Expand Down
2 changes: 1 addition & 1 deletion keylime-push-model-agent/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ async-trait.workspace = true
base64.workspace = true
chrono.workspace = true
clap.workspace = true
keylime.workspace = true
keylime = { workspace = true, features = [] }
log.workspace = true
predicates.workspace = true
pretty_env_logger.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion keylime-push-model-agent/src/attestation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ impl AttestationClient {
None
};

debug!("ResilientClient: initial delay: {} ms, max retries: {}, max delay: {:?} ms",
debug!("ResilientClient: initial delay: {} ms, max retries: {}, max delay: {:?} ms",
config.initial_delay_ms, config.max_retries, config.max_delay_ms);
let client = ResilientClient::new(
base_client,
Expand Down
1 change: 0 additions & 1 deletion keylime-push-model-agent/src/struct_filler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,6 @@ mod tests {

let filler = FillerFromHardware::new(&mut ctx);
assert!(filler.uefi_log_handler.is_none());

assert!(ctx.flush_context().is_ok());
}
}
Expand Down
38 changes: 38 additions & 0 deletions keylimectl/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[package]
name = "keylimectl"
description = "Command-line tool for Keylime remote attestation"
authors.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
version.workspace = true

[[bin]]
name = "keylimectl"
path = "src/main.rs"

[dependencies]
anyhow.workspace = true
base64.workspace = true
chrono.workspace = true
clap.workspace = true
config.workspace = true
hex.workspace = true
keylime.workspace = true
log.workspace = true
openssl.workspace = true
pretty_env_logger.workspace = true
reqwest.workspace = true
reqwest-middleware.workspace = true
serde.workspace = true
serde_derive.workspace = true
serde_json.workspace = true
thiserror.workspace = true
tokio = {workspace = true, features = ["rt-multi-thread"]}
uuid.workspace = true

[dev-dependencies]
assert_cmd.workspace = true
predicates.workspace = true
tempfile.workspace = true
toml = "0.8"
231 changes: 231 additions & 0 deletions keylimectl/keylimectl.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
# keylimectl Configuration File
#
# This file contains all available configuration options for keylimectl,
# the modern command-line tool for Keylime remote attestation.
#
# Configuration files are completely optional. keylimectl will work out-of-the-box
# with sensible defaults if no configuration file is provided.
#
# Configuration precedence (highest to lowest):
# 1. Command-line arguments
# 2. Environment variables (KEYLIME_*)
# 3. Configuration files (this file)
# 4. Default values
#
# This file uses TOML format. For more information about TOML syntax,
# see: https://toml.io/

#
# VERIFIER CONFIGURATION
#
# The verifier continuously monitors agent integrity and manages attestation policies.
# It receives attestation evidence from agents and verifies their trustworthiness.
#
[verifier]

# IP address of the Keylime verifier service
# Default: "127.0.0.1"
# Environment variable: KEYLIME_VERIFIER__IP
ip = "127.0.0.1"

# Port number of the Keylime verifier service
# Default: 8881
# Environment variable: KEYLIME_VERIFIER__PORT
port = 8881

# Optional verifier identifier for multi-verifier deployments
# Default: None
# Environment variable: KEYLIME_VERIFIER__ID
# id = "verifier-1"

#
# REGISTRAR CONFIGURATION
#
# The registrar maintains a database of registered agents and their TPM public keys.
# Agents must register with the registrar before they can be added to the verifier.
#
[registrar]

# IP address of the Keylime registrar service
# Default: "127.0.0.1"
# Environment variable: KEYLIME_REGISTRAR__IP
ip = "127.0.0.1"

# Port number of the Keylime registrar service
# Default: 8891
# Environment variable: KEYLIME_REGISTRAR__PORT
port = 8891

#
# TLS/SSL SECURITY CONFIGURATION
#
# This section controls secure communication with Keylime services.
# Proper TLS configuration is essential for production deployments.
#
[tls]

# Path to client certificate file for mutual TLS authentication
# Default: None (no client certificate)
# Environment variable: KEYLIME_TLS__CLIENT_CERT
client_cert = "/var/lib/keylime/cv_ca/client-cert.crt"

# Path to client private key file for mutual TLS authentication
# Default: None (no client key)
# Environment variable: KEYLIME_TLS__CLIENT_KEY
client_key = "/var/lib/keylime/cv_ca/client-private.pem"

# Password for encrypted client private key (if applicable)
# Default: None (no password)
# Environment variable: KEYLIME_TLS__CLIENT_KEY_PASSWORD
# client_key_password = "your-key-password"

# List of trusted CA certificate file paths for server verification
# Default: [] (empty list - uses system CA store)
# Environment variable: KEYLIME_TLS__TRUSTED_CA (comma-separated)
trusted_ca = ["/var/lib/keylime/cv_ca/cacert.crt"]

# Whether to verify server certificates
# Default: true
# Environment variable: KEYLIME_TLS__VERIFY_SERVER_CERT
# WARNING: Only disable for testing - never in production!
verify_server_cert = true

# Whether to enable mutual TLS for agent communications
# Default: true
# Environment variable: KEYLIME_TLS__ENABLE_AGENT_MTLS
enable_agent_mtls = true

#
# HTTP CLIENT CONFIGURATION
#
# This section controls HTTP client behavior including timeouts and retry logic.
# These settings affect reliability and performance of API communications.
#
[client]

# Request timeout in seconds
# Default: 60
# Environment variable: KEYLIME_CLIENT__TIMEOUT
timeout = 60

# Base retry interval in seconds
# Default: 1.0
# Environment variable: KEYLIME_CLIENT__RETRY_INTERVAL
retry_interval = 1.0

# Whether to use exponential backoff for retries
# Default: true
# Environment variable: KEYLIME_CLIENT__EXPONENTIAL_BACKOFF
# When true, retry delays increase exponentially: 1s, 2s, 4s, 8s, etc.
# When false, retry delay remains constant at retry_interval
exponential_backoff = true

# Maximum number of retry attempts
# Default: 3
# Environment variable: KEYLIME_CLIENT__MAX_RETRIES
max_retries = 3

#
# EXAMPLE CONFIGURATIONS
#

# Example 1: Production configuration with custom services
# [verifier]
# ip = "keylime-verifier.company.com"
# port = 8881
# id = "prod-verifier-01"
#
# [registrar]
# ip = "keylime-registrar.company.com"
# port = 8891
#
# [tls]
# client_cert = "/etc/keylime/certs/client.crt"
# client_key = "/etc/keylime/certs/client.key"
# trusted_ca = ["/etc/keylime/certs/ca.crt"]
# verify_server_cert = true
# enable_agent_mtls = true
#
# [client]
# timeout = 30
# retry_interval = 2.0
# exponential_backoff = true
# max_retries = 5

# Example 2: Development/testing configuration
# [verifier]
# ip = "192.168.1.100"
# port = 8881
#
# [registrar]
# ip = "192.168.1.101"
# port = 8891
#
# [tls]
# verify_server_cert = false # WARNING: Testing only!
# enable_agent_mtls = false # WARNING: Testing only!
#
# [client]
# timeout = 10
# retry_interval = 0.5
# max_retries = 1

# Example 3: IPv6 configuration
# [verifier]
# ip = "2001:db8::1"
# port = 8881
#
# [registrar]
# ip = "2001:db8::2"
# port = 8891

#
# ENVIRONMENT VARIABLE REFERENCE
#
# All configuration options can be overridden using environment variables
# with the KEYLIME_ prefix and double underscores as section separators:
#
# KEYLIME_VERIFIER__IP=192.168.1.100
# KEYLIME_VERIFIER__PORT=8881
# KEYLIME_VERIFIER__ID=verifier-1
# KEYLIME_REGISTRAR__IP=192.168.1.101
# KEYLIME_REGISTRAR__PORT=8891
# KEYLIME_TLS__CLIENT_CERT=/path/to/client.crt
# KEYLIME_TLS__CLIENT_KEY=/path/to/client.key
# KEYLIME_TLS__CLIENT_KEY_PASSWORD=password
# KEYLIME_TLS__TRUSTED_CA=/path/ca1.crt,/path/ca2.crt
# KEYLIME_TLS__VERIFY_SERVER_CERT=true
# KEYLIME_TLS__ENABLE_AGENT_MTLS=true
# KEYLIME_CLIENT__TIMEOUT=60
# KEYLIME_CLIENT__RETRY_INTERVAL=1.0
# KEYLIME_CLIENT__EXPONENTIAL_BACKOFF=true
# KEYLIME_CLIENT__MAX_RETRIES=3

#
# COMMAND-LINE ARGUMENT REFERENCE
#
# Configuration can also be overridden via command-line arguments:
#
# --verifier-ip <IP> Override verifier IP address
# --verifier-port <PORT> Override verifier port
# --registrar-ip <IP> Override registrar IP address
# --registrar-port <PORT> Override registrar port
# -c, --config <FILE> Specify explicit configuration file path
# -v, --verbose Enable verbose logging
# -q, --quiet Suppress non-essential output
# --format <FORMAT> Output format (json, table, yaml)

#
# CONFIGURATION FILE LOCATIONS
#
# keylimectl searches for configuration files in this order:
# 1. Explicit path provided via -c/--config (required to exist)
# 2. ./keylimectl.toml (current directory)
# 3. ./keylimectl.conf (current directory)
# 4. /etc/keylime/keylimectl.conf (system-wide)
# 5. /usr/etc/keylime/keylimectl.conf (alternative system-wide)
# 6. ~/.config/keylime/keylimectl.conf (user-specific)
# 7. ~/.keylimectl.toml (user-specific)
# 8. $XDG_CONFIG_HOME/keylime/keylimectl.conf (XDG standard)
#
# If no configuration files are found, keylimectl works with defaults.
Loading
Loading