Secure your container images before deployment with Vulnerability Advisor
(Ed.–This post covers 1 of 3 related tutorials you can do around Kubernetes-based application development. At the end, the author mentions the other two–on creating a highly scalable web app in Kubernetes, and on setting up log data visualization.)
This section of an overall solution tutorial called “Continuous deployment to Kubernetes“covers the Vulnerability Advisor tool, which checks the security status of container images both before deployment while the containerized app is running.
If you follow the initial steps in the solution tutorial, you will create a Kubernetes cluster, an Express NodeJS app, and a toolchain to continuously deploy the app updates. You will be then ready to use the Vulnerability Advisor as part of a DevOps pipeline.
Security using Vulnerability Advisor
Go to the toolchain you created under DevOps toolchains and click the Delivery Pipeline tile.
Click on Add Stage and change MyStage to Validate Stage.
Click on JOBS > ADD JOB.
Select Test as the Job Type and Change Test to Vulnerability advisor in the box.
Under Tester type, select Vulnerability Advisor. All the other fields should be populated automatically.
Drag and move the Validate Stage to the middle. Container Registry namespace should be same as the one mentioned in Build Stage of this toolchain.
on the Validate Stage.You will see that the Validate stage fails.
Let’s fix the vulnerabilities.
Open the cloned repository in an IDE or select Eclipse Orion web IDE tile, open
Dockerfileand add the below command after
RUN apt-get update && apt-get install -y \ libc6 \ systemd \ sensible-utils \ isc-dhcp-client
Commit and Push the changes. This should trigger the toolchain and fix the Validate Stage.
git add Dockerfile git commit -m "Fix Vulnerabilities" git push origin master
More about Vulnerability Advisor
Seeing the logs and history, you may have figured out that Vulnerability Advisor provides security management for IBM Cloud Kubernetes Service. Vulnerability Advisor generates a security status report, suggests fixes and best practices, and provides management to restrict nonsecure images from running. Fixing the security and configuration issues that are reported by Vulnerability Advisor can help you secure your IBM Cloud infrastructure.
Vulnerability Advisor includes the following features:
Scans images for vulnerabilities
Provides an evaluation report based on security standards and security practices specific to IBM Cloud Container Service
Detects file-based malware
Provides recommendations to secure configuration files for a subset of application types
In the Registry dashboard, the SECURITY REPORT column displays the status of your repositories. The report identifies good cloud security practices for your images.
The Vulnerability Advisor dashboard provides an overview and assessment of the security for an image. To find out more about the Vulnerability Advisor dashboard, see Reviewing a vulnerability report.
As part of the full tutorial, you will setup Slack integration to send notifications on your pipeline stages to a specific channel.
With your pipeline and auto-notifications in place, follow up with another tutorial to add data visualization and analytics to the logging and monitoring that comes with your Kubernetes cluster. And consider doing the tutorial on developing a highly scalable web app. While you’re at it, consider what’s involved in adding a chatbot to that web experience; here’s how online-only banker UBank did it.