The “Write below etc” event in a Kubernetes cluster indicates that a process running within a container is attempting to write or modify files below the “/etc” directory.
This event could potentially indicate unauthorized access or tampering with critical system configuration files.
To investigate further, you can use the following kubectl command to check the logs of the container where the event occurred: kubectl logs <pod_name> -c <container_name>.
Modify the pod’s security context to ensure that the /etc directory is not writable. This can be done by setting the root filesystem to read-only or configuring specific volume mounts.
If your application needs to use configuration files, consider using ConfigMaps or Secrets with read-only access to provide these files. Create a ConfigMap or Secret and mount it as read-only.