Trivy fs cannot generate SBoM for a folder containing RPMs #4292
Replies: 5 comments
-
|
Need to use rootfs |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for your swift reply. I tried that one too, same result. |
Beta Was this translation helpful? Give feedback.
-
|
Hello @gabrielericciardi Could you tell me which path you are using for scanning please. I created some example: i download ➜ ls -hl
total 208M
lrwxrwxrwx 1 dmitriy dmitriy 7 мар 20 15:59 bin -> usr/bin
dr-xr-xr-x 2 dmitriy dmitriy 4,0K дек 14 2017 boot
drwxr-xr-x 2 dmitriy dmitriy 4,0K мар 20 15:58 dev
drwxr-xr-x 50 dmitriy dmitriy 4,0K мар 20 16:01 etc
drwxr-xr-x 2 dmitriy dmitriy 4,0K мар 20 16:01 home
-rw-r--r-- 1 dmitriy dmitriy 208M мар 20 16:09 layer.tar
lrwxrwxrwx 1 dmitriy dmitriy 7 мар 20 15:59 lib -> usr/lib
lrwxrwxrwx 1 dmitriy dmitriy 9 мар 20 15:59 lib64 -> usr/lib64
drwxr-xr-x 2 dmitriy dmitriy 4,0K дек 14 2017 media
drwxr-xr-x 2 dmitriy dmitriy 4,0K дек 14 2017 mnt
drwxr-xr-x 2 dmitriy dmitriy 4,0K мар 20 15:58 proc
dr-xr-x--- 3 dmitriy dmitriy 4,0K мар 20 16:09 root
drwxr-xr-x 13 dmitriy dmitriy 4,0K мар 20 16:09 run
lrwxrwxrwx 1 dmitriy dmitriy 8 мар 20 15:59 sbin -> usr/sbin
drwxr-xr-x 2 dmitriy dmitriy 4,0K дек 14 2017 srv
drwxr-xr-x 2 dmitriy dmitriy 4,0K мар 20 15:58 sys
drwxrwxr-x 7 dmitriy dmitriy 4,0K мар 20 16:09 tmp
drwxr-xr-x 13 dmitriy dmitriy 4,0K мар 20 15:59 usr
drwxr-xr-x 18 dmitriy dmitriy 4,0K мар 20 15:59 var
➜ trivy -f spdx-json rootfs ./ | grep pkg:rpm
2023-03-27T11:47:56.602+0600 INFO "--format spdx" and "--format spdx-json" disable security scanning
"referenceLocator": "pkg:rpm/redhat/libstdc%2B%2B@4.8.5-44.el7?arch=x86_64\u0026distro=redhat-7.9",
"referenceLocator": "pkg:rpm/redhat/libpwquality@1.2.3-5.el7?arch=x86_64\u0026distro=redhat-7.9",
"referenceLocator": "pkg:rpm/redhat/tzdata@2022g-1.el7?arch=noarch\u0026distro=redhat-7.9",
...
If you try to scan RPM files - Trivy can't scan them We only find rpm packages installed on the system. Regards, Dmitriy |
Beta Was this translation helpful? Give feedback.
-
|
Hi @DmitriyLewen, OK, as I suspected trivy needs some form of repodb to generate the SBoM, but such a repodb will exist only on an installed system: I had the impression that Thanks for your support, Gabriele |
Beta Was this translation helpful? Give feedback.
-
|
Hello @gabrielericciardi
If you need to scan But these is 1 point- one of DB file must exist.(e.g. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I would like to obtain a SBoM for a created ISO (based on a RedHat distribution), listing all the packages in the media.
I then unpacked the ISO in a folder and used
trivy fsto scan it, but the SBoM produced reports a single item, the scanned folder, without any vulnerability or license information.I also tried to scan a single RPM package present in that folder, and also in this case the SBoM produced reports a single item, the scanned RPM, without any vulnerability or license information.
Using the
--list-all-pkgsparameter had no effect.What did you expect to happen?
trivy fscreates a valid SBoM for a folder that contains a set of RPM packages.What happened instead?
trivy fscreates an "empty" SBoM that only mentions the scanned item without any vulnerability and license information.Output of run with
-debug:Output of
trivy -v:Additional details (base image name, container registry info...):
/root/.cache/trivy)Beta Was this translation helpful? Give feedback.
All reactions