CIS Rancher Benchmark

Security configuration recommendations for SUSE Rancher Kubernetes management

v1.0.0 01-2025

Overview

▶

This benchmark provides prescriptive guidance for establishing a secure configuration posture for Rancher multi-cluster Kubernetes management. It covers authentication and RBAC, cluster hardening profiles, network and pod security, supply chain security, data protection, audit logging, and infrastructure security using the Rancher API and kubectl.

16Recommendations
7Sections
2Profile Levels
SectionAreaFocus
1Authentication & RBACExternal auth providers, global roles, and session management
2Cluster HardeningCIS profiles for managed clusters and certificate management
3Network & Pod SecurityProject isolation, network policies, and Pod Security Admission
4Supply Chain SecurityPrivate registries and approved Helm chart repositories
5Data Protectionetcd encryption at rest and automated backup configuration
6Audit & MonitoringAudit log levels and Prometheus/Grafana monitoring stack
7Infrastructure SecurityTLS certificate management and Fleet GitOps governance

Profile Definitions

▶
ProfileDescriptionIntended Use
L1Level 1 — StandardEssential security for all Rancher deployments; minimal performance impact.
L2Level 2 — HardenedAdvanced hardening for PCI-DSS, HIPAA, or high-security environments.

1 — Authentication & RBAC

▶

1.1 Identity & Access Management

▶
1.1.1 Ensure external authentication provider is configured (Automated)
L1 Auto
Description

This recommendation verifies that external authentication provider is configured on the Rancher Kubernetes management platform. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Rancher Kubernetes management platform vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check Rancher authentication configuration:
kubectl get setting auth-provider-name -o jsonpath='{.value}'

# Check local auth:
curl -sk https://rancher.example.com/v3/settings/auth-provider-name | jq '.value'
Remediation
# Configure external authentication (LDAP/AD):
# Rancher UI > Global Settings > Authentication
# Provider: Active Directory / LDAP / SAML / GitHub

# Via API:
curl -sk -X PUT https://rancher.example.com/v3/settings/auth-provider-name \
  -H 'Authorization: Bearer $RANCHER_TOKEN' \
  -d '{"value": "activedirectory"}'
1.1.2 Ensure global roles follow least-privilege principles (Automated)
L1 Auto
Description

This recommendation verifies that global roles follow least-privilege principles on the Rancher Kubernetes management platform. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Rancher Kubernetes management platform vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# List global roles:
kubectl get globalroles -o custom-columns=NAME:.metadata.name,RULES:.rules

# Check admin users:
curl -sk -H "Authorization: Bearer $RANCHER_TOKEN" \
  https://rancher.example.com/v3/users?role=admin | jq '.data[].username'
Remediation
# Create restricted global role:
curl -sk -X POST -H "Authorization: Bearer $RANCHER_TOKEN" \
  https://rancher.example.com/v3/globalroles \
  -d '{"name": "restricted-user", "rules": [{"apiGroups": ["management.cattle.io"], "resources": ["clusters"], "verbs": ["get", "list"]}]}'
1.1.3 Ensure session timeout is configured (Automated)
L1 Auto
Description

This recommendation verifies that session timeout is configured on the Rancher Kubernetes management platform. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Rancher Kubernetes management platform vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check session settings:
curl -sk -H "Authorization: Bearer $RANCHER_TOKEN" \
  https://rancher.example.com/v3/settings/auth-token-max-ttl-minutes | jq '.value'
curl -sk -H "Authorization: Bearer $RANCHER_TOKEN" \
  https://rancher.example.com/v3/settings/auth-user-session-ttl-minutes | jq '.value'
Remediation
# Set session timeout to 30 minutes:
curl -sk -X PUT -H "Authorization: Bearer $RANCHER_TOKEN" \
  https://rancher.example.com/v3/settings/auth-user-session-ttl-minutes \
  -d '{"value": "30"}'

# Set max token TTL:
curl -sk -X PUT -H "Authorization: Bearer $RANCHER_TOKEN" \
  https://rancher.example.com/v3/settings/auth-token-max-ttl-minutes \
  -d '{"value": "720"}'

2 — Cluster Hardening

▶

2.1 Cluster Configuration

▶
2.1.1 Ensure CIS hardening profile is enabled on managed clusters (Automated)
L1 Auto
Description

This recommendation verifies that CIS hardening profile is enabled on managed clusters on the Rancher Kubernetes management platform. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Rancher Kubernetes management platform vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check cluster RKE2/K3s hardening profile:
kubectl get clusters.management.cattle.io -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.spec.rkeConfig.machineGlobalConfig.profile}{"\n"}{end}'
Remediation
# Set CIS hardening profile on RKE2 cluster:
# Rancher UI > Cluster > Edit Config > Advanced
# Profile: cis-1.23

# Via cluster YAML:
spec:
  rkeConfig:
    machineGlobalConfig:
      profile: cis-1.8
      protect-kernel-defaults: true
2.1.2 Ensure authorized cluster endpoints use valid certificates (Automated)
L1 Auto
Description

