An Azure DevOps pipeline that implements a container quarantine flow for enhanced security. This pipeline automatically scans Docker container images for vulnerabilities using Snyk and only promotes clean images to a private registry.
This pipeline provides an automated security gate for container images by:
- Triggering on container registry webhooks when new images are pushed
- Scanning images for security vulnerabilities using Snyk
- Promoting clean images to a secure private registry
- Alerting on failed scans to prevent vulnerable images from being deployed
- Monitors Azure Container Registry (ACR) for new image pushes
- Triggers automatically when images with media type
application/vnd.oci.image.index.v1+jsonare pushed - Extracts image details (repository, tag, host) from the webhook payload
- Pulls the newly pushed image from the source registry
- Scans the image using Snyk container scanning with:
- Organization:
caris-cloud - Severity threshold:
high(fails on high/critical vulnerabilities) - Fail-fast behavior to prevent vulnerable images from proceeding
- Organization:
- Executes only if the security scan passes
- Pulls the verified image from source registry
- Tags the image with
-snyk-scannedsuffix to indicate it has passed security checks - Pushes the tagged image to the destination registry under the
scanned/repository prefix
- Triggers only if the security scan fails
- Sends Teams notification (if webhook endpoint is configured) about the vulnerable image
- Logs failure details for audit purposes
source-docker-registry-connection: Access to the source container registrydestination-docker-registry-connection: Access to the destination private registrySnyk Auth: Snyk service connection for vulnerability scanning
- Source Registry: Configured via webhook trigger
- Destination Registry:
myregistry.azurecr.io - Snyk Organization:
caris-cloud - Teams Webhook: Optional notification endpoint for scan failures
Source: {source-registry}/{repository}:{tag}
Destination: acrghpmcitodev.azurecr.io/scanned/{repository}:{tag}-snyk-scanned
Example:
- Source:
myregistry.azurecr.io/myapp:v1.0.0 - Destination:
myregistry.azurecr.io/scanned/myapp:v1.0.0-snyk-scanned
- Vulnerability Prevention: Only images that pass Snyk security scans are promoted
- Traceability: Clear naming convention indicates which images have been security validated
- Automated Enforcement: No manual intervention required - security is built into the deployment pipeline
- Alert System: Immediate notification when vulnerable images are detected
- Azure DevOps environment with required service connections
- Snyk account and organization setup
- Source and destination Azure Container Registries
- UkhoSnykScanTask extension installed in Azure DevOps
- Webhook connection configured between source ACR and Azure DevOps