You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .labspace/01-introduction.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,10 @@
2
2
3
3
👋 Welcome to the **Docker Hardened Images** lab! This lab outlines the benefits of Docker Hardened Images and walks you through the migration process for the Node application.
4
4
5
+
## First thing to get started, please provide your Docker org name
6
+
7
+
::variableDefinition[orgname]{prompt="What is your Docker org name?"}
8
+
5
9
## Docker Hardened Images are Secure, Minimal, Production-Ready Images with near-zero CVEs and enterprise-grade SLA for rapid remediation.
6
10
7
11
These images follow a distroless philosophy, removing unnecessary components to significantly reduce the attack surface. The result? Smaller images that pull faster, run leaner, and provide a secure-by-default foundation for production workloads:
Copy file name to clipboardExpand all lines: .labspace/03-image-scanning.md
+26-60Lines changed: 26 additions & 60 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
## Exploring the app
4
4
5
-
This demo repository contains a Hello World Node.js application consisting of a basic ExpressJS server and Dockerfile pointing to a Trixie (Debian 13) base image.
5
+
This demo repository contains a Hello World Node.js application consisting of a basic JS server and Dockerfile pointing to a Trixie (Debian 13) base image.
6
6
The app logic is implemented in the :fileLink[app.js]{path="app.js"} file.
Use the `docker scout cves` command to list all discovered vulnerabilities:
26
+
Use the `docker scout quickview` command to list all discovered vulnerabilities and scout policies alignment:
27
27
28
28
```bash
29
-
docker scout cves $$orgname$$/demo-node-doi:v1
30
-
```
31
-
32
-
After a moment, you will see details about each of the vulnerabilities discovered in the image with a similar summary.
33
-
34
-
```plaintext no-copy-button
35
-
34 vulnerabilities found in 17 packages
36
-
CRITICAL 0
37
-
HIGH 6
38
-
MEDIUM 2
39
-
LOW 26
40
-
```
41
-
42
-
A couple of things to note about this:
43
-
44
-
- If you scroll up or search the `pkg:npm/[email protected]` - this part of the report is related to the NPM package named `express`, which has version 4.17.1. You should see that the greatest fix version is `4.20.0`
45
-
- Another source of HIGH CVEs is a `path-to-regexp 0.1.7`. The `express` package uses it internally and the `path-to-regexp` library is updated to a fixed version in express version `4.21.2`.
3. A common next step for developers is to clean up the package.json by updating dependencies to address known vulnerabilities.
49
-
50
-
You could upgrade each dependency manually, but to simplify this process during the lab, let's use the following command, which automatically applies available fixes (and may update some packages to newer major versions):
51
-
52
-
```bash
53
-
npm audit fix --force
54
-
```
55
-
56
-
4. Build your image again by running the following command:
Hooray! No more critical or high CVEs on the application level!
90
-
But there are still a few on the base image level. And the critical policies have failed:
55
+
As you can see, there are no CVEs at the application level, but the base image contains 2 high, 1 medium, and 18 low severity CVEs, so it is recommended to be updated. Additionally, the critical policies have failed:
Copy file name to clipboardExpand all lines: .labspace/04-switch-to-dhi.md
+14-13Lines changed: 14 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,31 +51,32 @@ Hooray! There are zero CVEs and policy violations now!
51
51
52
52
Docker Scout offers a helpful command `docker scout compare` that allows you to analyze and compare two images. We’ll use it to evaluate the difference in size and package footprint between `node:24.9.0-trixie-slim` and `dhi-node:24.9.0-debian13` based images.
Base image │ node:24.9.0-trixie-slim│ $$orgname$$/dhi-node:24.9.0-debian13
71
+
Base image │ demonstrationorg/dhi-node-smontri:24 │ node:24-trixie-slim
72
72
tags │ also known as │ also known as
73
-
│ • current-trixie-slim │
74
-
│ • trixie-slim │
75
-
vulnerabilities │ 0C 1H 1M 22L │ 0C 0H 0M 0L
73
+
│ │ • current-trixie-slim
74
+
│ │ • trixie-slim
75
+
vulnerabilities │ 0C 0H 0M 0L │ 0C 2H 1M 18L
76
+
76
77
```
77
78
78
-
As you can see, the original `node:24.9.0-trixie-slim`based image is 41 MB larger, has 248 more packages, and includes high, medium, and low CVEs. The `dhi-node:24.9.0-debian13`based image is 40% smaller and has near-zero CVEs.
79
+
As you can see, the `dhi-node:24.9.0-debian13`–based image is **41 MB (around 40%) smaller**, contains **248 fewer packages**, and has nearly **zero CVEs** compared to the original `node:24.9.0-trixie-slim`–based image.
0 commit comments