Profile Applicability:
Level 2
Description:
Container images deployed in Google Cloud environments should be scanned for vulnerabilities to ensure they do not contain known security issues. This can be achieved using Google Container Registry (GCR) container scanning or a third-party vulnerability scanning provider.
Rationale:
Vulnerability scanning identifies and mitigates security issues in container images before they are deployed to production environments. By scanning images, you ensure that only secure and trusted images are running in your cloud infrastructure. It is essential to integrate automated vulnerability scanning into your CI/CD pipeline to detect vulnerabilities early in the development cycle and avoid potential risks.
Impact:
Security: Scanning for vulnerabilities ensures that container images are secure before deployment.
Operational Overhead: Integrating vulnerability scanning requires configuring the scanning tools and integrating them into your pipeline.
Compliance: Helps organizations meet compliance requirements such as PCI-DSS, HIPAA, and SOC 2 by ensuring secure software practices.
Default Value:
By default, GCR does not automatically enable vulnerability scanning for container images. Third-party tools may require additional setup and configuration.
Test Plan:
Using Google Cloud Console:
Navigate to Container Registry: Go to Container Registry under Cloud Storage in the Google Cloud Console.
Check Vulnerability Scanning Status:
Select Container Scanning.
Ensure that Container Scanning is enabled. You should see vulnerability reports for the images within the repository.
Repeat for All Repositories: Ensure that all GCR repositories are using vulnerability scanning.
Using Google Cloud CLI:
List All Images in GCR:
Check Vulnerability Scan for an Image:
Run the following command to check if vulnerability scanning is enabled:The output should display any vulnerability reports associated with the image.
Remediation Steps:
Using Google Cloud Console:
Navigate to Container Registry: Go to Container Registry > Settings.
Enable Container Scanning:
Ensure that Container Scanning is enabled in the Security Settings of the project.
Container scanning can be integrated with Cloud Security Command Center to monitor and alert on security issues.
Configure Image Scanning in CI/CD Pipeline:
If using Cloud Build, enable vulnerability scanning as part of the build pipeline.
Configure a policy to block deployment of vulnerable images by integrating with Cloud Build and Container Registry.
Using Google Cloud CLI:
Enable Vulnerability Scanning for GCR:
Enable vulnerability scanning by configuring Container Analysis API:Use gcloud to Trigger Image Scanning:
Run the following command to trigger a scan for your container image:After scanning, review the vulnerability report for any detected issues.
Backout Plan:
Disable Vulnerability Scanning:
If you need to revert vulnerability scanning, you can disable the Container Scanning service:Verify the Change: Ensure that no vulnerability reports are generated by scanning images.
Test the Image Deployment: Ensure that images are still being deployed and run successfully without scanning enabled.
Notify Stakeholders: Communicate to the security team and any stakeholders about the changes to the vulnerability scanning process.
References:
CIS Controls:
Control | Description | IG 1 | IG 2 | IG 3 |
---|---|---|---|---|
3.11 | Encrypt sensitive data at rest using strong encryption algorithms and keys | ✅ | ✅ | ✅ |
14.5 | Ensure systems are configured with appropriate security patches | ✅ | ✅ | ✅ |
8.5 | Implement application security testing, including vulnerability scanning | ✅ | ✅ | ✅ |