This recommendation verifies that authorized cluster endpoints use valid certificates on the Rancher Kubernetes management platform. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Rancher Kubernetes management platform vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check cluster authorized endpoint:
curl -sk -H "Authorization: Bearer $RANCHER_TOKEN" \
  https://rancher.example.com/v3/clusters | \
  jq '.data[] | {name: .name, authorizedEndpoint: .localClusterAuthEndpoint}'
Remediation
# Enable authorized cluster endpoint:
curl -sk -X PUT -H "Authorization: Bearer $RANCHER_TOKEN" \
  https://rancher.example.com/v3/clusters/$CLUSTER_ID \
  -d '{"localClusterAuthEndpoint": {"enabled": true, "caCerts": "...", "fqdn": "cluster.example.com"}}'

# Rotate cluster certificates:
kubectl get secret -n cattle-system tls-rancher-ingress -o yaml

3 — Network & Pod Security

▶

3.1 Isolation & Policies

▶
3.1.1 Ensure project network isolation is enabled (Automated)
L1 Auto
Description

This recommendation verifies that project network isolation is enabled on the Rancher Kubernetes management platform. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Rancher Kubernetes management platform vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check project network isolation:
kubectl get projects.management.cattle.io -A -o custom-columns=NAME:.metadata.name,ISOLATION:.spec.containerDefaultResourceLimit

# Check network policies:
kubectl get networkpolicies -A --no-headers | wc -l
Remediation
# Enable project network isolation:
# Rancher UI > Cluster > Projects/Namespaces > Project > Edit
# Enable: Project Network Isolation

# Apply network policy:
kubectl apply -f - <<'EOF'
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: deny-all
spec:
  podSelector: {}
  policyTypes:
  - Ingress
  - Egress
EOF
3.1.2 Ensure Pod Security Admission is enforced (Automated)
L1 Auto
Description

This recommendation ensures that Pod Security Admission is enforced on the Rancher Kubernetes management platform. Enforcing this requirement establishes a minimum security standard and prevents insecure configurations.

Rationale

Without this enforcement, the Rancher Kubernetes management platform may accept insecure configurations that weaken overall security posture. Mandating this control ensures consistent protection against common attack vectors.

Audit
# Check PSA enforcement:
kubectl get namespaces -o custom-columns=NAME:.metadata.name,PSA:.metadata.labels.pod-security\.kubernetes\.io/enforce

# Check OPA Gatekeeper:
kubectl get constrainttemplates --no-headers | wc -l
Remediation
# Apply Pod Security Admission:
kubectl label namespace production \
  pod-security.kubernetes.io/enforce=restricted \
  pod-security.kubernetes.io/audit=restricted \
  pod-security.kubernetes.io/warn=restricted

# Install OPA Gatekeeper via Rancher:
# Apps > Charts > OPA Gatekeeper > Install

4 — Supply Chain Security

▶

4.1 Image & Chart Governance

▶
4.1.1 Ensure private container registries are configured (Automated)
L1 Auto
Description

This recommendation verifies that private container registries are configured on the Rancher Kubernetes management platform. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Rancher Kubernetes management platform vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check private registry configuration:
curl -sk -H "Authorization: Bearer $RANCHER_TOKEN" \
  https://rancher.example.com/v3/settings/system-default-registry | jq '.value'
Remediation
# Set default system registry:
curl -sk -X PUT -H "Authorization: Bearer $RANCHER_TOKEN" \
  https://rancher.example.com/v3/settings/system-default-registry \
  -d '{"value": "registry.example.com"}'

# Configure registries.yaml on nodes:
mkdir -p /etc/rancher/rke2
cat > /etc/rancher/rke2/registries.yaml <<'EOF'
mirrors:
  docker.io:
    endpoint:
      - "https://registry.example.com"
configs:
  "registry.example.com":
    tls:
      ca_file: /etc/rancher/ssl/ca.crt
EOF
4.1.2 Ensure only approved Helm chart repositories are used (Automated)
L1 Auto
Description

This recommendation verifies that only approved Helm chart repositories are used on the Rancher Kubernetes management platform. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Rancher Kubernetes management platform vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check catalog/helm chart repos:
curl -sk -H "Authorization: Bearer $RANCHER_TOKEN" \
  https://rancher.example.com/v3/catalogs | \
  jq '.data[] | {name: .name, url: .url, branch: .branch}'
Remediation
# Remove untrusted catalogs:
curl -sk -X DELETE -H "Authorization: Bearer $RANCHER_TOKEN" \
  https://rancher.example.com/v3/catalogs/$CATALOG_ID

# Use only approved Helm repos:
helm repo add stable https://charts.helm.sh/stable --force-update
helm repo update

5 — Data Protection

▶

5.1 Encryption & Backups

▶
5.1.1 Ensure etcd encryption at rest is enabled (Automated)
L1 Auto
Description

This recommendation verifies that etcd encryption at rest is enabled on the Rancher Kubernetes management platform. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Rancher Kubernetes management platform vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check etcd encryption:
kubectl get apiserver -o yaml | grep -A5 encryption

# RKE2/K3s check:
ps aux | grep kube-apiserver | grep encryption-provider-config
Remediation
# Enable etcd encryption at rest (RKE2):
# /etc/rancher/rke2/config.yaml:
# secrets-encryption: true

