Security Overview
Rancher implements comprehensive security controls including authentication, authorization, TLS encryption, audit logging, and security hardening features.Authentication Mechanisms
Rancher’s authentication system is pluggable and supports multiple identity providers simultaneously.Authentication Architecture
Auth Server
Supported Authentication Providers
- Local
- SAML
- OIDC
- LDAP/AD
- OAuth2
Local AuthenticationBuilt-in username/password authentication with:
- PBKDF2 Password Hashing: Industry-standard key derivation
- Secure Storage: Passwords stored in Kubernetes secrets
- Bootstrap Admin: First-time admin user creation
- Password Policies: Configurable complexity requirements
Local User Storage
Bootstrap password can be set via Helm:
--set bootstrapPassword=<password>Authentication Flow
Provider Authentication
Rancher redirects to configured authentication provider (SAML/OIDC) or validates credentials (Local/LDAP)
Token Management
Location:pkg/auth/tokens/
Token Types
Token Purge Daemon
RBAC Model
Rancher implements a hierarchical RBAC system with global, cluster, and project scopes.RBAC Architecture
Location:pkg/rbac/
RBAC Components
Permission Hierarchy
Global Permissions
Global Permissions
Scope: Entire Rancher installationBuilt-in roles:
- admin: Full administrative access
- restricted-admin: Admin without user management
- user: Standard user access
- user-base: Basic authenticated user
- Manage authentication
- Create clusters
- Manage users
- Configure global settings
- Manage catalogs
Global Role Binding
Cluster Permissions
Cluster Permissions
Scope: Specific Kubernetes clusterBuilt-in roles:
- cluster-owner: Full cluster access
- cluster-member: Read/write access
- cluster-viewer: Read-only access
- Manage workloads
- Configure cluster settings
- Manage node pools
- Access kubectl
- View resources
Cluster Role Template Binding
Project Permissions
Project Permissions
Scope: Project within a cluster (namespace group)Built-in roles:
- project-owner: Full project access
- project-member: Create and edit resources
- read-only: View-only access
- Deploy applications
- Manage namespaces in project
- Configure project resources
- Set resource quotas
- Manage certificates and secrets
Project Role Template Binding
Role Templates
Rancher uses RoleTemplates to define permissions:Role Template Structure
Role templates can inherit from other role templates and aggregate permissions.
Access Control Evaluation
TLS and Certificate Management
Location:pkg/tls/
TLS Configuration
Rancher supports multiple TLS termination modes:- Rancher-Generated
- Let's Encrypt
- Custom Certificate
- External TLS
Rancher-Generated Certificates
Helm Configuration
- Self-signed CA generated by Rancher
- Automatic certificate rotation
- Suitable for development/testing
- Not trusted by browsers (requires CA import)
Agent TLS Mode
Location:pkg/settings/
TLS Validation Modes
Private CA Support
Private CA Configuration
Audit Logging
Location:pkg/auth/audit/
Rancher provides comprehensive audit logging for compliance and security monitoring.
Audit Log Configuration
Helm Configuration
Audit Levels
Level 0: Metadata
Logs request metadata:
- User identity
- Request path and method
- Timestamp
- Response code
- Source IP
Audit Log Format
Sample Audit Log Entry
Audit Policies
Location:pkg/controllers/auditlog/auditpolicy/
Custom audit policies can be configured:
Audit Policy CRD
Security Hardening
Pod Security
Rancher supports Pod Security Standards and Pod Security Policies:Pod Security Configuration
Security Context Constraints (OpenShift)
Location:pkg/scc/
For OpenShift deployments:
SCC Support
Network Policies
Rancher can deploy network policies:Network Policy Example
Secret Encryption
Kubernetes secrets are encrypted at rest when etcd encryption is enabled:Encryption Configuration
User and Token Security
User Retention
Location:pkg/auth/userretention/
User Cleanup Policies
Session Management
Session Configuration
Password Policies
For local authentication:Password Requirements
Webhook Authentication
Location:pkg/auth/webhook/
Kubernetes webhook token authenticator integration:
Webhook Config
Security Best Practices
Authentication
Authentication
Use external authentication providers (SAML/OIDC/LDAP)
Enable MFA at the identity provider
Regularly rotate API tokens
Use short-lived kubeconfig tokens
Disable unused authentication providers
Authorization
Authorization
Network Security
Network Security
Enable TLS for all communications
Use strict agent TLS mode
Implement network policies
Restrict ingress access
Use private networks where possible
Audit and Monitoring
Audit and Monitoring
Enable audit logging
Ship logs to SIEM
Monitor authentication failures
Alert on privilege escalation
Regular security reviews
Secrets Management
Secrets Management
Enable etcd encryption
Use external secret stores (Vault)
Rotate secrets regularly
Limit secret access via RBAC
Never commit secrets to git
Security Resources
CIS Benchmark
Rancher provides CIS scanning for Kubernetes clusters
Security Advisories
Check Rancher Security for CVEs
Hardening Guide
Follow official hardening guides for production
Compliance
NIST, PCI-DSS, HIPAA considerations
Related Documentation
Architecture
Overall architecture
Components
Server components
API Security
API authentication