Exclude agent directories from node tamper detection
If a host agent installs or updates its own programs under /var, Syself's node tamper detection may report these changes via the NodeTampered condition. Use the tamperIgnorePaths cluster variable to exclude the directories where the agent writes its binaries.
What does tamper detection check?
Every three minutes, each node checks its writable /var partition for unexpected changes.
The check covers two things:
- Protected files: Files such as cluster CA keys and static pod manifests are checked against their expected state.
- Executable files: The node scans
/varfor added, modified, or removed files that have an execute bit, setuid or setgid permissions, or are shared libraries. Ordinary data files are not included.
A change to a protected file or a detected executable raises the NodeTampered condition.
See Node and OS security for details about the tamper detection mechanism and Node health conditions for information about NodeTampered.
Configure the excluded directories
Add tamperIgnorePaths to spec.topology.variables on your Cluster object.
For example, if two agents install their binaries under /var/lib/myagent/bin and /var/opt/othervendor/sensor, configure:
apiVersion: cluster.x-k8s.io/v1beta2
kind: Cluster
metadata:
name: mycluster
spec:
topology:
variables:
- name: tamperIgnorePaths
value:
- /var/lib/myagent/bin
- /var/opt/othervendor/sensor
Each entry must follow these rules:
- It must be an absolute path under
/varwith at least three path components. For example,/var/lib/myagentis valid, but/var/libis not. - Path components can contain only letters, digits,
.,_, and-. - A component cannot start with a dot. This also prevents paths such as
... - Wildcards and trailing slashes are not allowed.
- You can specify up to 64 paths.
An excluded directory also excludes everything below it.
Protected paths cannot be excluded
Some directories contain files that are essential to node security. You cannot exclude these paths, their parent directories, or directories below them.
The protected paths include:
/var/lib/kubernetes/pki— CA certificates, keys, and service-account signing keys./var/lib/kubernetes/manifests— static pod manifests./var/lib/kubernetes/kubeadm-config.yaml/var/lib/syself/ld.so.cache/var/lib/nvidia/liband/var/lib/nvidia/bin
For example, /var/lib/kubernetes, /var/lib/syself, and /var/lib/nvidia are also rejected because they contain protected paths.
Apply the change
Changing tamperIgnorePaths triggers a rollout of the control plane and all worker pools.
Collect all required paths and apply them in a single change rather than updating the list one directory at a time.
If a node had previously raised NodeTampered, it will be replaced during the rollout. If you need to keep a record of the previous condition, save its status and the autopilot.syself.com/tamper annotation before the rollout.
Keep exclusions narrow
An excluded directory is no longer checked for executable-file changes. An attacker with root access to the node could place a program there without triggering NodeTampered.
Only exclude the directory the agent uses for its binaries. For example, prefer /var/lib/myagent/bin over /var/lib/myagent if the latter also contains configuration or other data.
You can complement tamper detection with runtime threat detection , which monitors running processes rather than changes to files on disk.
Related
Respond to a tampered node
What to do when a node raises NodeTampered, SealedOSTampered, or VerityCorruption, preserve evidence first, rotate exposed credentials, then reprovision the node.
Manage access and tenancy
How to give users and teams exactly the Kubernetes access they need, without handing out admin rights. Covers the hardened API server, least-privilege RBAC bound to OIDC, and per-cluster isolation.