Infrastructure RBAC Configuration¶
Directory Context
This document is part of the Infrastructure Directory. See the Infrastructure Directory Inventory for related resources.
Overview¶
The scanner-infrastructure
chart implements a robust Role-Based Access Control (RBAC) model for securing container scanning operations. This document details the RBAC configuration options and best practices for different deployment scenarios.
RBAC Implementation¶
Core Permissions¶
The scanner requires these core permissions:
These permissions enable:
- Listing pods in the target namespace
- Executing commands in pods (for Kubernetes API scanning)
- Getting pod details (for all scanning approaches)
Ephemeral Container Support¶
For distroless container scanning, additional permissions are needed:
These permissions enable:
- Creating ephemeral debug containers
- Attaching to target containers
Security Controls¶
Resource Name Restrictions¶
For enhanced security, you can restrict access to specific pods:
This restricts the scanner to only access the specifically named pods.
Label Selector Restrictions¶
Alternatively, you can use label selectors for dynamic access control:
This restricts the scanner to only access pods with the specified labels.
Multi-Team RBAC¶
For multi-team environments, create separate roles and bindings:
Custom RBAC Rules¶
Add additional permissions as needed:
Configuration Reference¶
Parameter | Description | Default | Required |
---|---|---|---|
rbac.create |
Create RBAC resources | true |
No |
rbac.roleName |
Name of the role | scanner-role |
No |
rbac.roleBindingName |
Name of the role binding | scanner-rolebinding |
No |
rbac.useResourceNames |
Restrict to specific pod names | false |
No |
rbac.resourceNames |
List of allowed pod names | [] |
No |
rbac.useLabelSelector |
Use label selector restrictions | false |
No |
rbac.podSelectorLabels |
Labels for pod selection | {} |
No |
rbac.rules.core.enabled |
Enable core RBAC rules | true |
No |
rbac.rules.ephemeralContainers.enabled |
Enable ephemeral container rules | false |
No |
rbac.extraRules |
Additional RBAC rules | [] |
No |
Best Practices¶
- Follow Least Privilege: Always use the minimum permissions required
- Prefer Label Selectors: Use labels for dynamic access control
- Limit Namespace Scope: Use separate roles for different namespaces
- Audit RBAC Regularly: Review and update RBAC configuration regularly
- Disable Unused Rules: Disable ephemeral container permissions if not needed