documentation_complete: true

title: 'Ensure All Files Are Owned by a Group'

description: |-
    If any files are not owned by a group, then the cause of their lack of group-ownership should be investigated.
    Following this, the files should be deleted or assigned to an appropriate group.

rationale: |-
    Unowned files do not directly imply a security problem, but they are generally a sign that something is amiss.
    They may be caused by an intruder, by incorrect software installation or draft software removal, or by failure to remove all files belonging to a deleted account.
    The files should be repaired so they will not cause problems when accounts are created in the future, and the cause should be discovered and addressed.

severity: medium

ocil_clause: 'there is output'

ocil: |-
    The following command will discover and print any
    files on local partitions which do not belong to a valid group.
    <pre>$ sudo find / -xdev -fstype local -nogroup</pre>
    <br />
    Either remove all files and directories from the system that do not have a valid group,
    or assign a valid group with the chgrp command:
    <pre>$ sudo chgrp <i>group</i> <i>file</i></pre>
