RBAC Configuration Guide¶
This guide explains the Role-Based Access Control (RBAC) configuration used for secure container scanning with InSpec.
Directory Contents
For a complete listing of all files in this section, see the RBAC Documentation Inventory.
Overview¶
The RBAC configuration consists of three key components:
- Role: Defines the permissions allowed for scanning containers
- ServiceAccount: The identity used to access the Kubernetes API
- RoleBinding: Links the Role to the ServiceAccount
Basic RBAC Configuration¶
Role¶
The basic Role grants minimal permissions required for container scanning:
Key security aspects:
pods
access is limited toget
andlist
(no create/modify/delete)pods/exec
is limited tocreate
only for specific pods by namepods/log
is limited toget
only for specific pods by name
RoleBinding¶
The RoleBinding links the Role to the ServiceAccount:
Dynamic RBAC Configurations¶
For CI/CD environments, you can create dynamic RBAC configurations:
Label-Based Roles¶
Combined with a RoleBinding that includes a label selector in the subjects section.
Temporary Roles¶
For single-use scans, create temporary roles with a unique identifier:
Additional RBAC Strategies¶
See the following documentation for more specialized RBAC configurations:
- Namespace-Isolated RBAC: Configure RBAC permissions isolated to specific namespaces
- Label-Based Access Control: Secures pods using label selectors
- CI/CD Dynamic Configuration: Demonstrated in the CI/CD examples