Skip to main content

Towards more secure containerized workloads –Part 2

Yesterday I introduced the concept of an SBOM, a Software Bill Of Materials. An SBOM lists all the components that make up the software , or were used to build it.

I showed you how to use the docker sbom command to generate such an SBOM for your container images. Today I want to show you how you can use this generated SBOM to check for vulnerabilities. The tool we want to use for this is Grype.

Install Grype on Windows

Out of the box, Grype is only built for Linux and MacOS.  As I’m a Windows user, probably the easiest way to get Grype running on your system is through WSL(Windows Subsystem for Linux).

Open up a terminal to your installed Linux Distribution(I typically use Windows Terminal), or if you didn’t have a Linux distribution installed yet, install a distribution of your choice:

wsl --install -d Ubuntu
Downloading: Ubuntu
Installing: Ubuntu
Ubuntu has been installed.
Launching Ubuntu...

After the installation has completed, a new menu item is added that opens a terminal window to your installed distribution and an extra entry is added to Windows Terminal(if installed on your machine).

Now we can download and install Grype using the following command:

sudo curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sh -s -- -b /mnt/c/dev/bin/grype/

This is how the output looked like on my machine:

bawu@MININT-9ABLAQJ:~$ sudo curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sh -s -- -b /mnt/c/dev/bin/grype
[info] checking github for the current release tag
[info] fetching release script for tag='v0.35.0'
[info] checking github for the current release tag
[info] using release tag='v0.35.0' version='0.35.0' os='linux' arch='amd64'
[info] installed /mnt/c/dev/bin/grype

Check for vulnerabilities

Now that we have succesfully installed Grype, we can execute it using the following command:

grype sbom:<locationofyoursbomfile>

Here is an example where I had the sbom generated on my c: drive under c:\users\bawu

bawu@MININT-9ABLAQJ:~$ grype sbom:/mnt/c/users/bawu/sbom.json
Vulnerability DB        [updated]
  Scanned image           [75 vulnerabilities]

