0
0
Kubernetesdevops~10 mins

Image security scanning in Kubernetes - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - Image security scanning
Start: New Container Image
Trigger Scan on Image
Scan Image for Vulnerabilities
Report Vulnerabilities Found?
NoApprove Image
Yes
Block or Alert
Deploy or Reject Image
The flow starts with a new container image, triggers a scan, checks for vulnerabilities, then either approves or blocks deployment based on scan results.
Execution Sample
Kubernetes
kubectl create deployment myapp --image=myapp:v1
kubectl scan image myapp:v1
# Scan reports vulnerabilities
kubectl rollout status deployment/myapp
This sequence deploys an app, scans its image for vulnerabilities, and checks deployment status.
Process Table
StepActionCommand/CheckResultNext Step
1Create deployment with imagekubectl create deployment myapp --image=myapp:v1Deployment created with image myapp:v1Trigger image scan
2Trigger image scankubectl scan image myapp:v1Scan started for image myapp:v1Scan completes
3Scan completesScan engine analyzes image layersVulnerabilities found: 3 critical, 5 mediumBlock deployment and alert
4Block deploymentPolicy enforcementDeployment paused, alert sent to teamWait for image fix
5Fix image and re-scankubectl scan image myapp:v1-fixedNo vulnerabilities foundApprove deployment
6Approve deploymentkubectl rollout status deployment/myappDeployment successfulEnd
💡 Deployment approved only after image passes security scan with no critical vulnerabilities.
Status Tracker
VariableStartAfter Step 2After Step 3After Step 5Final
image_statusNot scannedScanningVulnerabilities foundNo vulnerabilitiesApproved
deployment_statusNot createdCreatedBlockedPending approvalDeployed
Key Moments - 3 Insights
Why does the deployment get blocked after the scan?
Because the scan found critical vulnerabilities (see execution_table step 3), the policy blocks deployment to keep the system safe.
What happens if no vulnerabilities are found?
The deployment is approved and proceeds (see execution_table step 5 and 6), allowing the app to run safely.
Can deployment proceed before scanning?
No, scanning is mandatory before deployment to ensure security (see execution_table step 2 and 3).
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, what is the image_status after step 3?
AScanning
BVulnerabilities found
CNo vulnerabilities
DApproved
💡 Hint
Check the variable_tracker row for image_status after step 3.
At which step does the deployment get blocked due to vulnerabilities?
AStep 2
BStep 3
CStep 4
DStep 5
💡 Hint
Look at execution_table action and result columns around deployment status.
If the scan found no vulnerabilities at step 3, what would be the next step?
AApprove deployment
BBlock deployment and alert
CFix image and re-scan
DCreate deployment
💡 Hint
Refer to execution_table steps 3 and 5 for flow after scan results.
Concept Snapshot
Image security scanning in Kubernetes:
- Deploy container image
- Trigger scan on image
- Scan checks for vulnerabilities
- If critical found, block deployment
- Fix image and re-scan
- Approve deployment if clean
- Ensures only safe images run
Full Transcript
Image security scanning in Kubernetes starts when a new container image is deployed. The system triggers a scan that checks the image layers for vulnerabilities. If critical vulnerabilities are found, deployment is blocked and alerts are sent. The image must be fixed and rescanned. Once no vulnerabilities remain, the deployment is approved and the application runs safely. This process protects the system by ensuring only secure images are deployed.