Catalina introduces a new method of SecureToken enablement called Bootstrap Token. This is a new MDM-based management feature to automatically provide a SecureToken on all mobile account logins. This does not affect how local accounts get SecureTokens.
Catalina can give the first mobile account to log in a SecureToken if no other accounts have a SecureToken yet (as of 19a573a), but the benefit of Bootstrap Token comes when multiple users log into an encrypted machine. All mobile accounts that log in automatically get a SecureToken without having to hand one off manually.
There are some specific requirements for Bootstrap Token eligibility:
- An MDM that supports Bootstrap Token.*
- The MDM has to be associated with Apple Business Manager (ABM) or Apple School Manager (ASM).
- The client machine must be assigned in ABM or ASM to that MDM. Merely being enrolled in the MDM manually is not enough.
- The client machine must be enrolled in ABM or ASM, either from Setup Assistant or “nagging” later.
- Since the Bootstrap Token is used for mobile accounts, the client must be bound to a directory service like Active Directory.
*I worked with SimpleMDM to incorporate Bootstrap Token support in their product so I know they have it. Talk to your MDM vendor for more details on their support of Bootstrap Tokens.
Bootstrap Token is not a payload or configuration that gets delivered by the MDM to a client computer. Instead, it is a set of commands that is sent from the client that the MDM needs to know how to process. Apple’s developer documentation on the MDM spec provides details for Bootstrap Token.
EXPLORING THE ESCROW PROCESS:
If the client is enrolled in MDM and associated to the MDM in ABM or ASM but Bootstrap Token hasn’t been escrowed yet, running
profiles status -type bootstraptoken
will result in:
profiles: Bootstrap Token supported on server: YES profiles: Bootstrap Token escrowed to server: NO
The first line being the most important. A YES means that the client is eligible for Bootstrap Token escrow since it is assigned to the MDM in ABM. If the result is NO then the client isn’t eligible at all and you need to look into what MDM the client is enrolled in and if the client and MDM are associated in ABM.
With a SecureToken enabled admin issue
profiles install -type bootstraptoken
.
This process is interactive and requires the username and password to be typed in.
Enter the admin user name:localadmin Enter the password for user 'localadmin': profiles: Create Bootstrap Token created profiles: Bootstrap Token created profiles: Bootstrap Token escrowing to server... profiles: Bootstrap Token escrowed
If all goes well, Bootstrap Token is escrowed. To verify, on the client run
sudo profiles status -type bootstraptoken
profiles: Bootstrap Token supported on server: YES profiles: Bootstrap Token escrowed to server: YES
At this point, if the client is bound to a directory server, when a mobile account logs in a SecureToken will be enabled on the account.
After logging in, list which accounts can unlock the FileVaulted disk with diskutil apfs listcryptousers /
. There you can see the UUID of the mobile account as well as the Bootstrap Token External Key:
Cryptographic users for disk1s5 (4 found) | +-- JJJJJJJJ-UUUU-IIII-OOOO-AAAAAAAAAAAA | Type: Local Open Directory User | +-- KKKKKKKK-LLLL-MMMM-NNNN-BBBBBBBBBBBB | Type: MDM Bootstrap Token External Key | +-- GGGGGGGG-WWWW-QQQQ-ZZZZ-CCCCCCCCCCCC | Type: Local Open Directory User | +-- AAAAAAAA-EEEE-FFFF-CCCC-DDDDDDDDDDDD Type: Personal Recovery User
Compare that list with sudo fdesetup list
to show the same UUIDs of the accounts that have SecureTokens:
localadmin,JJJJJJJJ-UUUU-IIII-OOOO-AAAAAAAAAAAA
mobileaccount,GGGGGGGG-WWWW-QQQQ-ZZZZ-CCCCCCCCCCCC
If FileVault is already encrypted, the new mobile account(s) will be added to the preboot unlock user list automatically. No need to update preboot like past OSes.
HOW CAN THIS BE AUTOMATED TO BE SCALABLE?
For ABM/ASM provisioning, if you don’t suppress the creation of the local admin account in Setup Assistant you’re set. After creating the admin account it automatically logs in and uses the credentials provided at the time of the account creation to escrow the Bootstrap Token. Not all environments allow users, or even techs, to create the first account in Setup Assistant, so what else?
My desired setup – I want a way to have MDM create the local admin account so it is consistent, have the MDM install munki and configure it to bootstrap itself, and by the time munki is done bootstrapping I want the Bootstrap Token to be escrowed automatically so I can hand off the machine to a user to log in without any extra action. Seems pretty reasonable in any environment that has many locations with many techs, but consistent results are expected.
First, there needs to be an admin account with a SecureToken enabled without having to lay hands on the computer. It turns out that the first time the local admin account authenticates in any way it will have a SecureToken enabled on the account. The easiest way I’ve found is using dscl
‘s -authonly
verb to only authenticate the account without actually logging into anything. That verb does what it says, it just verifies the account credentials, but that’s enough to give it a SecureToken.
Once the SecureToken enabled admin is available, then the command
profiles install -type bootstraptoken
needs to be issued. The next hurdle in this process is that this command is interactive. To automate this, a yucky expect
script needs to be used to look for prompts and pass the username and password of the account accordingly.
My automated process:
- Provision the machine via ABM/MDM in Setup Assistant – e.g. it is configured in ABM to enroll in the MDM.
- MDM enrolls.
- MDM creates the local admin account and suppresses allowing the user to create any accounts.
- Munki is installed and configured by an MDM delivered InstallEnterpriseApplication pkg.
- The first pass of Munki runs a script to authenticate the local admin account to issue a SecureToken and then generates and escrows the Bootstrap Token.
- The script authenticates local admin with
/usr/bin/dscl /Local/Default -authonly localadmin password
- I’m not concerned so much about password in the script here as the remaining Munki bootstrap changes that password minutes later
- Now with the local admin that has a SecureToken, the script issues
profiles install -type bootstraptoken
- When Munki is finished bootstrapping, any user that logs in against the directory server will have a SecureToken added to the account automatically.
- The script authenticates local admin with
To break this down, Steps 1-3 are standard form for MDM enrollment at Setup Assistant.
Step 4 has the MDM install Munki and configures it to bootstrap.
Step 5 runs the following script. This script shows how it authenticates the local admin account and includes a yucky expect script to pass the credentials to the interactive-only profiles
routine to install the Bootstrap Token:
#!/bin/bash version=$(sw_vers -productVersion | awk -F. '{print $2}') if [[ $version -ge 15 ]] then # The admin account needs to authenticate to validate its password to enable SecureToken on the account # Using dscl and -authonly is the least intrusive way to do that. /usr/bin/dscl /Local/Default -authonly localadmin password # Kick off the bootstrap token escrow install. The UX is interactive. # Use expect to supply username and password when prompted. /usr/bin/expect << BOOTSTRAP log_file /Users/Shared/expect.log spawn profiles install -type bootstraptoken sleep 1 expect "Enter the admin user name:" sleep 1 send "localadmin\n" sleep 1 expect "Enter the password for user" sleep 1 send "password\n" sleep 1 expect "profiles" sleep 1 interact BOOTSTRAP fi
After this script runs the client has the Bootstrap Token escrowed and yet no one has logged into the computer at all! Success!
Any mobile account that logs in will get a SecureToken. If FileVault is enrolled via the MDM and in a deferred state then, upon login, the mobile account will be prompted to allow FileVault to encrypt.
TO SUMMARIZE:
- Client must be assigned in ABM to the MDM that supports Bootstrap Token
- If the local admin account is created during Setup Assistant, Bootstrap Token escrows automatically
- If the local admin account is suppressed in Setup Assistant, a SecureToken admin has to run the profiles command to install and escrow.
- If the client machine is enrolled in the supporting MDM but not enrolled in ABM or ASM, assign the client in ABM or ASM to the MDM, enroll into ABM with
profiles renew -type enrollment
, then runprofiles install -type bootstraptoken
from a SecureToken enabled admin to escrow.