documentation_complete: true


title: 'Verify Group Who Owns The Kubernetes Scheduler Kubeconfig File'

description: |-
  {{{ describe_file_group_owner(file="/etc/kubernetes/static-pod-resources/kube-scheduler-pod-*/configmaps/scheduler-kubeconfig/kubeconfig", group="root") }}}

rationale: |-
  The kubeconfig for the Scheduler contains parameters for the scheduler
  to access the Kube API.
  You should set its file ownership to maintain the integrity of the file.

identifiers:
  cce@ocp4: CCE-83471-3


severity: medium

references:
  cis@ocp4: 1.1.16
  nerc-cip: CIP-003-8 R6,CIP-004-6 R3,CIP-007-3 R6.1
  nist: CM-6,CM-6(1)
  srg: SRG-APP-000516-CTR-001325

ocil_clause: '{{{ ocil_clause_file_group_owner(file="/etc/kubernetes/static-pod-resources/kube-scheduler-pod-*/configmaps/scheduler-kubeconfig/kubeconfig", group="root") }}}'

ocil: |-
  {{{ ocil_file_group_owner(file="/etc/kubernetes/static-pod-resources/kube-scheduler-pod-*/configmaps/scheduler-kubeconfig/kubeconfig", group="root") }}}

platform: ocp4-master-node

warnings:
  - dependency: |-
      This rule is only applicable for nodes that run the Kubernetes Scheduler service.
      The aforementioned service is only running on the nodes labeled
      "master" by default.

template:
  name: file_groupowner
  vars:
    filepath: ^/etc/kubernetes/static-pod-resources/kube-scheduler-pod-.*/configmaps/scheduler-kubeconfig/kubeconfig$
    gid_or_name: '0'
    filepath_is_regex: "true"
