documentation_complete: true


title: 'Kubernetes Pod Logs Must Be Group Owned By Root'

platform: ocp4-node

description: |-
    All logs must be owned by root user and group and have permissions
    755. By default, the path for the Kubernetes pod logs is
    <pre>/var/log/pods/</pre>.

rationale: |-
    Pod log files may contain sensitive information such as application
    data, user credentials, or system configurations. Unauthorized access
    to these log files can expose sensitive data to malicious actors. By
    setting owner permissions, OpenShift ensures that only authorized users
    or processes with the necessary privileges can access the pod log files,
    preserving the confidentiality of the logged information.

severity: medium

identifiers:
    cce@ocp4: CCE-88589-7

references:
    srg: SRG-APP-000118-CTR-000240

ocil_clause: |-
    {{{ ocil_clause_file_group_owner(file="/var/log/pods/*", group="root") }}}

ocil: |-
    {{{ describe_file_group_owner(file="/var/log/pods/*", group="root") }}}

template:
    name: file_groupowner
    vars:
        filepath: ^/var/log/pods/.*$
        filepath_is_regex: 'true'
        gid_or_name: '0'
