Enrollment¶
Enrollment tokens¶
Add device in the console creates tokens with a note, an optional blueprint, a number of
uses and a validity in days. The token is shown once. The page shows the commands below with
the token filled in and lists the active tokens with their uses left. Revoke ends a
token at once (audit token.revoke); devices already enrolled with it are not affected.
A token is a bearer secret: whoever holds it can enroll any machine. The hard limits are 500
uses and 30 days; Settings, Enrollment lowers them and sets the defaults of a new
token (1 use, 1 day). Tokens created before these limits were cut down to them once. Every
use is audited as device.enroll with the first 12 hex digits of the token's hash, its note
and the uses left. With multi tenancy a
token enrolls into the tenant it was created in, and tokens of a disabled tenant stop
working (Tenants).
One device: install script¶
/install.sh is generated by your server and contains its agent URL and device CA
fingerprint, no secret. It
- detects the architecture (amd64, arm64) and the package manager (apt, dnf, zypper, pacman or apk); other systems use the tar.gz release by hand,
- writes
/etc/limdm/enroll.conf(0600) fromLIMDM_TOKEN; withoutLIMDM_TOKENit uses an existing/etc/limdm/enroll.conf, - finds the newest release of
LIMDM_RELEASE_REPOthrough the GitHub API, downloadslimdm-agent_<version>_linux_<arch>.<deb|rpm|pkg.tar.zst|apk>,limdm_<version>_SHA256SUMSand its signaturelimdm_<version>_SHA256SUMS.sig, checks the Ed25519 signature with the release public key embedded in the script (the key the server has,LIMDM_RELEASE_PUBLIC_KEY; OpenSSL 3 does the check) and then the package against the signed sums; anything that does not verify stops the installation, so a tampered GitHub release cannot install anything, - on apt, dnf and zypper systems adds the osquery repository, trusting only the embedded
signing key
1484 120A C4E9 F8A1 A577 AEEE 97A8 0C63 C9D8 B80B, - installs osquery and the agent; the package enrolls the device from
enroll.confin its post install step, and the script enables and starts the service.
| Variable | |
|---|---|
LIMDM_TOKEN |
enrollment token |
LIMDM_ALLOW_SCRIPTS=true |
allow remote scripts on this device |
LIMDM_ALLOW_REMOTE_SHELL=true |
allow remote support shells (Remote shell) |
Running the script again on an enrolled device upgrades the agent.
Mass deployment: enroll.conf¶
Distribute /etc/limdm/enroll.conf (mode 0600) with Ansible, Puppet, Salt or a golden image:
server = "https://mdm.example.com:8444"
fingerprint = "<device CA SHA-256 from the Enrollment page>"
token = "lmt_..."
allow_scripts = false
allow_remote_shell = false
| Key | Required | |
|---|---|---|
server |
yes | agent API URL (the agent listener, port 8444 by default) |
fingerprint |
yes | SHA-256 of the device CA, shown on Enrollment |
token |
yes | enrollment token |
allow_scripts |
no | true allows remote scripts and com.limdm.files targets outside the plain text allowlist; default false |
allow_remote_shell |
no | older local opt in for remote support shells; the policy (Agent, Remote shell) decides now (Remote shell) |
Lines starting with # are comments. Both allow_* values are stored in
/etc/limdm/agent.json and cannot be switched on from the server later; enroll again to
change them.
allow_scripts is no protection against administrators: whoever can deploy declarations
(repositories, packages, sudo rules, local users, artifacts) can run code as root on the
device without it. Four eyes approval, signed commands and declarations, and the audit log
are the controls for that (Known limitations of the agent).
Then install the package by any means (your own apt or dnf mirror, the release files, or the
install script without LIMDM_TOKEN). The agent enrolls
- in the package's post install step, when the file exists, and
- at every service start while the device is not enrolled,
and deletes the file afterwards, because the token must not stay on disk. Use one token with enough uses per rollout wave.
Example with Ansible:
- name: LiMDM enrollment
ansible.builtin.copy:
dest: /etc/limdm/enroll.conf
mode: "0600"
content: |
server = "https://mdm.example.com:8444"
fingerprint = "{{ limdm_fingerprint }}"
token = "{{ limdm_token }}"
- name: LiMDM agent
ansible.builtin.shell: curl -fsSL https://mdm.example.com/install.sh | sh
args:
creates: /etc/limdm/device.pem
What enrollment does¶
The agent fetches the device CA over TLS, accepts it only when its SHA-256 matches the
fingerprint, creates a P-256 key locally and sends only a certificate signing request with
the token. The key never leaves the device (/etc/limdm/device.pem, 0600). From then on
every connection is mTLS with TLS 1.3, pinned to that CA.
TPM bound device key¶
With a TPM 2.0 (/dev/tpmrm0) the agent creates the key inside the TPM instead, where it
cannot be exported (fixedTPM, fixedParent); device.pem then holds only a reference
(PEM block LIMDM TPM KEY) next to the certificate. The enrollment proves it to the server
in two rounds:
- The agent certifies the key with an attestation key (AK, a restricted signing key of the
TPM,
TPM2_Certify) and sends the public parts of key, AK and endorsement key (EK) with the CSR. The server checks the signature and the key's attributes, and that the key is the one of the CSR. - The server answers with a credential encrypted to the EK for this AK
(
TPM2_MakeCredential); only the same TPM can decrypt it (TPM2_ActivateCredential). The agent sends the request again with the credential; only then the token is used and the certificate issued.
The server records the device as TPM bound (device page, Device key fact), pins the
AK and keeps the SHA-256 of the EK public area. A renewal creates a new key in the TPM and
stays TPM bound when the pinned AK certifies it. Without a TPM, or when a TPM command fails,
the agent uses a file key as before. Settings, Enrollment, Require TPM bound key
(all tenants) or the tenant's own setting refuses enrollments without it; devices enrolled
earlier keep working and renew as before. The compliance check agent.tpm_key (level 2)
reports whether the key is in the TPM.
Limits: the EK certificate is not checked against the TPM vendors' roots, so a software TPM passes the attestation; the recorded EK fingerprint ties the device to one TPM. Clearing the TPM destroys the key; enroll the device again. Tested with unit and integration tests and software built TPM structures; not yet verified on real TPM hardware or swtpm. Certificates last 90 days and rotate automatically 30 days before they expire, or earlier when the server asks (device CA rotation, Keys and HSM).