Agent
lota-agent runs on the attested host. It loads the signed BPF LSM program
that enforces the host's policy, commits its own binary to PCR 14 once per
boot, and answers with TPM quotes: tokens for a local title over the IPC
socket, and attestation reports for the verifier of each enrolled publisher.
The source is under src/agent.
The same binary serves several roles, chosen by its command line.
Roles
- Enforcement daemon
lota-agentwith no verb, run bylota-agent.service. It loads and attaches the LSM program, extends PCR 14, serves/run/lota/lota.sockand theorg.lota.Agent1D-Bus name, and mints tokens. The unit runs it as root withType=notifyand a watchdog, and stops it withlota-agent --shutdown(Agent lifecycle).- Attestation loop
lota-agent --attest, run bylota-attest.service. It sends a report to the verifier of each configured publisher at that publisher's interval. The unit orders it afterlota-agent.service, grants it no capabilities, and does not restart it on exit status 78. The loop is a client of the daemon's IPC socket.- One-shot commands
Every other verb, such as
--status,--enrollor--seal, does its work and exits.--status,--shutdownand--terminate-protectedtalk to the running daemon over the IPC socket (Command line).
Daemon startup
The daemon starts in this order (src/agent/main.c). A step that fails ends the start with the exit status listed below.
It sets
PR_SET_NO_NEW_PRIVSand clearsPR_SET_DUMPABLE; every invocation of the binary does this.It reads
/etc/lota/lota.conf(Configuration) and the command line. A one-shot verb runs here and exits.It refuses a
--modeweaker than the file'senforcewithout--insecure-allow-mode-downgrade.With
--daemonit detaches; from then on its messages reach the journal alone.It creates the PID file; a file another agent holds ends the start with status 3.
It builds the publisher list from the profiles in the file, refuses to run under a tracer, and loads its seccomp filter.
It checks the startup policy, the signature of the enforcement object against
policy_pubkey, and the object's integrity layout. A refusal here leaves PCR 14 untouched.It opens the IPC socket, or takes it from
lota-agent.socket, then the container listener and D-Bus.It reads the IOMMU, kernel appraisal and Secure Boot state, and logs it.
It refuses a host that did not boot via UEFI.
It opens the TPM, binds the first publisher's profile, and provisions the AIK (TPM). A profile that does not bind is a warning; tokens are then signed with the host AIK.
It extends PCR 14 with its boot commitment. When this boot's commitment is already there, the status and every token carry
AGENT_RESTARTEDuntil reboot.It loads the LSM program, applies the startup policy, attaches the hooks and opens the event ring buffer.
It tells systemd it is ready and enters its event loop.
Exit status
Status |
Meaning |
|---|---|
0 |
The daemon left its event loop on request, or a one-shot command succeeded. |
1 |
Any other failure, including a transient one ( |
3 |
Another agent holds the PID file. |
78 |
The host needs operator action before the agent can start: a host configuration the agent refuses, a startup check that fails for a reason other than the transient ones, or a PCR 14 commitment the agent refuses this boot. |
The status values are in src/agent/exit_status.h.
lota-agent.service does not restart on 3 or 78, and lota-attest.service
does not restart on 78.
Files
Path |
Content |
|---|---|
|
The configuration. The package does not own it. |
|
A fleet's own enforcement key. When present it replaces
|
|
The enforcement object, with its signature |
|
Mode 0700. |
|
One directory per publisher, named by the lowercase hex SHA-256 of
the SubjectPublicKeyInfo of its CA trust anchor
(src/agent/profile.h). It holds |
|
The IPC socket, mode 0660, owner |
|
The daemon's PID file. |
|
Written in the initramfs by |
|
Mode 0640, written with |
|
The bus policy: root alone owns the name; root and group |