Skip to content

CLI Reference

← ratatouille.dev

The rat CLI is the primary operator interface for Ratatouille. It handles fleet creation, agent enrollment, live status monitoring, and cryptographic evidence export.

Install:

Terminal window
pip install ratatouille

Configuration: rat stores its API endpoint in ~/.rat/config.json. Set it once with rat connect.


rat connect <url>

Configure which Ratatouille Core instance to connect to. Tests the connection before saving.

Terminal window
rat connect https://your-core-instance
# or interactively:
rat connect
# API endpoint [http://localhost:8001]:

The configured URL is used by all subsequent commands. Stored at ~/.rat/config.json.


rat init

Create a new fleet (policy group) and generate a baseline enrollment token. Prompts for a fleet name, then waits for the first agent to enroll.

What it does:

  1. Creates the policy group on the Ratatouille Core
  2. Generates a one-time baseline enrollment token (esp_b_...)
  3. Prints enrollment commands for three methods: rat enroll, Ansible, and cloud-init
  4. Polls until the first agent checks in, then confirms enrollment

Output includes enrollment commands for:

Terminal window
# rat CLI (run on the target machine)
rat enroll esp_b_<token> --server https://your-core-instance
# Ansible
- name: Enroll agent
shell: pip install ratatouille && rat enroll esp_b_<token> --server https://your-core-instance
# cloud-init
runcmd:
- pip install ratatouille && rat enroll esp_b_<token> --server https://your-core-instance

The first machine enrolled with a baseline token becomes the reference device — its IMA measurement log is used to generate the runtime policy for the group.


rat enroll <token> [--server <url>]

Enroll this machine into a fleet. Run on the agent device, not the operator machine.

ArgumentDescription
<token>Enrollment token from rat init (esp_b_... for baseline, esp_... for standard)
--server, -sOverride the API URL for this enrollment (also saves to config)

What it does:

  1. Validates the token against the Ratatouille Core
  2. Retrieves the Keylime registrar/verifier addresses and policy group assignment
  3. Runs the bundled install script (requires sudo)
  4. The install script installs the Keylime Rust agent, configures it, and initiates the TPM credential activation ceremony

The Keylime agent must be reachable by the Ratatouille verifier over the network after enrollment.


rat status [--watch] [--group <group-id>]

Show the current attestation status of all enrolled agents.

FlagDescription
--watch, -wRefresh every 10 seconds
--group, -gFilter output to a specific policy group

Status values:

StatusMeaning
ACTIVEAgent is enrolled and attesting. Last quote verified against policy.
PROVISIONINGAgent enrolled, awaiting first successful attestation cycle.
FAILEDAttestation failed — IMA log entry not in policy or PCR mismatch.
UNKNOWNVerifier cannot reach the agent or no recent quote.

Example output:

━━ Fleet Status http://localhost:8001
● prod-node-01.fleet.internal prod-fleet ACTIVE PCR[7]+[10] 12s ago
● prod-node-02.fleet.internal prod-fleet ACTIVE PCR[7]+[10] 8s ago
✗ edge-device-07.iot.internal edge-fleet FAILED — 26m ago

rat evidence <hostname|uuid> [--export <path>]

Show the full cryptographic proof chain for a single agent, with the verification command for each link.

ArgumentDescription
<hostname|uuid>Agent hostname or UUID
--export, -eWrite a JSON evidence report to the specified file path

The proof chain displayed:

StepWhat it provesHow to verify independently
1. TPM Hardware IdentityEK certificate is manufacturer-issued and signed by vendor CAopenssl verify -CAfile <ek_ca.pem> <ek_cert.pem>
2. TPM Quote SignatureFresh-nonce hardware quote signed by the Attestation Keytpm2_checkquote --public ak.pub --message quote.msg --signature quote.sig
3. PCR[7] Secure BootSecure Boot was enabled and DB/DBX/PK/KEK set is unchangedsudo tpm2_pcrread sha256:7
4. PCR[10] IMA RuntimeEvery binary that executed since boot is in this log, anchored to hardwaresudo cat /sys/kernel/security/ima/ascii_runtime_measurements
5. Runtime PolicyPolicy is Sigstore-signed by an authorized identitycosign verify-blob --bundle artifact.sigstore.json runtime_policy.json
6. Rekor Transparency LogPolicy signing event is publicly logged, append-only, independently auditablerekor-cli get --log-index <id>

JSON export (--export report.json) produces a structured evidence package suitable for auditor submission. It includes all chain metadata and the verification commands for each step.