Security Context
Pod and container security contexts enforce security policies at the runtime level.Pod Security Context
Security context applied to all Dashboard pods.Default configuration:
runAsNonRoot: true- Prevents running as root userseccompProfile.type: RuntimeDefault- Uses the default seccomp profile
null:Container Security Context
Security context applied to all Dashboard containers.Default configuration:
allowPrivilegeEscalation: false- Prevents privilege escalationreadOnlyRootFilesystem: true- Root filesystem is read-onlyrunAsUser: 1001- Runs as non-root user ID 1001runAsGroup: 2001- Runs as group ID 2001capabilities.drop: ["ALL"]- Drops all Linux capabilities
null:CSRF Protection
Cross-Site Request Forgery (CSRF) protection is enabled by default for API and Auth modules.Base64 encoded random 256 bytes string used for CSRF protection.If empty (default): A random key is auto-generated and stored in a Secret.If provided: The specified key is used. This is useful for:
- Maintaining sessions across pod restarts
- Sharing keys across multiple Dashboard instances
CSRF_KEY environment variable.
Network Policy
Network policies control network traffic to and from Dashboard pods.Enable NetworkPolicy resource creation.
Requires a CNI plugin that supports NetworkPolicy (e.g., Calico, Cilium, Weave Net).
Deny all ingress traffic (useful for complete lockdown).When
true, creates an empty ingress rule that blocks all traffic.Raw NetworkPolicy spec that overrides the predefined configuration.
Default Network Policy Behavior
Whenenabled: true and ingressDenyAll: false (and no custom spec), the default policy allows:
Pod Disruption Budget
Pod Disruption Budgets (PDB) ensure availability during voluntary disruptions.Minimum number of pods that must remain available during disruptions.Cannot be used together with
maxUnavailable.Maximum number of pods that can be unavailable during disruptions.Cannot be used together with
minAvailable.RBAC Configuration
Dashboard creates minimal RBAC resources by default. Each module has its own ServiceAccount.API Module RBAC
The API module requires permissions to proxy requests to the metrics-scraper service. ServiceAccount:kubernetes-dashboard-api
Role (namespace-scoped):
Metrics Scraper RBAC
The metrics scraper requires cluster-wide read access to pod and node metrics. ServiceAccount:kubernetes-dashboard-metrics-scraper
ClusterRole:
Web Module RBAC
ServiceAccount:kubernetes-dashboard-web
Role: Minimal permissions (similar to API module).
Auth Module
The Auth module uses the default service account and doesn’t require special RBAC permissions.TLS Configuration
Dashboard uses TLS for secure communication. TLS is handled by the Kong gateway.Certificate Management
When using cert-manager with Ingress:API Server TLS Verification
By default, Dashboard verifies the Kubernetes API server’s TLS certificate. To skip verification (not recommended for production):Custom CA Bundle
If your API server uses a custom CA:Example Security Configurations
High Security Production Setup
Restrictive Network Policy
Minimal RBAC with User Permissions
Dashboard relies on user authentication and impersonation. To grant users access:Security Best Practices
- Always use HTTPS: Enable TLS on Ingress
- Enable Network Policies: Restrict traffic to/from Dashboard
- Use Pod Disruption Budgets: Ensure availability with multiple replicas
- Never disable CSRF protection in production
- Use read-only root filesystem: Already enabled by default
- Drop all capabilities: Already configured by default
- Run as non-root: Already configured by default
- Verify API server certificates: Don’t use
--apiserver-skip-tls-verifyin production - Use external secret management: For CSRF keys and sensitive data
- Grant minimal RBAC permissions: Users should only have access to what they need
Related Configuration
- Ingress Configuration - TLS and cert-manager setup
- Arguments Reference - Security-related command-line arguments
- Helm Values Reference - Complete configuration reference