# Copyright 2026 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. apiVersion: v1 kind: Namespace metadata: name: cos-auditd --- apiVersion: apps/v1 kind: DaemonSet metadata: name: cleanup-auditd namespace: cos-auditd annotations: kubernetes.io/description: 'DaemonSet that disables Linux auditd logging on non-Autopilot COS nodes.' spec: selector: matchLabels: name: cleanup-auditd template: metadata: labels: name: cleanup-auditd spec: hostPID: true initContainers: - name: auditd-disabler image: gke.gcr.io/gke-distroless/bash command: - /bin/bash - -c - | echo "Disabling auditd services..." chroot /host systemctl disable --now cloud-audit-setup.service || echo "cloud-audit-setup already disabled or not found." chroot /host systemctl disable --now audit-rules.service || echo "audit-rules already disabled or not found." echo "Auditd configuration complete." securityContext: privileged: true volumeMounts: - name: host mountPath: /host resources: requests: memory: 10Mi cpu: 10m limits: cpu: 50m memory: 32Mi containers: - name: pause image: gke.gcr.io/pause:3.8 resources: requests: cpu: 10m memory: 10Mi limits: cpu: 10m memory: 10Mi volumes: - name: host hostPath: path: / tolerations: - effect: NoSchedule operator: Exists - effect: NoExecute operator: Exists