Hey all!

It’s 2024 already and it has been a while since I’ve been talking about FileVault and Secure token. However, with the release of JPRO 11.2 I to bring that topic back to the table and see where we are on things.

To start I’d like to look back at https://travellingtechguy.blog/filevault-securetoken-and-bootstrap-in-macos-11-0-1-big-sur/ which was my last blog post on the matter. Long story short is that the flowchart I posted back then is still valid in view of when macOS (Sonoma) is granting a secure token to an account:

However, there are 2 points in time – which I highlighted with the red 1 and 2 – where potential problems could be triggered.

The nature of these problems is also twofold:

  • a problem with the end user account creation
  • a problem with the (unwanted) account Secure Token grant

Let’s start with having a look at the potential problems at time of the red 1 on the diagram.

When going through Automated Device Enrollment (ADE / DEP), there is a point in time during the Setup Assistant, where the MDM profile gets installed. At that point, the Mac enrols in JPRO, which, apart from all MDM stuff, also triggers the installation of the Jamf Binary. This via an install enterprise application command:

Alongside with the installation of the Jamf Pro Binary, and subject the account creation settings in the JPRO prestage, macOS may also creates the “Managed Admin” (aka autoadmin). This account, mandatory when demoting end user account creation to standard, or when skipping the end user account creation entirely, gets created with its Secure Token disabled.

In a similar way, and already the case since many previous versions of JPRO, the Jamf Binary also creates the Jamf Management Account. This with the “DisabledTags;SecureToken” option, so that the act of creating the account, on a system which at the exact time of the management account creation does not have a Secure Token holder, does not trigger macOS to grant it a token.

Note: Important to remember is that this "DisabledTags;SecureToken" only affects account creation. Yes, the account created with this option set does not get a Secure Token if no other user already has one. Without that option the account creation would trigger macOS to grant it the first Secure Token of the system. 

However, subsequent logins and ssh authentication using that account, as well as any password changes, prior to having another account with a token granted in the mean time, will still trigger macOS to give this account the first Secure Token!

Long story short is that "DisabledTags;SecureToken" only affects the initial account creation!

That all said, for the red 1 point of time on my diagram, there was no problem with Secure Token since JPRO added “DisabledTags;SecureToken” to the Management Account creation in previous versions already.

However, with the arrival of macOS Sonoma, in combination with the JPRO LAPS functionality, it seemed that another problem saw the light. Depending on the exact time at which the Jamf Management Account is created (hence it’s password being set), before the end user account creation has been completed (if not skipped in the prestage settings), a race condition could cause macOS to skip the end user creation. This resulting in the unwanted behaviour of throwing the end user on the login window, with no opportunity to create a local account.

Reported behaviour like this ended up with the creation of JPRO Product Issues, of which some were valid, while others like PI111120 (macOS account creation is sometimes skipped if “Transfer Information” and “Location Services” is configured to be skipped in Prestage Enrollment) were not. I called this specific PI a hoax since day 1 of it’s existence as the Transfer info or Location Services options were only red herrings.

Nevertheless, the main root cause for this (or similar) unwanted skipping of account creation was nothing more than the above mentioned race condition. With JPRO 11.2 a change in view of when the Jamf Binary creates the Management Account brings resolution:

As of JPRO 11.2, the creation of the Jamf Management Account will be delayed until AFTER the first end user account has been created. By doing so removing the potential race condition causing the Setup Assistant to unintentionally skip account creation.

So far for what I wanted to elaborate on the above changes in JPRO 11.2 and the problem of account creation being skipped. But what about FileVault and Secure Token?

Well, if we look at the above scenario, where we are not skipping account creation, this should result in a situation where the end user creates his/her account, and macOS granting that account the first Secure Token.

“Should”… yes, as there are in fact still things which could potentially cause trouble with Secure Tokens. This has always been the case, however, JPRO 11.2 further reduces the likelihood of that happening. Let’s dive in further.

For the completeness of the story, allow me to list the Secure Token granting events once more. When no other account already has a secure token:

  • Creating a local account and settings it’s password
  • Logging in through the login window or authenticating with SSH, with a local account
  • Changing the password of a local account

This including logging in with an account which previously was created with the DisabledTags;SecureToken” option set. I leave Bootstrap out of this discussion as it is not related to the discussed problems.

However, this means that if a Jamf Pro POLICY runs, which includes a local account creation, before the first grant of a Secure Token, that account gets the first Secure Token.

At both the red 1 and 2 point in time on my flowchart, this could happen, which brings us to another change JPRO 11.2 brings.

As from JPRO 11.2, any account created via the LOCAL ACCOUNT payload of a JPRO Policy, will also be done with the DisabledTags;SecureToken” option set:

This to avoid that a token would be granted if the policy runs while the end user is still in the Setup Assistant (red 1), or at the Login Window (red 2). In the second situation, for instance in view of scenario’s with Jamf Connect.

Unfortunately, this does not account for other account manipulating events, which are entirely outside Jamf Pro’s control. This includes any 3rd party scripts or packages doing anything like creating accounts or changing passwords, as well as any actions of IT Administrators logging in or authenticating with a local account on a tokenless system.

Note: some 3rd party end point security software requires a packages to be installed, which creates a Service Account on the Mac. If that happens, via a policy triggered in JPRO, this could still cause trouble with Secure Token. 

In this case, the policy needs to be delayed to a later time in the initial deployment, or the 3rd party tool needs to start using the "DisabledTags;SecureToken" option as well.
One more thing before I end this post, the change of delaying the creation of the Jamf Management Account, until after the creation of the first end user account (or to be more exact, to after the login of that account) also fixes some issues where Macs could end up with an UNMANAGED status in JPRO post initial enrolment. This especially when both the "Managed Admin" account (aka autoadmin) and the "Jamf Management Account" are named with the exact same account name !

That’s it! As always, if you liked the post, hit the like button, tell your friends about it and leave a comment down below!

Brgds,
TTG