Repository: google/osv-scanner

Issue:
Add Ubuntu JSON tests
Same as https://github.com/google/osv-scanner/pull/1604

Hints from issue comments:

Solution patch:
diff --git a/cmd/osv-scanner/__snapshots__/main_test.snap b/cmd/osv-scanner/__snapshots__/main_test.snap
index d8902a07..e3bb57aa 100755
--- a/cmd/osv-scanner/__snapshots__/main_test.snap
+++ b/cmd/osv-scanner/__snapshots__/main_test.snap
@@ -3154,6 +3154,59 @@ Warning: `scan` exists as both a subcommand of OSV-Scanner and as a file on the
 
 ---
 
+[Test_run_OCIImage/Empty_Ubuntu_22.04_image_tar - 1]
+Scanning local image tarball "../../internal/image/fixtures/test-ubuntu.tar"
+
+Container Scanning Result (Ubuntu 22.04.5 LTS):
+Total 17 packages affected by 23 known vulnerabilities (2 Critical, 3 High, 8 Medium, 2 Low, 8 Unknown) from 1 ecosystem.
+0 vulnerabilities can be fixed.
+
+
+Ubuntu:22.04
++----------------------------------------------------------------------------------------------------------+
+| Source:os:var/lib/dpkg/status                                                                            |
++-------------+-------------------------+------------------+------------+------------------+---------------+
+| PACKAGE     | INSTALLED VERSION       | FIX AVAILABLE    | VULN COUNT | INTRODUCED LAYER | IN BASE IMAGE |
++-------------+-------------------------+------------------+------------+------------------+---------------+
+| coreutils   | 8.32-4.1ubuntu1.2       | No fix available |          1 | # 4 Layer        | ubuntu        |
+| gcc-12      | 12.3.0-1ubuntu1~22.04   | No fix available |          2 | # 4 Layer        | ubuntu        |
+| glibc       | 2.35-0ubuntu3.8         | No fix available |          2 | # 4 Layer        | ubuntu        |
+| gnupg2      | 2.2.27-3ubuntu2.1       | No fix available |          1 | # 4 Layer        | ubuntu        |
+| gnutls28    | 3.7.3-4ubuntu1.5        | No fix available |          1 | # 4 Layer        | ubuntu        |
+| krb5        | 1.19.2-2ubuntu0.4       | No fix available |          1 | # 4 Layer        | ubuntu        |
+| libcap2     | 1:2.44-1ubuntu0.22.04.1 | No fix available |          1 | # 4 Layer        | ubuntu        |
+| libgcrypt20 | 1.9.4-3ubuntu3          | No fix available |          1 | # 4 Layer        | ubuntu        |
+| libtasn1-6  | 4.18.0-4build1          | No fix available |          2 | # 4 Layer        | ubuntu        |
+| libzstd     | 1.4.8+dfsg-3build1      | No fix available |          1 | # 4 Layer        | ubuntu        |
+| ncurses     | 6.3-2ubuntu0.1          | No fix available |          2 | # 4 Layer        | ubuntu        |
+| openssl     | 3.0.2-0ubuntu1.18       | No fix available |          2 | # 4 Layer        | ubuntu        |
+| pam         | 1.4.0-11ubuntu2.5       | No fix available |          1 | # 4 Layer        | ubuntu        |
+| pcre2       | 10.39-3ubuntu0.1        | No fix available |          1 | # 4 Layer        | ubuntu        |
+| perl        | 5.34.0-3ubuntu1.3       | No fix available |          1 | # 4 Layer        | ubuntu        |
+| shadow      | 1:4.8.1-2ubuntu2.2      | No fix available |          2 | # 4 Layer        | ubuntu        |
+| systemd     | 249.11-0ubuntu3.12      | No fix available |          1 | # 4 Layer        | ubuntu        |
++-------------+-------------------------+------------------+------------+------------------+---------------+
+
+Filtered Vulnerabilities:
++---------+--------------+--------------------------+---------------------+----------------+
+| PACKAGE | ECOSYSTEM    | INSTALLED VERSION        | FILTERED VULN COUNT | FILTER REASONS |
++---------+--------------+--------------------------+---------------------+----------------+
+| glibc   | Ubuntu:22.04 | 2.35-0ubuntu3.8          |                   1 | Unimportant    |
+| krb5    | Ubuntu:22.04 | 1.19.2-2ubuntu0.4        |                   1 | Unimportant    |
+| pcre3   | Ubuntu:22.04 | 2:8.39-13ubuntu0.22.04.1 |                   1 | Unimportant    |
+| perl    | Ubuntu:22.04 | 5.34.0-3ubuntu1.3        |                   1 | Unimportant    |
++---------+--------------+--------------------------+---------------------+----------------+
+
+For the most comprehensive scan results, we recommend using the HTML output: `osv-scanner scan image --serve <image_name>`.
+You can also view the full vulnerability list in your terminal with: `osv-scanner scan image --format vertical <image_name>`.
+
+---
+
+[Test_run_OCIImage/Empty_Ubuntu_22.04_image_tar - 2]
+Warning: `scan` exists as both a subcommand of OSV-Scanner and as a file on the filesystem. `scan` is assumed to be a subcommand here. If you intended for `scan` to be an argument to `scan`, you must specify `scan scan` in your command line.
+
+---
+
 [Test_run_OCIImage/Invalid_path - 1]
 Scanning local image tarball "./fixtures/oci-image/no-file-here.tar"
 
