Cut 4293 enrollment prompt if admin user #605
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issues
What does this solve?
It would appear that a recent change in macOS has prevented us and other MDM vendors from running the command
profiles renew -type enrollment
remotely as root on end user's devices. This is problematic mostly for recovery and re-enrollment scenarios where a device needs to be issued it's MDM profile once again. After further discovery, it was found that running the command in the context of an admin account would re-trigger the enrollment window. This update to the command will check if a local administrator is logged in and issue the enrollment command to run as that user if they are a member of the "admin" group. If the user is not a member of this group, the command will note the admins on the device and exit with code 1.Is there anything particularly tricky?
How should this be tested?
On a MDM Enrolled Device, issue the command to the device, it should exit 0 noting that the device is "MDM is DEP enrolled already"
Remove MDM from the device, login as a standard user. Issue the command to the device it should exit 1 noting that the signed in user is not an administrator. The list of administrators should be printed in standard out.
Sign into the device as an administrator user, (MDM should not be on the device at this moment). Issue the command to the device, it should prompt the signed in user to enroll into JumpCloud MDM. The command exit code should be "0"
Screenshots