CNTR-K8-000450 - Kubernetes DynamicAuditing must not be enabled - manifest

Information

Protecting the audit data from change or deletion is important when an attack occurs. One way an attacker can cover their tracks is to change or delete audit records. This will either make the attack unnoticeable or make it more difficult to investigate how the attack took place and what changes were made. The audit data can be protected through audit log file protections and user authorization.

One way for an attacker to thwart these measures is to send the audit logs to another source and filter the audited results before sending them on to the original target. This can be done in Kubernetes through the configuration of dynamic audit webhooks through the DynamicAuditing flag.

Solution

On the Control Plane, change to the manifests' directory at /etc/kubernetes/manifests and run the command:
grep -i feature-gates *

If any '--feature-gates' setting is available and contains the 'DynamicAuditing' flag, remove the flag or set it to false.

On the each Control Plane and Worker Node, run the command:
ps -ef | grep kubelet

Remove the '--feature-gates option' if present.

Note the path to the config file (identified by: --config).

Edit the Kubernetes Kubelet config file:
If the 'featureGates' setting is present, remove the 'DynamicAuditing' flag or set the flag to false.

Restart the kubelet service using the following command:
service kubelet restart

See Also

https://dl.dod.cyber.mil/wp-content/uploads/stigs/zip/U_Kubernetes_V1R11_STIG.zip

Item Details

Category: ACCESS CONTROL

References: 800-53|AC-3, CAT|II, CCI|CCI-000213, Rule-ID|SV-242398r918161_rule, STIG-ID|CNTR-K8-000450, Vuln-ID|V-242398

Plugin: Unix

Control ID: f49a459a2f0a64dc5ab5444d2813d1ed01c5ae10b5f21f62dc7031e3f4bec49e