mirror of
https://github.com/usnistgov/macos_security.git
synced 2026-02-09 08:12:18 +00:00
checking for authenticated-root hangs forever when multiple OSes are available #193
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @cvgs on GitHub.
Originally assigned to: @robertgendler on GitHub.
Summary
When executing the check script for rule 7.2. "Enable Authenticated Root" on a machine that contains multiple OS installations will cause the script to hang indefinitely, because "csrutil" is expecting manual input.
Steps to reproduce
/usr/bin/csrutil authenticated-root | /usr/bin/grep -c 'enabled'Operating System version
13.2 (22D49)
Intel or Apple Silicon
Apple Silicon
What is the current bug behavior?
On a test machine with two OS partitions ("Pirates" and "💬", Emoji FTW!) the csrutil will expect "1" or "2" to select the correct OS partition:
The script will never provide an answer to csrutil and hangs until terminated.
What is the expected correct behavior?
The command
/usr/bin/csrutil authenticated-root statusshould have a parameter to select the current OS partition automatically and report on its status.Relevant logs and/or screenshots
Once an OS is selected, the proper status is returned.
Possible fixes
expectscript to try to parse csrutils questions (the OS order is not determinate)@robertgendler commented on GitHub:
We've added a warning to the rule. I do not believe we'll do any additional fix for this edge case.
@hcbraun commented on GitHub:
I also ran into this bug. Would be great to fix this. Running multiple installations on Apple Silicon is actually easy and convenient.
Is there a command to get the current running macOS installation?
@robertgendler commented on GitHub:
Our warning has been added to
ventura,monterey, andbig_surTo get the current boot device you can run
/usr/sbin/bless --getBootThen I think from there you'd use the
/usr/sbin/diskutil apfs listand determine the System from there.@cvgs commented on GitHub:
Getting the volume name can be done like this:
/usr/sbin/diskutil info -plist / | /usr/bin/plutil -extract VolumeName raw -- -But then you'd need some kind of
expectwrapper to select the proper answer.If you'd just like to prevent stalling, you could do
yes -1 | /usr/bin/csrutil authenticated-root status, but that would randomly return incorrect results - though it would err on the side of caution and report "disabled" in the worst case.Perhaps there is another way to get the authenticated root value?
@robertgendler commented on GitHub:
I believe Apple has made it so difficult to dual boot Apple Silicon machines, this is an edge case that may be better suited for us just adding a note in the rule about dual booting.
@robertgendler commented on GitHub:
Closing this until Apple adds a better way to check the current booted OS with csrutil.
@robertgendler commented on GitHub:
Maybe we could pester apple for an option to the command for current running system like
csrutil authenticated-root status --current