Security Risk Assessment¶
Directory Context
This document is part of the Security Directory. See the Security Directory Inventory for related resources.
Overview¶
This document provides a comprehensive security risk assessment for each component of the Secure Kubernetes Container Scanning Helm charts. Understanding these risks will help you implement appropriate security controls and make informed decisions about which scanning approach best meets your security requirements.
Risk Assessment by Chart¶
scanner-infrastructure¶
Risk | Severity | Mitigation |
---|---|---|
Excessive RBAC permissions | High | Use resource names and label selectors |
Long-lived tokens | Medium | Set short token duration (15-30 minutes) |
Namespace pollution | Medium | Use dedicated scanning namespace |
Service account misuse | Medium | Use dedicated service account with minimal permissions |
Cross-namespace access | Medium | Limit RBAC to specific namespaces |
Token leakage | High | Implement token rotation and secure storage |
Mitigation Strategies¶
- Excessive RBAC Permissions: Implement the principle of least privilege by restricting permissions to only what is necessary.
- Long-lived Tokens: Set short token durations and implement token rotation.
common-scanner¶
Risk | Severity | Mitigation |
---|---|---|
Script injection | Medium | Use configMaps with verified script content |
Insecure result storage | Medium | Implement proper result handling and cleanup |
Threshold bypassing | Low | Enable failOnThresholdError option |
Script path traversal | Medium | Validate and sanitize script inputs |
Untrusted profiles | Medium | Use verified profiles from trusted sources |
Mitigation Strategies¶
- Script Injection: Ensure all script content is verified and comes from trusted sources.
- Insecure Result Storage: Implement proper result handling and cleanup.
standard-scanner (Kubernetes API Approach)¶
Risk | Severity | Mitigation |
---|---|---|
Unauthorized container access | Medium | Use resource name restrictions in RBAC |
Command execution in container | Medium | Use read-only access where possible |
Profile privilege escalation | Low | Review profiles for security implications |
Transport plugin vulnerabilities | Low | Keep transport plugin updated |
Mitigation Strategies¶
- Unauthorized Container Access: Use RBAC with resource name restrictions.
- Command Execution: Limit commands executed in target containers.
distroless-scanner (Debug Container Approach)¶
Risk | Severity | Mitigation |
---|---|---|
Debug container privileges | High | Apply security context constraints to debug container |
Process namespace access | Medium | Limit scanning duration |
Ephemeral container persistence | Low | Ensure proper cleanup after scanning |
Host kernel vulnerabilities | Medium | Keep Kubernetes updated with security patches |
Container escape | Medium | Implement multiple layers of security controls |
Mitigation Strategies¶
- Debug Container Privileges: Apply strict security contexts.
- Process Namespace Access: Limit the duration of debug container existence.
sidecar-scanner (Sidecar Container Approach)¶
Risk | Severity | Mitigation |
---|---|---|
Process namespace sharing | High | Apply strict security context to scanner container |
Persistent sidecar presence | Medium | Consider approach tradeoffs carefully |
Resource consumption | Low | Set appropriate resource limits |
Container isolation breach | High | Implement compensating security controls |
Shared kernel vulnerabilities | Medium | Keep Kubernetes updated with security patches |
Mitigation Strategies¶
- Process Namespace Sharing: Apply strict security contexts to the scanner container.
- Persistent Sidecar Presence: Consider the security implications of a persistent scanner container.
Approach Risk Comparison¶
Security Factor | Kubernetes API Approach | Debug Container Approach | Sidecar Container Approach |
---|---|---|---|
Attack Surface | Minimal | Temporary Increase | Persistent Increase |
Container Isolation | Preserved | Temporary Breach | Persistent Breach |
Resource Overhead | Minimal | Temporary | Persistent |
Command Execution | Direct in Container | Limited | Limited |
Security Boundary | Maintained | Temporarily Breached | Persistently Breached |
Overall Risk | Low | Medium | High |
Risk Mitigations by Deployment Environment¶
Development Environment¶
Development environments can implement less restrictive security controls:
Production Environment¶
Production environments should implement maximum security controls:
Multi-Tenant Environment¶
Multi-tenant environments require strict isolation:
Security Standards Compliance¶
The Helm charts can be configured to align with these security standards:
CIS Kubernetes Benchmark¶
- RBAC Limitation: Strict role-based access control
- Namespace Segregation: Isolated scanning namespace
- Service Account Controls: Dedicated service accounts with minimal permissions
- Secret Management: Proper handling of token secrets
NIST SP 800-190 Container Security¶
- Least Privilege: Minimal permissions for scanning operations
- Container Isolation: Maintaining container boundaries where possible
- Image Security: Support for scanning image content
- Runtime Security: Controlled access to container runtimes
Conclusion¶
The Kubernetes API Approach (standard-scanner) provides the strongest security posture and is recommended for production environments. However, all approaches implement strong security controls to minimize risk when properly configured.
For the most secure deployment:
- Use the Kubernetes API Approach where possible
- Implement strict RBAC controls with resource name restrictions
- Keep token lifetimes short (15-30 minutes)
- Apply security contexts to all scanner containers
- Implement network policies to restrict scanner communications
- Regularly update and audit your scanning infrastructure