SV-257517r1208201_rule
V-257517
SRG-APP-000089-CTR-000150
CNTR-OS-000150
CAT II
10
As the cluster administrator, update the APIServer.config.openshift.io/cluster object to set the profile to the defined level of detail. For example, to configure the profile to WriteRequestBodies, meaning that all write requests to any API server object are logged in their entirety, execute the following:
oc patch apiserver.config.openshift.io/cluster --type=merge -p '{'spec': {'audit': {'profile': 'WriteRequestBodies'}}}'
Where OpenShift Virtualization is enabled:
To remove the errorPolicy flag on the first disk (index 0) of a given VM, use this command:
$ oc patch vm <vm-name> --type='json' -p='[
{"op": "remove", "path":
"/spec/template/spec/domain/devices/disks/0/errorPolicy"},
]'
To determine at what level the OpenShift audit policy logging verbosity is configured, as a cluster-administrator execute the following command:
oc get apiserver.config.openshift.io/cluster -ojsonpath='{.spec.audit.profile}'
If the output from the options does not return WriteRequestBodies or AllRequestBodies, this is a finding.
Where OpenShift Virtualization is enabled:
$ oc get vm -ojson -A | jq '.items[] |
select(.spec.template.spec.domain.devices.disks[].errorPolicy ==
"ignore")| .metadata.namespace + "/" + .metadata.name'
If the results show errorPolicy is set to "ignore", this is a finding.
V-257517
False
CNTR-OS-000150
To determine at what level the OpenShift audit policy logging verbosity is configured, as a cluster-administrator execute the following command:
oc get apiserver.config.openshift.io/cluster -ojsonpath='{.spec.audit.profile}'
If the output from the options does not return WriteRequestBodies or AllRequestBodies, this is a finding.
Where OpenShift Virtualization is enabled:
$ oc get vm -ojson -A | jq '.items[] |
select(.spec.template.spec.domain.devices.disks[].errorPolicy ==
"ignore")| .metadata.namespace + "/" + .metadata.name'
If the results show errorPolicy is set to "ignore", this is a finding.
M
5547