Command line
lota-agent takes one verb and the options it reads. Without a verb it
runs the enforcement daemon. The options are parsed in
src/agent/cli.c, the verbs are dispatched in
src/agent/diagnostics.c, and lota-agent --help prints the same
list.
# lota-agent [options]
# lota-agent --status
# lota-agent --attest
Parsing
The agent reads /etc/lota/lota.conf, or the file --config names,
before the options; an option then replaces the value from the file, and a
list option adds to the file's list (Configuration). A missing
default file is no error; a missing file named by --config ends the
command with Config file not found:. A default file the user cannot read
gives a warning, and the command goes on with the defaults.
--help, --gen-signing-key, --sign-policy and --verify-policy
do not read the file, so its contents do not change their result; with
--dump-config the last three read it.
An unknown option, or a missing argument, prints the usage and exits with
status 1. --help prints it and exits with status 0. Most options also
have the one-letter form listed below; the others have none.
One verb runs per invocation. When several are given, the first in this
order runs and the rest are ignored: --shutdown, --status,
--terminate-protected, --dump-config, --gen-signing-key,
--sign-policy, --verify-policy, --test-tpm, --seal,
--unseal, --seal-aik-auth, --reprovision-aik,
--seal-persist-primary, --seal-evict-primary, --test-iommu,
--export-policy, --test-ipc, --test-signed,
--list-publishers, --forget-publisher, --allow-publisher,
--add-publisher, --reenroll, --enroll, --attest.
A verb that fails with an error code exits with status 1; the statuses of the daemon are in Agent.
Daemon control
These verbs talk to the running daemon over /run/lota/lota.sock
(IPC), so the caller needs access to the socket.
--shutdownAsks the daemon to stop and waits up to 60 seconds for its PID file to be released. It prints
Agent stopped.and exits with status 0; a daemon still running after the wait gives status 1. The daemon spends PCR 14 as it stops, so it starts again only after a reboot (Agent lifecycle).--statusPrints the daemon's mode, status flags, applied policy keys, last attestation time, token expiry and attestation counts, as any caller of the socket reads them.
--terminate-protected PIDAsks the daemon to end a protected process with
SIGTERM, or withSIGKILLwhen--forceis given. The owner of the process or root may ask. The daemon reports the end to the publisher until the host reboots (Protected processes). PID is a positive decimal number; anything else givesInvalid PID:.--forceWith
--terminate-protected: sendSIGKILL.
Attestation
--attest,-aSends attestation reports. With publisher profiles in the configuration, or with no verifier named at all, it runs as a loop at the interval below and keeps running. With only
--serveror the file'sserverkey and no interval it sends one report and exits. With profiles it refuses--serverand--pin-sha256: each profile names its own verifier and pin.--attest-interval SECS,-I SECSThe loop interval: 0, or 30 to 240. A value out of range ends the command. 0 means the default: 240 seconds for profiles or for no verifier, one report for a single verifier. The option also implies
--attest, and with--add-publisherit sets the profile's interval.--server HOST,-s HOSTThe verifier. No default.
--port PORT,-p PORTThe verifier port, 1 to 65535. Default 8443.
--ca-cert PATH,-C PATHThe publisher's CA trust anchor, PEM or DER. It verifies the TLS peer in place of the system CA store, and it names the publisher profile that holds the AIK certificate, so
--enrollneeds it.--pin-sha256 HEX,-F HEXPins the verifier's certificate by its SHA-256 fingerprint: 64 hex digits, with colons or spaces allowed. A pin that does not parse ends the command.
--no-verify-tls,-KTurns off verification of the peer's certificate.
--enrolland--attestrefuse it without--insecure-allow-no-verify-tls. A pin still applies.--insecure-allow-no-verify-tlsAcknowledges
--no-verify-tls.
Publishers
--enrollEnrolls the AIK with the publisher's attestation CA by credential activation and stores the certificate it issues in the publisher's profile. It needs
--ca-serverand--ca-cert. Running it records the consent of the user who runs it, as--allow-publisherdoes.--ca-server HOSTThe attestation CA.
--ca-port PORTThe CA port, 1 to 65535. Default 8444.
--enroll-token-file PATHA file with the enrollment token of a tenant, presented to the CA during
--enroll.--reenrolland certificate renewal reuse the token, not the path.--reenrollEnrolls again each publisher whose certificate does not name the key at its handle, at the endpoint and with the anchor its
--enrollrecorded.--publisher IDWith
--reenroll: that publisher alone. A--ca-server,--ca-portor--ca-certgiven on the command line then replaces the recorded one.--add-publisher HOSTWrites a publisher profile into the configuration file. HOST is the publisher's attestation CA,
--ca-certits trust anchor,--serverand--portits verifier; without--serverthe profile names no verifier. It records no consent.--publisher-name NAMEWith
--add-publisher: the profile's name. Default: a prefix of the publisher identity.--reporting MODEWith
--add-publisher:session(the default) reports only while a title of that publisher runs,continuousreports always. Another value ends the command.--allow-publisher HEXRecords consent for one publisher, named by the SHA-256 of its CA trust anchor's public key. The agent enrolls with no publisher on its own before consent is recorded.
--list-publishersLists every publisher this host answers to, what it stores for each, and when consent was given.
--forget-publisher HEXEvicts the publisher's AIK and deletes everything stored for it. The publisher needs consent and enrollment to be answered again, and gets the same key back until the owner hierarchy is cleared.
TPM and sealing
The TPM verbs are described in TPM.
--test-tpm,-tReports on the TPM operations and exits. It creates or replaces no key; it skips the quote when the attestation handle is free. It checks PCR 14 against this binary's commitment and never extends it.
--sealReads a secret from standard input, seals it to the PCR state and writes the sealed blob to standard output. Up to 128 bytes are sealed directly; up to 64 KiB go into an envelope of a sealed key and AES-256-GCM. An empty secret is refused.
--unsealReads a sealed blob from standard input and writes the secret to standard output. It fails when the PCR state differs from the one sealed to.
--seal-pcrs MASKThe PCR mask for
--seal, in C notation (0x83,131). It is not empty and names no PCR above 23. Default 0x83: PCRs 0, 1 and 7. 0x4083 adds PCR 14, which binds the secret to a boot state that includes the agent's commitment: any process with TPM access unseals while the registers match, and an upgrade of the agent makes it unreadable.--seal-aik-authSeals the AIK authorization value to the current boot state.
--reprovision-aikRotates the AIK authorization value and seals it again after a change of the boot state. The key stays the same; when one changes, the command names the
--reenroll --publishercommand for it.--seal-persist-primaryStores the seal storage primary key at a persistent handle and records its Name. Seal and unseal use it, and skip
CreatePrimary, withseal_persistent_primary = truein the configuration, while its Name matches the record. A handle that holds another object is left alone and the command exits 1.--seal-evict-primaryRemoves that key and its record. Blobs sealed before stay valid. A handle that holds another object is left alone and the command exits 1.
Diagnostics
--dump-config,-ZPrints the configuration as the file and the options together set it, and exits.
--test-iommu,-iChecks the IOMMU, prints what it found and
PASSEDorFAILED, and exits with status 0 or 1.--export-policy,-EWrites a YAML policy of the running system to standard output, for the verifier. It opens the TPM and reads the PCRs it exports; it does not extend PCR 14.
--test-ipc,-cRuns the IPC server without a TPM, in a simulated attested state, until interrupted. It answers status, D-Bus and profile binding; it refuses
GET_TOKEN.--test-signed,-SRuns the IPC server with tokens signed by the TPM, until interrupted.
Daemon options
--config PATH,-f PATHThe configuration file. Default
/etc/lota/lota.conf.--bpf PATH,-b PATHThe enforcement object. Default
/usr/lib/lota/lota_lsm.bpf.o; its signature is the same path with.sigappended.--mode MODE,-m MODEenforcerefuses what the policy refuses;monitorlogs it. The mode changes the policy alone: the agent and the protected processes are guarded in both, and the agent refuses every signal that would end it, from root too. A mode weaker than the file'senforceneeds--insecure-allow-mode-downgrade. Another value ends the command.--insecure-allow-mode-downgradeAcknowledges a
--mode monitorbelow the file'senforce.--insecure-allow-mutable-rootfsStarts with a warning when
/dev/tpmrm0or/dev/tpm0lacks the SELinux labellota_tpm_device_t; another root domain can then hold the TPM resource manager.--strict-mmap,-MRefuses an executable
mmapof a library that is not trusted.--strict-exec,-YEnforces the strict executable policy, with the fs-verity allow list.
--block-ptrace,-PRefuses every ptrace attach.
--strict-modules,-JEnforces the strict policy for loading kernel modules and firmware.
--block-anon-exec,-XRefuses anonymous executable mappings.
The five switches above take effect in enforce mode alone.
--strict-exec and --strict-modules refuse to start without an
--allow-verity entry.
--benchWrites the agent's cost to
/run/lota/bench.jsoneach second. It changes no policy; the status word and the attestation report say it is on.--protect-pid PID,-R PIDAdds PID to the daemon's protected set, with ptrace refused. The daemon reads it at start alone. The process has to be running then; a PID that names none is refused before PCR 14 is spent. At most 1024 entries, counting the file's. A process protects itself through the SDK with
lota_protect_self().--trust-lib PATH,-L PATHAdds a library to the trusted list. At most 64 entries, counting the file's.
--allow-verity PATH,-A PATHAdds a file protected by fs-verity to the allow list, by its digest. At most 256 entries, counting the file's.
--daemon,-dForks into the background. Under systemd it is not needed.
--pid-file PATH,-D PATHThe PID file. Default
/run/lota/lota-agent.pid.
The paths of --trust-lib and --allow-verity are absolute, have no
.. segment and no control characters.
Policy signing
--gen-signing-key PREFIX,-G PREFIXGenerates an Ed25519 key pair,
PREFIX.keyandPREFIX.pub. An existing file is not overwritten.--sign-policy FILE,-g FILESigns a YAML policy with
--signing-keyand writesFILE.sig.--signing-key PATH,-k PATHThe Ed25519 private key, PEM.
--verify-policy FILE,-V FILEVerifies
FILE.sigagainst FILE.--policy-pubkey PATH,-Q PATHThe Ed25519 public key, PEM. It verifies both policy signatures and the signature of the enforcement object. Without it the agent takes
policy_pubkeyfrom the file, then/etc/lota/policy.pub, then/usr/lib/lota/enforcement.pub, the first one it can read.--verify-policy, which does not read the file, starts at/etc/lota/policy.pub.
Environment
LOTA_TCTIA TCTI configuration string for the TPM in place of
/dev/tpmrm0.LOTA_AIK_META_PATHThe host AIK record in place of
/var/lib/lota/aik_meta.dat: an absolute path of letters, digits,/,.,_and-, without...LOTA_UEFI_FIRMWARE_PATHThe path whose presence says the host booted via UEFI, in place of
/sys/firmware/efi.
The three variables above are read by the one-shot verbs and by an
--attest that sends one report. The daemon and the --attest loop
ignore them (src/agent/attest.h).
NOTIFY_SOCKETThe systemd notification socket. The agent accepts
/run/systemd/notify,/run/user/<uid>/systemd/notifyfor its own UID, and@org/freedesktop/systemd1/notify. The first socket and its directory are owned by root, the second by that UID, and the directory is not writable by group or others. Any other value is dropped, and the agent sends systemd no notification.JOURNAL_STREAM,INVOCATION_IDTell the agent it runs under systemd, with its output in the journal (Agent journal).
TSS2_LOGThe publisher verbs and
--enrollset it toall+nonewhen it is not set, so the TPM library adds no lines to their output.