@@ -4866,6 +4919,621 @@ Scanning local image tarball "../../internal/image/fixtures/test-node_modules-np
 
 ---
 
+[Test_run_OCIImageAllPackagesJSON/scanning_ubuntu_image_in_json_format - 1]
+{
+  "results": [
+    {
+      "source": {
+        "path": "var/lib/dpkg/status",
+        "type": "os"
+      },
+      "packages": [
+        {
+          "package": {
+            "name": "coreutils",
+            "os_package_name": "coreutils",
+            "version": "8.32-4.1ubuntu1.2",
+            "ecosystem": "Ubuntu:22.04",
+            "image_origin_details": {
+              "index": 4
+            }
+          },
+          "vulnerabilities": [
+            "UBUNTU-CVE-2016-2781"
+          ],
+          "groups": 1
+        },
+        {
+          "package": {
+            "name": "gcc-12",
+            "os_package_name": "gcc-12-base",
+            "version": "12.3.0-1ubuntu1~22.04",
+            "ecosystem": "Ubuntu:22.04",
+            "image_origin_details": {
+              "index": 4
+            }
+          },
+          "vulnerabilities": [
+            "UBUNTU-CVE-2022-27943",
+            "UBUNTU-CVE-2023-4039"
+          ],
+          "groups": 2
+        },
+        {
+          "package": {
+            "name": "gnupg2",
+            "os_package_name": "gpgv",
+            "version": "2.2.27-3ubuntu2.1",
+            "ecosystem": "Ubuntu:22.04",
+            "image_origin_details": {
+              "index": 4
+            }
+          },
+          "vulnerabilities": [
+            "UBUNTU-CVE-2022-3219"
+          ],
+          "groups": 1
+        },
+        {
+          "package": {
+            "name": "glibc",
+            "os_package_name": "libc-bin",
+            "version": "2.35-0ubuntu3.8",
+            "ecosystem": "Ubuntu:22.04",
+            "image_origin_details": {
+              "index": 4
+            }
+          },
+          "vulnerabilities": [
+            "UBUNTU-CVE-2016-20013",
+            "UBUNTU-CVE-2025-0395",
+            "UBUNTU-CVE-2025-0577",
+            "USN-7259-1"
+          ],
+          "groups": 3
+        },
+        {
+          "package": {
+            "name": "glibc",
+            "os_package_name": "libc6",
+            "version": "2.35-0ubuntu3.8",
+            "ecosystem": "Ubuntu:22.04",
+            "image_origin_details": {
+              "index": 4
+            }
+          },
+          "vulnerabilities": [
+            "UBUNTU-CVE-2016-20013",
+            "UBUNTU-CVE-2025-0395",
+            "UBUNTU-CVE-2025-0577",
+            "USN-7259-1"
+          ],
+          "groups": 3
+        },
+        {
+          "package": {
+            "name": "libcap2",
+            "os_package_name": "libcap2",
+            "version": "1:2.44-1ubuntu0.22.04.1",
+            "ecosystem": "Ubuntu:22.04",
+            "image_origin_details": {
+              "index": 4
+            }
+          },
+          "vulnerabilities": [
+            "UBUNTU-CVE-2025-1390",
+            "USN-7287-1"
+          ],
+          "groups": 1
+        },
+        {
+          "package": {
+            "name": "gcc-12",
+            "os_package_name": "libgcc-s1",
+            "version": "12.3.0-1ubuntu1~22.04",
+            "ecosystem": "Ubuntu:22.04",
+            "image_origin_details": {
+              "index": 4
+            }
+          },
+          "vulnerabilities": [
+            "UBUNTU-CVE-2022-27943",
+            "UBUNTU-CVE-2023-4039"
+          ],
+          "groups": 2
+        },
+        {
+          "package": {
+            "name": "libgcrypt20",
+            "os_package_name": "libgcrypt20",
+            "version": "1.9.4-3ubuntu3",
+            "ecosystem": "Ubuntu:22.04",
+            "image_origin_details": {
+              "index": 4
+            }
+          },
+          "vulnerabilities": [
+            "UBUNTU-CVE-2024-2236"
+          ],
+          "groups": 1
+        },
+        {
+          "package": {
+            "name": "gnutls28",
+            "os_package_name": "libgnutls30",
+            "version": "3.7.3-4ubuntu1.5",
+            "ecosystem": "Ubuntu:22.04",
+            "image_origin_details": {
+              "index": 4
+            }
+          },
+          "vulnerabilities": [
+            "UBUNTU-CVE-2024-12243",
+            "USN-7281-1"
+          ],
+          "groups": 1
+        },
+        {
+          "package": {
+            "name": "krb5",
+            "os_package_name": "libgssapi-krb5-2",
+            "version": "1.19.2-2ubuntu0.4",
+            "ecosystem": "Ubuntu:22.04",
+            "image_origin_details": {
+              "index": 4
+            }
+          },
+          "vulnerabilities": [
+            "UBUNTU-CVE-2024-26458",
+            "UBUNTU-CVE-2024-26461",
+            "UBUNTU-CVE-2024-3596",
+            "UBUNTU-CVE-2025-24528",
+            "USN-7257-1",
+            "USN-7314-1"
+          ],
+          "groups": 2
+        },
+        {
+          "package": {
+            "name": "krb5",
+            "os_package_name": "libk5crypto3",
+            "version": "1.19.2-2ubuntu0.4",
+            "ecosystem": "Ubuntu:22.04",
+            "image_origin_details": {
+              "index": 4
+            }
+          },
+          "vulnerabilities": [
+            "UBUNTU-CVE-2024-26458",
+            "UBUNTU-CVE-2024-26461",
+            "UBUNTU-CVE-2024-3596",
+            "UBUNTU-CVE-2025-24528",
+            "USN-7257-1",
+            "USN-7314-1"
+          ],
+          "groups": 2
+        },
+        {
+          "package": {
+            "name": "krb5",
+            "os_package_name": "libkrb5-3",
+            "version": "1.19.2-2ubuntu0.4",
+            "ecosystem": "Ubuntu:22.04",
+            "image_origin_details": {
+              "index": 4
+            }
+          },
+          "vulnerabilities": [
+            "UBUNTU-CVE-2024-26458",
+            "UBUNTU-CVE-2024-26461",
+            "UBUNTU-CVE-2024-3596",
+            "UBUNTU-CVE-2025-24528",
+            "USN-7257-1",
+            "USN-7314-1"
+          ],
+          "groups": 2
+        },
+        {
+          "package": {
+            "name": "krb5",
+            "os_package_name": "libkrb5support0",
+            "version": "1.19.2-2ubuntu0.4",
+            "ecosystem": "Ubuntu:22.04",
+            "image_origin_details": {
+              "index": 4
+            }
+          },
+          "vulnerabilities": [
+            "UBUNTU-CVE-2024-26458",
+            "UBUNTU-CVE-2024-26461",
+            "UBUNTU-CVE-2024-3596",
+            "UBUNTU-CVE-2025-24528",
+            "USN-7257-1",
+            "USN-7314-1"
+          ],
+          "groups": 2
+        },
+        {
+          "package": {
+            "name": "ncurses",
+            "os_package_name": "libncurses6",
+            "version": "6.3-2ubuntu0.1",
+            "ecosystem": "Ubuntu:22.04",
+            "image_origin_details": {
+              "index": 4
+            }
+          },
+          "vulnerabilities": [
+            "UBUNTU-CVE-2023-45918",
+            "UBUNTU-CVE-2023-50495"
+          ],
+          "groups": 2
+        },
+        {
+          "package": {
+            "name": "ncurses",
+            "os_package_name": "libncursesw6",
+            "version": "6.3-2ubuntu0.1",
+            "ecosystem": "Ubuntu:22.04",
+            "image_origin_details": {
+              "index": 4
+            }
+          },
+          "vulnerabilities": [
+            "UBUNTU-CVE-2023-45918",
+            "UBUNTU-CVE-2023-50495"
+          ],
+          "groups": 2
+        },
+        {
+          "package": {
+            "name": "pam",
+            "os_package_name": "libpam-modules",
+            "version": "1.4.0-11ubuntu2.5",
+            "ecosystem": "Ubuntu:22.04",
+            "image_origin_details": {
+              "index": 4
+            }
+          },
+          "vulnerabilities": [
+            "UBUNTU-CVE-2024-10041"
+          ],
+          "groups": 1
+        },
+        {
+          "package": {
+            "name": "pam",
+            "os_package_name": "libpam-modules-bin",
+            "version": "1.4.0-11ubuntu2.5",
+            "ecosystem": "Ubuntu:22.04",
+            "image_origin_details": {
+              "index": 4
+            }
+          },
+          "vulnerabilities": [
+            "UBUNTU-CVE-2024-10041"
+          ],
+          "groups": 1
+        },
+        {
+          "package": {
+            "name": "pam",
+            "os_package_name": "libpam-runtime",
+            "version": "1.4.0-11ubuntu2.5",
+            "ecosystem": "Ubuntu:22.04",
+            "image_origin_details": {
+              "index": 4
+            }
+          },
+          "vulnerabilities": [
+            "UBUNTU-CVE-2024-10041"
+          ],
+          "groups": 1
+        },
+        {
+          "package": {
+            "name": "pam",
+            "os_package_name": "libpam0g",
+            "version": "1.4.0-11ubuntu2.5",
+            "ecosystem": "Ubuntu:22.04",
+            "image_origin_details": {
+              "index": 4
+            }
+          },
+          "vulnerabilities": [
+            "UBUNTU-CVE-2024-10041"
+          ],
+          "groups": 1
+        },
+        {
+          "package": {
+            "name": "pcre2",
+            "os_package_name": "libpcre2-8-0",
+            "version": "10.39-3ubuntu0.1",
+            "ecosystem": "Ubuntu:22.04",
+            "image_origin_details": {
+              "index": 4
+            }
+          },
+          "vulnerabilities": [
+            "UBUNTU-CVE-2022-41409"
+          ],
+          "groups": 1
+        },
+        {
+          "package": {
+            "name": "pcre3",
+            "os_package_name": "libpcre3",
+            "version": "2:8.39-13ubuntu0.22.04.1",
+            "ecosystem": "Ubuntu:22.04",
+            "image_origin_details": {
+              "index": 4
+            }
+          },
+          "vulnerabilities": [
+            "UBUNTU-CVE-2017-11164"
+          ],
+          "groups": 1
+        },
+        {
+          "package": {
+            "name": "openssl",
+            "os_package_name": "libssl3",
+            "version": "3.0.2-0ubuntu1.18",
+            "ecosystem": "Ubuntu:22.04",
+            "image_origin_details": {
+              "index": 4
+            }
+          },
+          "vulnerabilities": [
+            "UBUNTU-CVE-2024-13176",
+            "UBUNTU-CVE-2024-41996",
+            "UBUNTU-CVE-2024-9143",
+            "USN-7278-1"
+          ],
+          "groups": 2
+        },
+        {
+          "package": {
+            "name": "gcc-12",
+            "os_package_name": "libstdc++6",
+            "version": "12.3.0-1ubuntu1~22.04",
+            "ecosystem": "Ubuntu:22.04",
+            "image_origin_details": {
+              "index": 4
+            }
+          },
+          "vulnerabilities": [
+            "UBUNTU-CVE-2022-27943",
+            "UBUNTU-CVE-2023-4039"
+          ],
+          "groups": 2
+        },
+        {
+          "package": {
+            "name": "systemd",
+            "os_package_name": "libsystemd0",
+            "version": "249.11-0ubuntu3.12",
+            "ecosystem": "Ubuntu:22.04",
+            "image_origin_details": {
+              "index": 4
+            }
+          },
+          "vulnerabilities": [
+            "UBUNTU-CVE-2023-7008"
+          ],
+          "groups": 1
+        },
+        {
+          "package": {
+            "name": "libtasn1-6",
+            "os_package_name": "libtasn1-6",
+            "version": "4.18.0-4build1",
+            "ecosystem": "Ubuntu:22.04",
+            "image_origin_details": {
+              "index": 4
+            }
+          },
+          "vulnerabilities": [
+            "UBUNTU-CVE-2021-46848",
+            "UBUNTU-CVE-2024-12133",
+            "USN-7275-1"
+          ],
+          "groups": 2
+        },
+        {
+          "package": {
+            "name": "ncurses",
+            "os_package_name": "libtinfo6",
+            "version": "6.3-2ubuntu0.1",
+            "ecosystem": "Ubuntu:22.04",
+            "image_origin_details": {
+              "index": 4
+            }
+          },
+          "vulnerabilities": [
+            "UBUNTU-CVE-2023-45918",
+            "UBUNTU-CVE-2023-50495"
+          ],
+          "groups": 2
+        },
+        {
+          "package": {
+            "name": "systemd",
+            "os_package_name": "libudev1",
+            "version": "249.11-0ubuntu3.12",
+            "ecosystem": "Ubuntu:22.04",
+            "image_origin_details": {
+              "index": 4
+            }
+          },
+          "vulnerabilities": [
+            "UBUNTU-CVE-2023-7008"
+          ],
+          "groups": 1
+        },
+        {
+          "package": {
+            "name": "libzstd",
+            "os_package_name": "libzstd1",
+            "version": "1.4.8+dfsg-3build1",
+            "ecosystem": "Ubuntu:22.04",
+            "image_origin_details": {
+              "index": 4
+            }
+          },
+          "vulnerabilities": [
+            "UBUNTU-CVE-2022-4899"
+          ],
+          "groups": 1
+        },
+        {
+          "package": {
+            "name": "shadow",
+            "os_package_name": "login",
+            "version": "1:4.8.1-2ubuntu2.2",
+            "ecosystem": "Ubuntu:22.04",
+            "image_origin_details": {
+              "index": 4
+            }
+          },
+          "vulnerabilities": [
+            "UBUNTU-CVE-2023-29383",
+            "UBUNTU-CVE-2024-56433"
+          ],
+          "groups": 2
+        },
+        {
+          "package": {
+            "name": "ncurses",
+            "os_package_name": "ncurses-base",
+            "version": "6.3-2ubuntu0.1",
+            "ecosystem": "Ubuntu:22.04",
+            "image_origin_details": {
+              "index": 4
+            }
+          },
+          "vulnerabilities": [
+            "UBUNTU-CVE-2023-45918",
+            "UBUNTU-CVE-2023-50495"
+          ],
+          "groups": 2
+        },
+        {
+          "package": {
+            "name": "ncurses",
+            "os_package_name": "ncurses-bin",
+            "version": "6.3-2ubuntu0.1",
+            "ecosystem": "Ubuntu:22.04",
+            "image_origin_details": {
+              "index": 4
+            }
+          },
+          "vulnerabilities": [
+            "UBUNTU-CVE-2023-45918",
+            "UBUNTU-CVE-2023-50495"
+          ],
+          "groups": 2
+        },
+        {
+          "package": {
+            "name": "shadow",
+            "os_package_name": "passwd",
+            "version": "1:4.8.1-2ubuntu2.2",
+            "ecosystem": "Ubuntu:22.04",
+            "image_origin_details": {
+              "index": 4
+            }
+          },
+          "vulnerabilities": [
+            "UBUNTU-CVE-2023-29383",
+            "UBUNTU-CVE-2024-56433"
+          ],
+          "groups": 2
+        },
+        {
+          "package": {
+            "name": "perl",
+            "os_package_name": "perl-base",
+            "version": "5.34.0-3ubuntu1.3",
+            "ecosystem": "Ubuntu:22.04",
+            "image_origin_details": {
+              "index": 4
+            }
+          },
+          "vulnerabilities": [
+            "UBUNTU-CVE-2023-31486",
+            "UBUNTU-CVE-2023-47039"
+          ],
+          "groups": 2
+        }
+      ]
+    }
+  ],
+  "experimental_config": {
+    "licenses": {
+      "summary": false,
+      "allowlist": null
+    }
+  },
+  "image_metadata": {
+    "os": "Ubuntu 22.04.5 LTS",
+    "layer_metadata": [
+      {
+        "diff_id": "",
+        "command": "/bin/sh -c #(nop)  ARG RELEASE",
+        "is_empty": true,
+        "base_image_index": 1
+      },
+      {
+        "diff_id": "",
+        "command": "/bin/sh -c #(nop)  ARG LAUNCHPAD_BUILD_ARCH",
+        "is_empty": true,
+        "base_image_index": 1
+      },
+      {
+        "diff_id": "",
+        "command": "/bin/sh -c #(nop)  LABEL org.opencontainers.image.ref.name=ubuntu",
+        "is_empty": true,
+        "base_image_index": 1
+      },
+      {
+        "diff_id": "",
+        "command": "/bin/sh -c #(nop)  LABEL org.opencontainers.image.version=22.04",
+        "is_empty": true,
+        "base_image_index": 1
+      },
+      {
+        "diff_id": "sha256:...",
+        "command": "/bin/sh -c #(nop) ADD file:1b6c8c9518be42fa2afe5e241ca31677fce58d27cdfa88baa91a65a259be3637 in / ",
+        "is_empty": false,
+        "base_image_index": 1
+      },
+      {
+        "diff_id": "",
+        "command": "/bin/sh -c #(nop)  CMD [/"/bin/bash/"]",
+        "is_empty": true,
+        "base_image_index": 1
+      }
+    ],
+    "base_images": [
+      {},
+      {
+        "name": "ubuntu",
+        "tags": null
+      }
+    ]
+  }
+}
+
+---
+
+[Test_run_OCIImageAllPackagesJSON/scanning_ubuntu_image_in_json_format - 2]
+Warning: `scan` exists as both a subcommand of OSV-Scanner and as a file on the filesystem. `scan` is assumed to be a subcommand here. If you intended for `scan` to be an argument to `scan`, you must specify `scan scan` in your command line.
+Scanning local image tarball "../../internal/image/fixtures/test-ubuntu.tar"
+
+---
+
 [Test_run_SubCommands/scan_with_a_flag - 1]
 Scanning dir ./fixtures/locks-one-with-nested
 Scanned <rootdir>/fixtures/locks-one-with-nested/nested/composer.lock file and found 1 package
