|
This is unreleased documentation for SUSE® Virtualization v1.9 (Dev). |
Configuration and Authentication File Security
To harden your SUSE Virtualization cluster, you must verify and enforce strict file ownership and permission controls across all nodes. System configuration files govern storage, networking, and security secrets, while authentication files (such as keys, certificates, and tokens) establish cluster identity. Restricting access to these critical files prevents non-privileged users or compromised processes from altering system settings, exposing sensitive data, or causing cluster instability.
|
Test all recommended ownership and mode settings in a non-production environment before production deployment. Enforcing incorrect permissions can disrupt critical cluster services. |
Auditing file permissions
Verify the permissions of the files and directories listed in the table using the following commands:
cd <PATH>
ls -l
For example, to verify the permissions of the primary RKE2 (server and agent) configuration files and cluster kubeconfig files, run the following commands:
cd var/lib/rancher/rke2
ls -l
| Path | Object | Recommended Ownership | Recommended Mode |
|---|---|---|---|
|
Files |
|
|
|
Files |
|
|
|
Files |
|
|
|
File |
|
|
|
Home directory |
|
|
Varies |
User home directories |
|
|
|
Subdirectories and files |
|
|
|
Files |
|
|
|
Directory and files |
|
|
|
Subdirectories and files |
|
You must also verify that the RKE2 server configuration file on each node contains the following text:
(cat /etc/rancher/rke2/config.yaml)
write-kubeconfig-mode: "0600"
RKE2 agent permissions
The following table lists the recommended modes for objects in /var/lib/rancher/rke2/agent.
| Object | Name | Recommended Mode |
|---|---|---|
Subdirectories |
|
|
Certificate files |
|
|
Key file |
|
|
Kubeconfig files |
|
At least |
RKE2 server permissions
The following table lists the recommended modes for objects in /var/lib/rancher/rke2/server.
| Object | Name | Recommended Mode |
|---|---|---|
Subdirectories |
|
|
Subdirectories |
|
|
Token file |
|
|
Management node configuration files
You can find the configuration files for management (control plane) nodes in the following locations:
| Path | File Description | Recommended Ownership |
|---|---|---|
|
API server pod specification file |
|
|
Controller manager pod specification file |
|
|
Scheduler pod specification file |
|
|
etcd pod specification file |
|
Varies (example: |
Container Network Interface file |
|
|
Admin configuration file |
|
|
Scheduler configuration file |
|
|
Controller manager configuration file |
|
|
etcd data directory |
|
|
Kubernetes PKI directory |
|
|
Kubernetes PKI certificate file |
|
|
Kubernetes PKI key file |
|
Worker node configuration files
You can find the configuration files for worker nodes in the following locations:
| Path | File Description | Recommended Ownership |
|---|---|---|
|
Proxy kubeconfig file |
|
|
kubelet kubeconfig file |
|
|
Certificate authorities file |
|
Mitigating insecure file system permissions
-
Set the correct permissions for insecure files and directories.
-
Files in
/etc/rancher/rke2cd /etc/rancher/rke2 chmod -R 0600 ./* chown -R root:root ./* ls -l -
Files in
/var/lib/rancher/rke2cd /var/lib/rancher/rke2 chown root:root ./* ls -l -
Subdirectories and files in
/var/lib/rancher/rke2/agentcd /var/lib/rancher/rke2/agent chown root:root ./* chmod 0700 pod-manifests chmod 0700 etc find . -maxdepth 1 -type f -name "*.kubeconfig" -exec chmod 0640 {} \; find . -maxdepth 1 -type f -name "*.crt" -exec chmod 0600 {} \; find . -maxdepth 1 -type f -name "*.key" -exec chmod 0600 {} \; ls -l -
Files in
/var/lib/rancher/rke2/bincd /var/lib/rancher/rke2/bin chown root:root ./* chmod 0750 ./* ls -l -
/var/lib/rancher/rke2/datadirectorycd /var/lib/rancher/rke2 chown root:root data chmod 0750 data ls -l -
Files in
/var/lib/rancher/rke2/datacd /var/lib/rancher/rke2/data chown root:root ./* chmod 0750 ./* ls -l -
Files and subdirectories in
/var/lib/rancher/rke2/servercd /var/lib/rancher/rke2/server chown root:root ./* chmod 0700 cred chmod 0700 db chmod 0700 tls chmod 0750 manifests chmod 0750 logs chmod 0600 token ls -l
-
-
Edit the RKE2 server configuration file (
/etc/rancher/rke2/config.yaml) on all nodes and add the following:write-kubeconfig-mode: "0600"After updating the configuration file, restart the RKE2 server.
systemctl restart rke2-server -
Set the correct permission for the Container Network Interface file.
Example:
cd /var/lib/cni/networks chmod -R 600 * ls -l