How-tos

Secure your container images before deployment with Vulnerability Advisor

Share this post:

(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.

Start the full tutorial

Security using Vulnerability Advisor

  1. Go to the toolchain you created under DevOps toolchains and click the Delivery Pipeline tile.
  2. Click on Add Stage and change MyStage to Validate Stage.
  3. Click on JOBS > ADD JOB.
  4. Select Test as the Job Type and Change Test to Vulnerability advisor in the box.
  5. Under Tester type, select Vulnerability Advisor. All the other fields should be populated automatically.
  6. 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.
  7. Click Run 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 Dockerfile and add the below command after EXPOSE 3000

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 should have figured out that Vulnerability Advisor provides security management for IBM Cloud Container 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
  • Provides instructions on how to fix a reported vulnerable package or configuration issue in its reports

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.

Slack Integration

As part of the full tutorial, you will setup Slack integration to send notifications on your pipeline stages to a specific channel.

Start the Vulnerability Advisor tutorial

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.

More How-tos stories

Speed up your WordPress with IBM Cloud

WordPress is one of the most popular content management systems available, but the many websites and blogs that use it experience issues with speed. At IBM Cloud, there are several solutions that can help alleviate some of these issues and allow you to have a better and faster WordPress experience.

Continue reading

Container Native Monitoring Insights with Elastic on IBM Cloud

Introduction to container native monitoring In this blog post, we will discuss how Elastic easily deploys with the IBM Cloud Kubernetes Service (IKS). This provides full visibility of your containerized workloads and operational consistency with container deployments in a multi-cloud architecture. We will deploy a Kubernetes cluster in IBM Cloud and layer in the Elastic […]

Continue reading

Build, Deploy, and Scale Real-World Solutions on IBM Cloud

IBM Cloud Solution Tutorials give you step-by-step instructions to create applications running on virtual servers, Kubernetes, Cloud Foundry, and serverless architectures. The tutorials also cover topics ranging from web and mobile applications, chatbots, IoT, and machine learning and analytics.

Continue reading