Catalina - Disable Accounts after 35 Days of Inactivity

Information

The macOS _MUST_ be configured to disable accounts after 35 days of inactivity.

This rule prevents malicious users from making use of unused accounts to gain access to the system while avoiding detection.

Solution

This setting may be enforced using local policy or by a directory service.

To set local policy to disable an inactive user after 35 days, edit the current password policy to contain the following <dict> within the "policyCategoryAuthentication":

[source,xml]
----
<dict>
<key>policyContent</key>
<string>policyAttributeLastAuthenticationTime &gt; policyAttributeCurrentTime - (policyAttributeInactiveDays * 24 * 60 * 60)</string>
<key>policyIdentifier</key>
<string>Inactive Account</string>
<key>policyParameters</key>
<dict>
<key>policyAttributeInactiveDays<key>
<integer>35</integer>
</dict>
</dict>
----
After saving the file and exiting to the command prompt, run the following command to load the new policy file, substituting the path to the file in place of "$pwpolicy_file".

[source,bash]
----
/usr/bin/pwpolicy setaccountpolicies $pwpolicy_file
----
WARNING: This may not function properly in macOS Catalina versions prior to 10.15.7.

NOTE: See the password policy supplemental on more information on how to implement password policies on macOS.

See Also

https://github.com/usnistgov/macos_security

Item Details

Category: ACCESS CONTROL, IDENTIFICATION AND AUTHENTICATION

References: 800-53|AC-2(3), 800-53|IA-4, 800-53|IA-4e., CCE|CCE-84808-5, CCI|CCI-000795

Plugin: Unix

Control ID: 7a94d1a6cf8aabfa144a2fbd8c068ff54757453358562a639027d88552b4c744