Least Privilege Principle¶
The Principle of Least Privilege is a core security concept implemented throughout the Secure CINC Auditor Kubernetes Container Scanning solution. This principle ensures that components are granted only the minimum permissions necessary to perform their required functions.
Implementation Details¶
RBAC Configuration¶
All components follow the principle of least privilege through careful RBAC configuration:
- Service accounts have minimal permissions
- Roles are scoped to specific containers, not entire namespaces
- Only required verbs ("get", "list", "create" for exec) are granted
- No cluster-wide permissions are used
Scope Limitation¶
Permissions are limited in scope through several mechanisms:
- Namespace Restriction: Each role is limited to a specific namespace
- Resource Type Limitation: Only
pods
resources are accessible - Verb Restriction: Only specific verbs are permitted
- Resource Name Constraints: When possible, specific pod names are specified
Example RBAC Configuration¶
Security Benefits¶
The least privilege principle provides several security benefits:
- Reduced Attack Surface: Limiting permissions reduces potential attack vectors
- Damage Limitation: If credentials are compromised, the scope of potential damage is minimal
- Compliance Alignment: Many compliance frameworks require least privilege implementation
- Auditability: Clear, minimal permissions are easier to audit and verify
Mitigation of Token Exposure¶
If a token is exposed, the attacker can only:
- List pods in the target namespace
- Execute commands in specifically allowed containers
- View logs of specifically allowed containers
The token cannot be used to:
- Create, modify, or delete any resources
- Access any other containers
- Access any cluster-wide information
- Escalate privileges
Implementation Across Scanning Approaches¶
Scanning Approach | Least Privilege Implementation |
---|---|
Kubernetes API | Minimal RBAC permissions for pod exec |
Debug Container | Minimal RBAC for ephemeral container creation |
Sidecar Container | Minimal RBAC for sidecar deployment |
Related Documentation¶
- Risk Analysis - How least privilege mitigates security risks
- Compliance Documentation - Compliance framework requirements for least privilege
- RBAC Configuration - Detailed RBAC setup instructions