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

DevToys–A swiss army knife for developers

As a developer there are a lot of small tasks you need to do as part of your coding, debugging and testing activities.  DevToys is an offline windows app that tries to help you with these tasks. Instead of using different websites you get a fully offline experience offering help for a large list of tasks. Many tools are available. Here is the current list: Converters JSON <> YAML Timestamp Number Base Cron Parser Encoders / Decoders HTML URL Base64 Text & Image GZip JWT Decoder Formatters JSON SQL XML Generators Hash (MD5, SHA1, SHA256, SHA512) UUID 1 and 4 Lorem Ipsum Checksum Text Escape / Unescape Inspector & Case Converter Regex Tester Text Comparer XML Validator Markdown Preview Graphic Color B

Help! I accidently enabled HSTS–on localhost

I ran into an issue after accidently enabling HSTS for a website on localhost. This was not an issue for the original website that was running in IIS and had a certificate configured. But when I tried to run an Angular app a little bit later on http://localhost:4200 the browser redirected me immediately to https://localhost . Whoops! That was not what I wanted in this case. To fix it, you need to go the network settings of your browser, there are available at: chrome://net-internals/#hsts edge://net-internals/#hsts brave://net-internals/#hsts Enter ‘localhost’ in the domain textbox under the Delete domain security policies section and hit Delete . That should do the trick…

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.