krispayne / CIS-Settings

CIS settings bootstrapper for Mac
MIT License
32 stars 5 forks source link

5.7 Do not enable the "root" account #30

Closed krispayne closed 7 years ago

krispayne commented 7 years ago

5.7 Do not enable the "root" account Level 1 Scored TODO: Test. New audit/remediation written. this is requiring expected statements. will look into expect

    if [[ "$(/usr/bin/dscl . -read /Users/root AuthenticationAuthority)" = "No such key: AuthenticationAuthority" ]]; then
        ScriptLogging "  Root user is disabled."
    else
        ScriptLogging "  Root user is enabled. Disabling..."
        /usr/sbin/dsenableroot -d
        ScriptLogging "  Root user is disabled."
    fi