1.3.1.10 Ensure SELinux prevents nonprivileged users from executing privileged functions

Information

SELinux should be configured to prevent nonprivileged users from executing privileged functions, including disabling, circumventing, or altering implemented security safeguards/countermeasures.

Privileged functions include, establishing accounts, performing system integrity checks, or administering cryptographic key management activities. Nonprivileged users are individuals who do not possess appropriate authorizations. Circumventing intrusion detection and prevention mechanisms or malicious code protection mechanisms are examples of privileged functions that require protection from nonprivileged users.

Preventing nonprivileged users from executing privileged functions mitigates the risk that unauthorized individuals or processes may gain unnecessary access to information or privileges.

NOTE: Nessus has provided the target output to assist in reviewing the benchmark to ensure target compliance.

Solution

Run the following commands to prevent nonprivileged users from executing privileged functions, including disabling, circumventing, or altering implemented security safeguards/countermeasures:

Use the following command to map a new user to the sysadm_u role:

# semanage login -a -s sysadm_u <username>

Use the following command to map an existing user to the sysadm_u role:

# semanage login -m -s sysadm_u <username>

Use the following command to map a new user to the staff_u role:

# semanage login -a -s staff_u <username>

Use the following command to map an existing user to the staff_u role:

# semanage login -m -s staff_u <username>

Use the following command to map a new user to the user_u role:

# semanage login -a -s user_u <username>

Use the following command to map an existing user to the user_u role:

# semanage login -m -s user_u <username>

Note: SELinux confined users mapped to sysadm_u are not allowed to log in to the system over SSH, by default. If this is a required function, it can be configured by setting the ssh_sysadm_login SELinux boolean to on with the following command:

# sudo setsebool -P ssh_sysadm_login on

See Also

https://workbench.cisecurity.org/benchmarks/19886