{"description": "Configure the operating system to elevate the SELinux context when an administrator calls\nthe sudo command.\nEdit a file in the /etc/sudoers.d directory with the following command:\n<pre>sudo visudo -f /etc/sudoers.d/<i>CUSTOM_FILE</i></pre>\nUse the following example to build the <i>CUSTOM_FILE</i> in the /etc/sudoers.d directory\nto allow any administrator belonging to a designated sudoers admin group to elevate their\nSELinux context with the use of the sudo command:\n<pre>%wheel ALL=(ALL) TYPE=sysadm_t ROLE=sysadm_r ALL</pre>", "rationale": "Preventing non-privileged users from executing privileged functions mitigates\nthe risk that unauthorized individuals or processes may gain unnecessary access\nto information or privileges.\n<br /><br />\nPrivileged functions include, for example,\nestablishing accounts, performing system integrity checks, or administering\ncryptographic key management activities. Non-privileged users are individuals\nwho do not possess appropriate authorizations. Circumventing intrusion detection\nand prevention mechanisms or malicious code protection mechanisms are examples\nof privileged functions that require protection from non-privileged users.", "severity": "medium", "references": {"nist": ["AC-3(4)", "AC-6(10)"], "srg": ["SRG-OS-000324-GPOS-00125"]}, "control_references": {}, "components": [], "identifiers": {}, "ocil_clause": "selinux context does not elevate when running sudo command", "ocil": "Verify the operating system elevates the SELinux context when an administrator calls the\nsudo command with the following command:\n<br /><br />\nThis command must be ran as root:\n<pre>grep sysadm_r /etc/sudoers.d/*\n%wheel ALL=(ALL) TYPE=sysadm_t ROLE=sysadm_r ALL\n</pre>", "oval_external_content": null, "fixtext": "", "checktext": "", "vuldiscussion": "", "srg_requirement": "", "warnings": [], "conflicts": [], "requires": [], "policy_specific_content": {"stig": {"srg_requirement": "Ubuntu 22.04 must elevate the SELinux context when an administrator calls the sudo command.", "vuldiscussion": "Without verification of the security functions, security functions may not operate correctly and the failure may go unnoticed. Security function is defined as the hardware, software, and/or firmware of the information system responsible for enforcing the system security policy and supporting the isolation of code and data on which the protection is based. Security functionality includes, but is not limited to, establishing system accounts, configuring access authorizations (i.e., permissions, privileges), setting events to be audited, and setting intrusion detection parameters.\n\nThis requirement applies to operating systems performing security function verification/testing and/or systems and environments that require this functionality.\n\nPreventing nonprivileged users from executing privileged functions mitigates the risk that unauthorized individuals or processes may gain unnecessary access to information or privileges.\n\nPrivileged functions include, for example, 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.", "checktext": "Verify that Ubuntu 22.04 elevates the SELinux context when an administrator calls the sudo command with the following command:\n\nThis command must be run as root:\n\n# grep -r sysadm_r /etc/sudoers /etc/sudoers.d\n%{designated_group_or_user_name} ALL=(ALL) TYPE=sysadm_t ROLE=sysadm_r ALL\n\nIf conflicting results are returned, this is a finding.\n\nIf a designated sudoers administrator group or account(s) is not configured to elevate the SELinux type and role to \"sysadm_t\" and \"sysadm_r\" with the use of the sudo command, this is a finding.", "fixtext": "Configure Ubuntu 22.04 to elevate the SELinux context when an administrator calls the sudo command.\n\nEdit a file in the \"/etc/sudoers.d\" directory with the following command:\n\n$ sudo visudo -f /etc/sudoers.d/<customfile>\n\nUse the following example to build the <customfile> in the /etc/sudoers.d directory to allow any administrator belonging to a designated sudoers admin group to elevate their SELinux context with the use of the sudo command:\n\n%{designated_group_or_user_name} ALL=(ALL) TYPE=sysadm_t ROLE=sysadm_r ALL\n\nRemove any configurations that conflict with the above from the following locations:\n\n/etc/sudoers\n/etc/sudoers.d/"}}, "platform": null, "platforms": [], "sce_metadata": {}, "inherited_platforms": ["system_with_kernel"], "cpe_platform_names": [], "inherited_cpe_platform_names": ["system_with_kernel"], "bash_conditional": null, "fixes": {}, "title": "Elevate The SELinux Context When An Administrator Calls The Sudo Command", "definition_location": "/aptdata/openscap/scap-security-guide/linux_os/guide/system/selinux/selinux_context_elevation_for_sudo/rule.yml", "template": null}