Skip to content

Console security

Sessions and sign in

  • HTTPS only. Without its own certificate the console binds to loopback and runs behind a local TLS proxy such as Caddy.
  • Network lists. Settings, General, Console access by network limits the console to allowed networks (addresses or CIDR ranges) and refuses blocked ones, even when allowed. The lists also cover the admin API and /metrics, which share the console listener. Loopback is always allowed, saving a list that would lock out your own address is refused, and the agent API, /healthz, /readyz, SCIM and /install.sh are not affected. Refused requests are logged with the parsed address. SCIM has its own list, SCIM allowed networks (empty: every network), for the identity provider's provisioning addresses; outside it /scim/ answers 403 before the token is checked. The SCIM token can manage directory people and groups but never create a console administrator: a role mapping to admin ignores groups known only from SCIM (Role groups).
  • Client address. X-Forwarded-For is used only when the peer is loopback or in LIMDM_TRUSTED_PROXIES; then the last entry counts. Network lists, rate limits and audit entries use this address.
  • OIDC with PKCE, nonce, email_verified and domain checks. Settings, SSO, Require multi factor authentication refuses sign ins whose id token shows no second factor: amr must contain mfa or mca, or two distinct methods of which one is a second factor (RFC 8176: otp, hwk, swk, sms, tel, sc, pop, fpt, face, iris, retina, vbm). With Accepted acr values set, LiMDM requests them and the acr claim must be one of them instead. A refused sign in is audited as login.denied (Console settings).
  • Local accounts: argon2id password and TOTP (RFC 6238, codes usable once), one time recovery codes stored as SHA-256 hashes. Sign in attempts are rate limited per client address first (see below); after 5 failures an account is locked for 15 minutes for that client network only (address, IPv6 per /64), stored in the database so it counts across instances. Somebody who knows the name of a break glass account can therefore lock it only for their own network, never for the administrators who need it. A reset of the credentials clears every lockout of the account.
  • Sessions: sealed cookies, 30 minutes idle and 8 hours absolute timeout, CSRF tokens on every form, SameSite=Lax, Secure, HttpOnly; the sign in form uses a separate SameSite=Strict token. Signing out ends the sessions of the account everywhere. A page opened without a session sends the browser to the sign in with its own path as next; after the sign in it returns there. Only a path of the console origin is accepted (no other host, no //, no backslash or control characters, not the sign in pages or the API); anything else lands on the start page, so next is no open redirect.
  • Console app (/app/): its HTML is served to signed in sessions only, its hashed scripts, styles and fonts are the public build and are cached for a year. It calls the admin API with the session cookie; the API then requires a same origin request (Sec-Fetch-Site, Origin) and, for every change, the session's CSRF token in X-CSRF-Token (Console app). It runs under the same CSP as every console page, which a Playwright test checks for every page and component.
  • Admin API and metrics for automation: bearer tokens. Tokens carry a role (admin, helpdesk, auditor, metrics), optional scope tags, always expire, are stored as SHA-256 hashes, are shown once and can be revoked; creation, revocation, failed authentication and role denials are audited. See Admin API.
  • Headers on console and agent API: Content-Security-Policy: default-src 'self'; frame-ancestors 'none'; form-action 'self'; base-uri 'none' (no inline script or style), Strict-Transport-Security: max-age=63072000; includeSubDomains, X-Frame-Options: DENY, X-Content-Type-Options: nosniff, Referrer-Policy: same-origin, Cache-Control: no-store. The console works without JavaScript except the visual blueprint editor and the remote shell terminal.
  • The API reference /api/v1/docs (Swagger UI, served from the console) adds img-src 'self' data: blob: to that one page: Swagger UI draws its icons as data: SVG images and shows image answers from blob: URLs. Scripts, styles and connections stay 'self', the initializer is a file, and images cannot run code. Tokens entered there are kept in memory only (Trying it out).

Rate limits

What Limit
Local sign in 10 attempts per 5 minutes per client address
Admin API 600 requests per minute per token; 20 failed authentications per 5 minutes per address, then refused before the token is checked
SCIM 20 failed authentications per 5 minutes per address
Enrollment 20 failed attempts per 5 minutes per address (successful enrollments do not count, so a rollout behind one NAT is not blocked)
Network CRL download 20 failed authentications per 5 minutes per address
Device: network certificate 5 requests per 10 minutes per device
Device: app catalog search 30 requests per 10 minutes per device

IPv6 addresses count per /64. These counters live in memory per instance: with several instances an address gets up to that many times the budget (High availability). The local account lockout is in the database.

Sealed values

Secrets in the database are sealed with AES-256-GCM. Each purpose has its own key, derived with HKDF from LIMDM_SESSION_KEY, and every ciphertext is bound to its field or record, so sealed values cannot be swapped between fields or rows:

Value Bound to
OIDC client secret its settings field
Google service account key its settings field
Webhook signing secret (settings row webhook) its settings field
Notification channel credentials (Slack, Discord and webhook URLs, SMTP password) the channel
Desktop login client secret in com.limdm.login items and their version history the field (the item signature covers the sealed form)
Disk recovery keys device and volume

LIMDM_SESSION_KEY may list several comma separated keys, the new one first: values are opened with any of them and sealed again with the first in the background (Session key).