systemctl restart rke2-server

# Verify:
rke2 secrets-encrypt status
5.1.2 Ensure automated etcd backups are configured (Automated)
L1 Auto
Description

This recommendation verifies that automated etcd backups are configured on the Rancher Kubernetes management platform. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Rancher Kubernetes management platform vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check backup configuration:
curl -sk -H "Authorization: Bearer $RANCHER_TOKEN" \
  https://rancher.example.com/v3/etcdbackups | \
  jq '.data[] | {name: .name, created: .created, state: .state}'
Remediation
# Configure automated etcd backups:
# Rancher UI > Cluster > Snapshots > Recurring Snapshots
# Schedule: Every 6 hours
# Retention: 12 snapshots

# S3 backup target:
curl -sk -X POST -H "Authorization: Bearer $RANCHER_TOKEN" \
  https://rancher.example.com/v3/clusters/$CLUSTER_ID?action=backupEtcd \
  -d '{"s3BackupTarget": {"bucketName": "rancher-backups", "endpoint": "s3.amazonaws.com", "accessKey": "...", "secretKey": "..."}}'

6 — Audit & Monitoring

▶

6.1 Logging & Alerting

▶
6.1.1 Ensure Rancher audit logging is enabled (Automated)
L1 Auto
Description

This recommendation verifies that Rancher audit logging is enabled on the Rancher Kubernetes management platform. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Rancher Kubernetes management platform vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check Rancher audit log settings:
curl -sk -H "Authorization: Bearer $RANCHER_TOKEN" \
  https://rancher.example.com/v3/settings/audit-log | jq '.value'

# Check API audit log level:
curl -sk -H "Authorization: Bearer $RANCHER_TOKEN" \
  https://rancher.example.com/v3/settings/audit-level | jq '.value'
Remediation
# Enable audit logging at level 2 (metadata):
curl -sk -X PUT -H "Authorization: Bearer $RANCHER_TOKEN" \
  https://rancher.example.com/v3/settings/audit-level \
  -d '{"value": "2"}'

# Configure cluster audit policy for Kubernetes:
# RKE2 config.yaml:
# kube-apiserver-arg:
#   - audit-policy-file=/etc/rancher/audit-policy.yaml
#   - audit-log-path=/var/log/kube-audit/audit.log
#   - audit-log-maxage=30
6.1.2 Ensure monitoring stack is deployed with security alerting (Automated)
L1 Auto
Description

This recommendation verifies that monitoring stack is deployed with security alerting on the Rancher Kubernetes management platform. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Rancher Kubernetes management platform vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check Rancher monitoring:
kubectl get pods -n cattle-monitoring-system --no-headers
kubectl get servicemonitors -A --no-headers | wc -l
Remediation
# Install Rancher Monitoring (Prometheus + Grafana):
# Rancher UI > Apps > Charts > Monitoring > Install

# Configure alerting:
kubectl apply -f - <<'EOF'
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
  name: security-alerts
  namespace: cattle-monitoring-system
spec:
  groups:
  - name: security
    rules:
    - alert: UnauthorizedAccess
      expr: apiserver_audit_event_total{verb=~"create|delete",code=~"401|403"} > 10
      for: 5m
EOF

7 — Infrastructure Security

▶

7.1 TLS & GitOps

▶
7.1.1 Ensure Rancher uses valid TLS certificates (Automated)
L1 Auto
Description

This recommendation verifies that Rancher uses valid TLS certificates on the Rancher Kubernetes management platform. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Rancher Kubernetes management platform vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check Rancher TLS configuration:
kubectl get ingress -n cattle-system rancher -o jsonpath='{.spec.tls[*].secretName}'

# Check certificate expiry:
openssl s_client -connect rancher.example.com:443 -brief 2>/dev/null | head -3
Remediation
# Rotate Rancher TLS certificate:
kubectl -n cattle-system create secret tls tls-rancher-ingress \
  --cert=tls.crt --key=tls.key --dry-run=client -o yaml | kubectl apply -f -

# For Let's Encrypt:
# Install cert-manager from Rancher Apps
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.14.0/cert-manager.yaml
7.1.2 Ensure Fleet GitOps uses approved repositories only (Automated)
L1 Auto
Description

This recommendation verifies that Fleet GitOps uses approved repositories only on the Rancher Kubernetes management platform. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Rancher Kubernetes management platform vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check Fleet (GitOps) configurations:
kubectl get gitrepos -A -o custom-columns=NAME:.metadata.name,REPO:.spec.repo,BRANCH:.spec.branch

# Check deployment status:
kubectl get bundles -A --no-headers | head -10
Remediation
# Configure Fleet with approved repositories only:
kubectl apply -f - <<'EOF'
apiVersion: fleet.cattle.io/v1alpha1
kind: GitRepo
metadata:
  name: approved-configs
  namespace: fleet-default
spec:
  repo: https://git.example.com/fleet/configs
  branch: main
  paths:
  - /manifests
  targets:
  - clusterSelector:
      matchLabels:
        env: production
EOF