diff --git a/internal/image/fixtures/test-ubuntu.Dockerfile b/internal/image/fixtures/test-ubuntu.Dockerfile
new file mode 100644
index 00000000..a8f8b104
--- /dev/null
+++ b/internal/image/fixtures/test-ubuntu.Dockerfile
@@ -0,0 +1 @@
+FROM ubuntu:22.04@sha256:ed1544e454989078f5dec1bfdabd8c5cc9c48e0705d07b678ab6ae3fb61952d2



Test patch:
diff --git a/cmd/osv-scanner/main_test.go b/cmd/osv-scanner/main_test.go
index a15d92f2..9f1e7f8a 100644
--- a/cmd/osv-scanner/main_test.go
+++ b/cmd/osv-scanner/main_test.go
@@ -721,6 +721,11 @@ func Test_run_OCIImage(t *testing.T) {
 			args: []string{"", "scan", "image", "--archive", "../../internal/image/fixtures/test-alpine.tar"},
 			exit: 1,
 		},
+		{
+			name: "Empty Ubuntu 22.04 image tar",
+			args: []string{"", "scan", "image", "--archive", "../../internal/image/fixtures/test-ubuntu.tar"},
+			exit: 1,
+		},
 		{
 			name: "Scanning python image with some packages",
 			args: []string{"", "scan", "image", "--archive", "../../internal/image/fixtures/test-python-full.tar"},
@@ -832,6 +837,17 @@ func Test_run_OCIImageAllPackagesJSON(t *testing.T) {
 				testutility.AnyDiffID,
 			},
 		},
+		{
+			name: "scanning ubuntu image in json format",
+			args: []string{"", "scan", "image", "--archive", "--format=json", "../../internal/image/fixtures/test-ubuntu.tar"},
+			exit: 1,
+			replaceRules: []testutility.JSONReplaceRule{
+				testutility.GroupsAsArrayLen,
+				testutility.OnlyIDVulnsRule,
+				testutility.OnlyFirstBaseImage,
+				testutility.AnyDiffID,
+			},
+		},
 	}
 	for _, tt := range tests {
 		t.Run(tt.name, func(t *testing.T) {