Skip to content

Shared challenge (MDM)

Device management systems such as Jamf, and many routers, cannot fetch a token for each device: they give all devices one challenge password. For those, BastionXP CA can accept one shared password, next to tokens, with limits on what it gets:

scep:
  enabled: true
  static:
    challenge_file: /etc/bastionxp-ca/scep-challenge   # at least 16 characters
    x509: { cert_profile: tls-device }   # the default; tls-client, tls-server, or one based on them
    dns_domains: [devices.example.com]   # the only DNS names allowed
    email_domains: [example.com]         # the only email domains allowed
    max_per_hour: 100             # the default; 0: no limit

Create the password file:

openssl rand -base64 24 | sudo install -m 600 -o bastionxp-ca /dev/stdin /etc/bastionxp-ca/scep-challenge

Rules

  • Whoever knows the password can enroll, so treat it like a key: make it long and random, keep the file readable by the CA's user only, and put it only into the device management system.
  • A device gets the one profile, names only in the listed domains (none listed: none allowed), never an IP address. The common name is free, as devices name themselves with a serial number or similar.
  • Profiles that need a host name (like tls-server) require dns_domains.
  • The limit counts enrollments with the password for the whole CA, per hour: device management systems often send all requests from one address.
  • Certificates from it are logged and counted with the verifier scep_static, so it is always clear which ones came from the password.
  • Tokens keep working next to it. Prefer them wherever a token can be handed out per device: a token names what it is good for.

Settings

Key Default Meaning
challenge_file File with the shared password, at least 16 characters. Turns it on.
x509.cert_profile tls-device The profile of the certificates: tls-device (30 days), tls-client, tls-server, or one of yours based on these.
dns_domains DNS domains allowed (each and every name below it).
email_domains Email domains allowed.
max_per_hour 100 Enrollments per hour for the whole CA; 0: no limit.

In the device management system

Configure a SCEP payload with:

Field Value
URL https://ca.example.com:8443/scep
Challenge the content of /etc/bastionxp-ca/scep-challenge
Key type / size RSA, 2048 bits or more
Subject e.g. CN=$SERIALNUMBER (as your MDM names it)
Subject alternative name a DNS name in dns_domains, or an email in email_domains
Trusted root a certificate payload with root.crt

Field names differ between MDM products; see their documentation for the SCEP payload.