NAME          INSTALLED   FIXED-IN    TYPE  VULNERABILITY   SEVERITY
busybox       1.33.1-r3   1.33.1-r5   apk   CVE-2021-42375  Medium
busybox       1.33.1-r3   1.33.1-r7   apk   CVE-2022-28391  Critical
busybox       1.33.1-r3   1.33.1-r6   apk   CVE-2021-42380  High
busybox       1.33.1-r3   1.33.1-r6   apk   CVE-2021-42381  High
busybox       1.33.1-r3   1.33.1-r6   apk   CVE-2021-42382  High
busybox       1.33.1-r3   1.33.1-r6   apk   CVE-2021-42383  High
busybox       1.33.1-r3   1.33.1-r6   apk   CVE-2021-42384  High
busybox       1.33.1-r3   1.33.1-r6   apk   CVE-2021-42378  High
busybox       1.33.1-r3   1.33.1-r6   apk   CVE-2021-42386  High
busybox       1.33.1-r3   1.33.1-r4   apk   CVE-2021-42374  Medium
busybox       1.33.1-r3   1.33.1-r6   apk   CVE-2021-42379  High
busybox       1.33.1-r3   1.33.1-r6   apk   CVE-2021-42385  High
expat         2.4.1-r0    2.4.3-r0    apk   CVE-2022-22822  Critical
expat         2.4.1-r0    2.4.5-r0    apk   CVE-2022-25314  High
expat         2.4.1-r0    2.4.3-r0    apk   CVE-2022-22824  Critical
expat         2.4.1-r0    2.4.4-r0    apk   CVE-2022-23990  Critical
expat         2.4.1-r0    2.4.3-r0    apk   CVE-2022-22826  High
expat         2.4.1-r0    2.4.5-r0    apk   CVE-2022-25313  Medium
expat         2.4.1-r0    2.4.3-r0    apk   CVE-2022-22825  High
expat         2.4.1-r0    2.4.4-r0    apk   CVE-2022-23852  Critical
expat         2.4.1-r0    2.4.3-r0    apk   CVE-2022-22827  High
expat         2.4.1-r0    2.4.3-r0    apk   CVE-2021-45960  High
expat         2.4.1-r0    2.4.3-r0    apk   CVE-2021-46143  High
expat         2.4.1-r0    2.4.3-r0    apk   CVE-2022-22823  Critical
expat         2.4.1-r0    2.4.5-r0    apk   CVE-2022-25315  Critical
expat         2.4.1-r0    2.4.5-r0    apk   CVE-2022-25235  Critical
expat         2.4.1-r0    2.4.5-r0    apk   CVE-2022-25236  Critical
libcrypto1.1  1.1.1l-r0   1.1.1n-r0   apk   CVE-2022-0778   High
libcrypto1.1  1.1.1l-r0               apk   CVE-2021-4160   Medium
libretls      3.3.3p1-r2  3.3.3p1-r3  apk   CVE-2022-0778   High
libssl1.1     1.1.1l-r0               apk   CVE-2021-4160   Medium
libssl1.1     1.1.1l-r0   1.1.1n-r0   apk   CVE-2022-0778   High
ssl_client    1.33.1-r3   1.33.1-r5   apk   CVE-2021-42375  Medium
ssl_client    1.33.1-r3   1.33.1-r6   apk   CVE-2021-42379  High
ssl_client    1.33.1-r3   1.33.1-r6   apk   CVE-2021-42381  High
ssl_client    1.33.1-r3   1.33.1-r7   apk   CVE-2022-28391  Critical
ssl_client    1.33.1-r3   1.33.1-r6   apk   CVE-2021-42378  High
ssl_client    1.33.1-r3   1.33.1-r6   apk   CVE-2021-42385  High
ssl_client    1.33.1-r3   1.33.1-r6   apk   CVE-2021-42386  High
ssl_client    1.33.1-r3   1.33.1-r6   apk   CVE-2021-42380  High
ssl_client    1.33.1-r3   1.33.1-r6   apk   CVE-2021-42383  High
ssl_client    1.33.1-r3   1.33.1-r6   apk   CVE-2021-42382  High
ssl_client    1.33.1-r3   1.33.1-r6   apk   CVE-2021-42384  High
ssl_client    1.33.1-r3   1.33.1-r4   apk   CVE-2021-42374  Medium
xz-libs       5.2.5-r0    5.2.5-r1    apk   CVE-2022-1271   Unknown
zlib          1.2.11-r3   1.2.12-r0   apk   CVE-2018-25032  High

Looks like we have some work to do…

Popular posts from this blog

Azure DevOps/ GitHub emoji

I’m really bad at remembering emoji’s. So here is cheat sheet with all emoji’s that can be used in tools that support the github emoji markdown markup: All credits go to rcaviers who created this list.

Kubernetes–Limit your environmental impact

Reducing the carbon footprint and CO2 emission of our (cloud) workloads, is a responsibility of all of us. If you are running a Kubernetes cluster, have a look at Kube-Green . kube-green is a simple Kubernetes operator that automatically shuts down (some of) your pods when you don't need them. A single pod produces about 11 Kg CO2eq per year( here the calculation). Reason enough to give it a try! Installing kube-green in your cluster The easiest way to install the operator in your cluster is through kubectl. We first need to install a cert-manager: kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.14.5/cert-manager.yaml Remark: Wait a minute before you continue as it can take some time before the cert-manager is up & running inside your cluster. Now we can install the kube-green operator: kubectl apply -f https://github.com/kube-green/kube-green/releases/latest/download/kube-green.yaml Now in the namespace where we want t...

Podman– Command execution failed with exit code 125

After updating WSL on one of the developer machines, Podman failed to work. When we took a look through Podman Desktop, we noticed that Podman had stopped running and returned the following error message: Error: Command execution failed with exit code 125 Here are the steps we tried to fix the issue: We started by running podman info to get some extra details on what could be wrong: >podman info OS: windows/amd64 provider: wsl version: 5.3.1 Cannot connect to Podman. Please verify your connection to the Linux system using `podman system connection list`, or try `podman machine init` and `podman machine start` to manage a new Linux VM Error: unable to connect to Podman socket: failed to connect: dial tcp 127.0.0.1:2655: connectex: No connection could be made because the target machine actively refused it. That makes sense as the podman VM was not running. Let’s check the VM: >podman machine list NAME         ...