mirror of
https://github.com/usnistgov/macos_security.git
synced 2026-02-03 05:53:24 +00:00
os_root_disable alternative implementation #123
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 @nihil-admirari on GitHub.
os_root_disable sets root's shell to
/bin/false.CIS benchmark's “5.6 Ensure the "root" Account Is Disabled,” on the other hand, checks the absence of authentication authority
(should return “No such key”·, since root is disabled by default), otherwise it disables root using a special command:
Is there any advantage to setting root's shell to
/bin/falsecompared to what CIS is suggesting?@tcoliver commented on GitHub:
My assumption is that the choice to set the root shell instead of using the dsenableroot utility is purely practical though not ideal.
dsenableroot -dalways prompts for a user password when run (even when run as root via sudo). There are flags (-u username -p password) which let it run silently, but they would require putting a local administrator username and password in plain text in the remediation script. Also, the root account cant be used as it has no associated password for that account (unless of course the computer is out of compliance with this rule ;D ).This in mind, I don't see how using the dsenableroot utility could be done in a safe manor, thus the fallback to swapping the shell to /bin/false.
@robertgendler commented on GitHub:
If you set the shell to
/usr/bin/falseit prevents login at the GUI, Terminal, ssh, or whatever EVEN if you have enabled root. But it must be set to/usr/bin/falsewhich exists vs a shell path that does not.This will prevent also from using
suorsudo -ito login as root.