Chapter 29. Configuring the node agent as a non-root and non-privileged user
To enhance the node agent security, you can configure the OADP Operator node agent daemonset to run as a non-root and non-privileged user by using the spec.configuration.velero.disableFsBackup setting in the DataProtectionApplication (DPA) custom resource (CR).
By setting the spec.configuration.velero.disableFsBackup setting to true, the node agent security context sets the root file system to read-only and sets the privileged flag to false.
Setting spec.configuration.velero.disableFsBackup to true enhances the node agent security by removing the need for privileged containers and enforcing a read-only root file system.
However, it also disables File System Backup (FSB) with Kopia. If your workloads rely on FSB for backing up volumes that do not support native snapshots, then you should evaluate whether the disableFsBackup configuration fits your use case.
Prerequisites
- You have installed the OADP Operator.
Procedure
Configure the
disableFsBackupfield in the DPA as shown in the following example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow where:
nodeAgent- Specifies to enable the node agent in the DPA.
disableFsBackup-
Specifies to set the
disableFsBackupfield totrue.
Verification
Verify that the node agent security context is set to run as non-root and the root file system is
readOnlyby running the following command:oc get daemonset node-agent -o yaml
$ oc get daemonset node-agent -o yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow The example output is as following:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow where:
allowPrivilegeEscalation-
Specifies that the
allowPrivilegeEscalationfield is false. privileged-
Specifies that the
privilegedfield is false. readOnlyRootFilesystem- Specifies that the root file system is read-only.
runAsNonRoot- Specifies that the node agent is run as a non-root user.