documentation_complete: true

title: Verify Group Who Owns /etc/sudoers.d Directory

description: '{{{ describe_file_group_owner(file="/etc/sudoers.d", group="root") }}}'

rationale: |-
    The ownership of the /etc/sudoers.d directory by the root group is important
    because this directory hosts sudo configuration. Protection of this
    directory is critical for system security. Assigning the ownership to root
    ensures exclusive control of the sudo configuration.

severity: medium

identifiers:
    cce@rhel8: CCE-86340-7
    cce@rhel9: CCE-86351-4
    cce@rhel10: CCE-87598-9
    cce@sle15: CCE-92503-2

ocil_clause: '{{{ ocil_clause_file_group_owner(file="/etc/sudoers.d", group="root") }}}'

ocil: |-
    {{{ ocil_file_group_owner(file="/etc/sudoers.d", group="root") }}}

fixtext: '{{{ fixtext_file_group_owner(file="/etc/sudoers.d", group="root") }}}'

srg_requirement: '{{{ srg_requirement_file_group_owner(file="/etc/sudoers.d", group="root") }}}'

template:
    name: file_groupowner
    vars:
        filepath: /etc/sudoers.d/
        gid_or_name: root
