Script-based Deployment¶
This guide focuses on deploying the Secure CINC Auditor Kubernetes Container Scanning solution using shell scripts.
Overview¶
Script-based deployment is ideal for:
- Development environments
- Testing and evaluation
- One-off scanning operations
- Quick deployment without Helm
The project provides several helper scripts that simplify the deployment and operation of the scanner.
Key Scripts¶
The following scripts are available in the /scripts
directory:
setup-minikube.sh
: Sets up a Minikube environment for testingscan-container.sh
: Scans a standard container using the Kubernetes API approachscan-distroless-container.sh
: Scans a distroless container using debug containersscan-with-sidecar.sh
: Scans a container using the sidecar approachgenerate-kubeconfig.sh
: Generates a restricted kubeconfig for scanning
Local Development Environment¶
For development and testing, you can use Minikube:
Optional Parameters¶
The scan scripts support various optional parameters:
Production Environment¶
For production environments, additional setup is required:
Customizing Scripts¶
The scripts can be customized for specific environments:
- Create copies of the scripts with your modifications
- Adjust parameters like timeouts, namespace names, and resource configurations
- Add custom pre/post processing steps as needed
Script Workflow¶
The script-based deployment follows this general workflow:
- Setup: Create necessary resources (namespaces, service accounts, roles)
- Configuration: Generate or provide restricted kubeconfig
- Execution: Run the appropriate scan script for your container type
- Reporting: Process scan results and generate reports
- Cleanup: Remove temporary resources and credentials
Environment Variables¶
The scripts respect several environment variables that can be used to customize behavior:
KUBECONFIG
: Path to the Kubernetes configuration fileINSPEC_PROFILE_PATH
: Default path for InSpec profilesSCANNER_NAMESPACE
: Default namespace for scanner resourcesTHRESHOLD_FILE
: Path to a threshold file for validation
Example usage:
Troubleshooting¶
Common issues with script-based deployment:
- Permission Errors:
- Ensure your current user has sufficient Kubernetes permissions
-
Check that service accounts have been properly created and bound to roles
-
Connectivity Issues:
- Verify that your KUBECONFIG points to the correct cluster
-
Check network connectivity between your machine and the Kubernetes API
-
Script Failures:
- Ensure scripts are executable (
chmod +x scripts/*.sh
) - Check for bash version compatibility (Bash 4+ recommended)
- Verify that all required tools are installed and in your PATH