Helm Chart Deployment¶
Overview¶
Security Emphasis
This task implements a secure Helm-based deployment that follows security best practices including proper RBAC isolation, least-privilege service accounts, and secure configuration management, ensuring that your container scanning infrastructure maintains a strong security posture.
This task guides you through deploying Kube CINC Secure Scanner using Helm charts. Helm charts provide a standardized, repeatable method for deploying the scanner infrastructure with proper security controls and configuration.
Time to complete: 30-45 minutes
Security risk: 🟡 Medium - Involves deploying infrastructure components with Kubernetes permissions
Security approach: Implements layered security architecture with proper separation of concerns, RBAC isolation, and secure default configurations
Security Architecture¶
Understanding Permission Layers
Helm deployment of scanner infrastructure involves multiple permission boundaries:
1. Helm Installation Permissions * Control: Ability to deploy Helm charts to the cluster * Risk area: Excessive Helm permissions could allow unauthorized deployments * Mitigation: Use dedicated service accounts with limited scope for Helm operations
2. Chart RBAC Permissions * Control: What permissions are granted to deployed components * Risk area: Overly permissive RBAC in charts could compromise security * Mitigation: Charts implement least-privilege RBAC with proper isolation
3. Runtime Scanner Permissions * Control: What deployed scanner components can access at runtime * Risk area: Insecure configurations could grant excessive access * Mitigation: Implement security contexts, network policies, and proper isolation
Security Prerequisites¶
- Kubernetes cluster with Helm v3 installed
- Administrative access to create namespaces and RBAC resources
- Local machine with kubectl configured for cluster access
- Basic understanding of Helm chart structure and values
- Understanding of Kubernetes setup requirements
Step-by-Step Instructions¶
Step 1: Understand Chart Structure¶
Security Consideration
Understanding the chart structure helps ensure you deploy only the components you need, reducing attack surface.
The Kube CINC Secure Scanner Helm charts follow a modular, layered design:
- scanner-infrastructure: Core RBAC, service accounts, and base infrastructure
- common-scanner: Shared components used by all scanner types
- standard-scanner: For scanning standard containers using Kubernetes API
- distroless-scanner: For scanning distroless containers using ephemeral debug containers
- sidecar-scanner: For scanning containers using the sidecar approach
Step 2: Deploy the Scanner Infrastructure¶
Security Consideration
The scanner infrastructure chart creates the base security components including namespaces, service accounts, and RBAC.
- Clone the repository and navigate to the helm-charts directory:
- Review the infrastructure chart values:
- Create a custom values file for the infrastructure:
- Install the scanner infrastructure:
Step 3: Deploy the Common Scanner Components¶
Security Consideration
The common scanner chart deploys shared components used by all scanner types with secure defaults.
- Review the common scanner values:
- Create a custom values file for common components:
- Install the common scanner components:
Step 4: Deploy a Scanner Type¶
Security Consideration
Choose the scanner type that best matches your security requirements. The standard scanner is the most secure for regular containers.
For Standard Container Scanning¶
- Review the standard scanner values:
- Create a custom values file:
- Install the standard scanner:
For Distroless Container Scanning¶
For Sidecar Container Scanning¶
Step 5: Verify the Deployment¶
- Check that all components deployed successfully:
- Verify RBAC resources:
- Check configmaps for scripts and thresholds:
Step 6: Run a Test Scan¶
Security Consideration
Running a test scan validates that your deployment has the correct permissions while also checking your container security.
- Deploy a test pod:
- Wait for the pod to complete:
- Check the scan results:
Security Best Practices¶
- Review chart values thoroughly before deployment
- Use custom values files rather than modifying chart files directly
- Enable the strictMode RBAC option for tighter security controls
- Configure resource limits for all containers to prevent resource exhaustion
- Implement proper pod security contexts with non-root execution
- Set appropriate threshold values based on your security requirements
- Use a specific image tag rather than 'latest' for production deployments
- Apply network policies to restrict scanner communication
- Store sensitive values in Kubernetes secrets rather than values files
- Regularly update scanner images to include security patches
Verification Steps¶
- Verify service account permissions
- Validate security contexts
- Check resource limits
Troubleshooting¶
Issue | Solution |
---|---|
Helm chart installation fails | Verify Helm version (v3+) and proper cluster access |
Permission denied errors | Check RBAC configuration and service account permissions |
Scanner pods failing to start | Inspect logs with kubectl logs and verify image exists and is accessible |
Security context issues | Verify that your cluster's Pod Security Admission allows the security contexts defined in values |
Charts not finding dependencies | Make sure you're in the helm-charts directory and dependency charts are available |
Next Steps¶
After completing this task, consider:
- Configure scanning thresholds to set appropriate security baselines
- Set up CI/CD integration to automate container scanning
- Implement custom profiles for your specific security requirements
- Configure RBAC for multi-tenant environments to enhance isolation