Ensure the --audit-log-maxage argument is set to 30 or as appropriate

Error: The --audit-log-maxage argument is not set appropriately

Bridgecrew Policy ID: BC_K8S_68
Checkov Check ID: CKV_K8S_92
Severity: LOW

The --audit-log-maxage argument is not set appropriately

Description

Retain the logs for at least 30 days or as appropriate. Retaining logs for at least 30 days ensures that you can go back in time and investigate or correlate any events. Set your audit log retention period to 30 days or as per your business requirements.

Fix - Buildtime

Kubernetes

  • Kind: Pod
apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: null
  labels:
    component: kube-apiserver
    tier: control-plane
  name: kube-apiserver
  namespace: kube-system
spec:
  containers:
  - command:
+    - kube-apiserver
+    - --audit-log-maxage=40
    image: gcr.io/google_containers/kube-apiserver-amd64:v1.6.0
    ...

Did this page help you?