Agent channel and mTLS¶
Agent channel¶
- mTLS only, TLS 1.3. The server runs its own device CA (ECDSA P-384). The agent creates its key locally (P-256), inside the TPM 2.0 when there is one, and only sends a certificate signing request. A TPM bound key is attested at enrollment (TPM2_Certify by an attestation key, credential activation with the endorsement key) and can be required per tenant (TPM bound device key).
- Enrollment tokens allow at most 500 uses and 30 days (lower limits in Settings, Enrollment); every use is audited with the token it used. It pins the CA by SHA-256 fingerprint at enrollment and trusts nothing else afterwards, no system CAs. A TLS terminating proxy cannot sit in between.
- Revocation without CRLs: the server accepts only the certificate serial currently registered for a device. Retiring a device or rotating its certificate revokes the old one at once.
- Rotation: certificates last 90 days and rotate 30 days before expiry with a new key. A device that was offline past expiry may still renew for 180 days: the handshake proves possession of the key and the serial must still be the registered one. This exception applies to the renewal endpoint only; every other endpoint verifies the certificate against the device CA in the server, not only in the handshake.
- Agent updates need an Ed25519 signature from the release key whose public half is
compiled into the agent; an agent built without it refuses self updates (fail closed).
The private key is a CI secret of the protected
releaseenvironment, not an offline key, and the release fails without it. Downgrades are refused. First installations check the same signature:/install.shembeds the release public key of the server and refuses sums without a valid signature, andinstall-agent.shneeds the key inLIMDM_RELEASE_PUBLIC_KEY. - Signed commands. Every command (lock, wipe, script, message …) is signed when it
is created, with an Ed25519 key in
command.keynext to the CA key, never in the database. The signature covers device, command ID, type, creation time and payload. The agent pins the public key at its first check in with a signing server and from then on runs only commands with a valid signature; refused ones are reported and logged. Recovery keys for lost mode travel beside the signed payload, inside the mTLS channel. Back upcommand.keywith the CA. A new key reaches devices only through a rotation: the server announces it with a rollover record signed by the pinned key, and the agent refuses any other key change (Command key). - Signed declarations. Everything else a device acts on as root is signed with the same
key when an admin saves it, never when it is delivered: library items (name, type,
payload), catalog apps (ID, name, mode, sources with their package repositories, detect
names), managed Flatpak remotes and the user list of each device (bound to the device,
with the admin flags). The server checks the signature before it delivers anything and
leaves out what fails, with an error in its log. The agent checks catalog apps, remotes and
the user list again with its pinned key once the server announces that it signs them
(
signed_datain the check in answer): entries without a valid signature are dropped, an unsigned user list is refused and the last one stays, and the refusal is reported as an event. Older agents ignore the signatures; they get no user list while the stored one does not verify. A change that keeps signed fields (allowing or blocking a remote, opening up an app on request) is refused when the stored entry no longer verifies, so a database change is never signed later by accident. Rows that existed before these signatures are signed once per installation, at the first start of 0.17, recorded in the database (settingskeydata-signed-v1); an instance added or rebuilt later signs nothing. Each signature also covers a sequence number that grows with every signed change of the entry (the database clock in microseconds, so it keeps growing after a restore). The agent keeps the highest number it accepted per app, remote and user list and refuses a lower one, so an older signed state written back into the database (an earlier repository, a revoked admin flag) is not applied again. Not covered: a deleted catalog entry written back with its old signature on a device that never saw a newer state of it.
Whoever can only write to the database cannot make a device run, install or trust anything
an admin did not sign. They can still change which signed items and apps reach which
device (blueprint assignment, approved app requests), stop delivery (a broken signature
withholds the entry), and change what grants nothing on a device: summary, category and
icon of apps, branding, the store switches (which only restrict), risk exceptions (which
only exclude compliance checks), the public DNS fallback switch (TLS to the pinned CA still
applies) and requests to rotate escrowed recovery keys (the device makes the new key itself).
* Keys and HSM. Device CA, network CA and command key can live in a PKCS#11 HSM
(LIMDM_KEY_PROVIDER=pkcs11 with LIMDM_PKCS11_MODULE, LIMDM_PKCS11_TOKEN,
LIMDM_PKCS11_PIN; separate build with -tags pkcs11). The private keys then never
leave the HSM; release checksums can be signed there with limdm-server sign -pkcs11
LABEL. Every key, including the session key and the webhook signing secret, can be
rotated without enrolling devices again (limdm-server keys status|rotate|finish,
Settings, Security, Keys, global administrators only). Inventory, runbooks
and the compromise procedure are in Keys and HSM.
* Network CA. EAP-TLS device certificates come from a second root, network-ca.crt and
network-ca.key next to the device CA, so mTLS certificates never authenticate to the
network and network certificates never reach the agent API. Agents send only a CSR; the
server sets subject and SANs. Retire and wipe revoke them on the CRL. See
Network profiles.
* Fallback DNS (opt in). Off by default. When an admin turns on Settings, Security,
Privacy, public DNS over HTTPS resolvers, agents learn it at their next check in and
remember it. Then, when the system resolver cannot resolve the server's name or none of
its addresses answers, the agent asks Cloudflare (1.1.1.1, 1.0.0.1) and Google (8.8.8.8,
8.8.4.4) over DNS over HTTPS, by IP and with their certificates checked; plain DNS on
port 53 is never used for this. A wrong answer cannot redirect the agent: TLS still
verifies the server's name against the pinned CA. "no_fallback_dns": true in
/etc/limdm/agent.json keeps it off on a device whatever the server setting says.