Skip to main content

Towards more secure containerized workloads

One element to improve the security of your software systems, is the Software Bill Of Materials(SBOM). Today most applications are build using a combination of open source and commercial software components. The SBOM lists all the components that make up the software , or were used to build it.

The concept of a BOM is well-established in traditional manufacturing as part of supply chain management.A manufacturer uses a BOM to track the parts it uses to create a product. If defects are later found in a specific part, the BOM makes it easy to locate affected products.

The recent Log4J vulnerability was a good example of why such an SBOM is important to find out if one of your systems or applications is impacted or not. Some of my customers had no idea if they were impacted or not and had to search through all there systems and applications which of course is time consuming and error-prone.

Docker sbom

Starting from Docker Desktop 4.7, a new CLI command is introduced that displays the SBOM for a docker image. This helps to make container images more transparent and gives you an easy way to see what is inside of them.

It is using the open source syft project behind the scenes.

Let’s give the command a try for one of our containers. We’ll use the masstransit/rabbitmq:latest image as an example. 

PS C:\> docker sbom masstransit/rabbitmq:latest
NAME                    VERSION                TYPE
.otp-run-deps           20211006.011020        apk
alpine-baselayout       3.2.0-r16              apk
alpine-keys             2.3-r1                 apk
apk-tools               2.12.7-r0              apk
bash                    5.1.4-r0               apk
busybox                 1.33.1-r3              apk
ca-certificates-bundle  20191127-r5            apk
expat                   2.4.1-r0               apk
gdbm                    1.19-r0                apk
libbz2                  1.0.8-r1               apk
libc-utils              0.7.2-r3               apk
libcrypto1.1            1.1.1l-r0              apk
libffi                  3.3-r2                 apk
libgcc                  10.3.1_git20210424-r2  apk
libintl                 0.21-r0                apk
libproc                 3.3.17-r0              apk
libretls                3.3.3p1-r2             apk
libssl1.1               1.1.1l-r0              apk
libstdc++               10.3.1_git20210424-r2  apk
mpdecimal               2.5.1-r1               apk
musl                    1.2.2-r3               apk
musl-utils              1.2.2-r3               apk
ncurses-libs            6.2_p20210612-r0       apk
ncurses-terminfo-base   6.2_p20210612-r0       apk
procps                  3.3.17-r0              apk
python3                 3.9.5-r1               apk
readline                8.1.0-r0               apk
scanelf                 1.3.2-r0               apk
sqlite-libs             3.35.5-r0              apk
ssl_client              1.33.1-r3              apk
su-exec                 0.2-r1                 apk
xz-libs                 5.2.5-r0               apk
zlib                    1.2.11-r3              apk
   

It is also possible to output this list to a file in any of the following formats:

Here we write the output to an sbom.json file using the syft format:

PS C:\> docker sbom masstransit/rabbitmq:latest --format syft-json --output sbom.json

We can now load this file in a tool like Grype to check for any known vulnerabilities, but that is something I’ll show in my post tomorrow.

More information: https://anchore.com/sbom/docker-sbom-command-creates-sbom-using-syft/

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.

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

Cleaner switch expressions with pattern matching in C#

Ever find yourself mapping multiple string values to the same result? Being a C# developer for a long time, I sometimes forget that the C# has evolved so I still dare to chain case labels or reach for a dictionary. Of course with pattern matching this is no longer necessary. With pattern matching, you can express things inline, declaratively, and with zero repetition. A small example I was working on a small script that should invoke different actions depending on the environment. As our developers were using different variations for the same environment e.g.  "tst" alongside "test" , "prd" alongside "prod" .  We asked to streamline this a long time ago, but as these things happen, we still see variations in the wild. This brought me to the following code that is a perfect example for pattern matching: The or keyword here is a logical pattern combinator , not a boolean operator. It matches if either of the specified pattern...