volumeMounts:
- mountPath: /etc/kubernetes/audit-policy.yaml
name: audit-policy
readOnly: true
- mountPath: /var/log/kubernetes/audit/
name: audit-log
readOnly: false
volumes:
- name: audit-policy
hostPath:
path: /etc/kubernetes/audit-policy.yaml
type: File
name: audit-log
hostPath:
path: /var/log/kubernetes/audit/
type: DirectoryOrCreate
apiVersion: audit.k8s.io/v1
kind: Policy
omitStages:
"RequestReceived"
rules:
level: Metadata
resources:
group: "" # Indicates the core API group
resources: ["secrets"]
rules:
- level: Metadata
verbs: ["create", "delete"] # Focus on create and delete operations
resources:
- group: "" # Targeting the core API group
resources: ["pods"]
namespaces: ["production"] # Restricting to the 'production' namespace