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
Running syft scan someimage.tar doesn't find anything on my system with /tmp mounted as tmpfs
What you expected to happen:
It should work as expected
Steps to reproduce the issue:
# if not already a tmpfs
sudo mount -t tmpfs tmpfs /tmp
# get any random archive
curl -O https://dl-cdn.alpinelinux.org/alpine/v3.20/releases/x86_64/alpine-minirootfs-3.20.0-x86_64.tar.gz
# run syft
syft alpine-minirootfs-3.20.0-x86_64.tar.gz
✔ Indexed file system /tmp/syft-archive-contents-1080653417
✔ Cataloged contents f7dc00a9fa83e70f0940486a37761faa850ed8d67ebc24a3fb6e93c832dca43d
├── ✔ Packages [0 packages]
└── ✔ Executables [0 executables]
No packages discovered
Anything else we need to know?:
Patching the exclusion for tmpfs obviously works:
diff --git a/syft/internal/fileresolver/directory_indexer.go b/syft/internal/fileresolver/directory_indexer.go
index 92495ab77a36..bf0c1354303e 100644
--- a/syft/internal/fileresolver/directory_indexer.go
+++ b/syft/internal/fileresolver/directory_indexer.go
@@ -485,7 +485,7 @@ func keepUnixSystemMountPaths(infos []*mountinfo.Info) []string {
// - tmpfs - used for /dev in special instances (within a container)
switch info.FSType {
- case "proc", "procfs", "sysfs", "devfs", "devtmpfs", "udev", "tmpfs":
+ case "proc", "procfs", "sysfs", "devfs", "devtmpfs", "udev":
log.WithFields("mountpoint", info.Mountpoint).Debug("ignoring system mountpoint")
mountPaths = append(mountPaths, info.Mountpoint)
I guess these would make sense when running syft on a live container, but perhaps we should make sure we're not ignoring the filesystem that contains the scan target?
In the archive case, it's extracting the archive to /tmp/syft-archive-contents-foobar so I'd assume we get that /tmp path somewhere as "scan target", and that should always be allowed.
Anything below (e.g. if /tmp/syft-archive-contents-foobar/tmp) can be ignored as currently done.
Not sure how to do that properly so opening issue first; this can be worked around by running syft in a container so it doesn't see that /tmp is a tmpfs so there is no urgence.
Environment:
Output of syft version: master
OS (e.g: cat /etc/os-release or similar): linux
The text was updated successfully, but these errors were encountered:
What happened:
Running
syft scan someimage.tar
doesn't find anything on my system with /tmp mounted as tmpfsWhat you expected to happen:
It should work as expected
Steps to reproduce the issue:
Anything else we need to know?:
Patching the exclusion for tmpfs obviously works:
I guess these would make sense when running syft on a live container, but perhaps we should make sure we're not ignoring the filesystem that contains the scan target?
In the archive case, it's extracting the archive to /tmp/syft-archive-contents-foobar so I'd assume we get that /tmp path somewhere as "scan target", and that should always be allowed.
Anything below (e.g. if
/tmp/syft-archive-contents-foobar/tmp
) can be ignored as currently done.Not sure how to do that properly so opening issue first; this can be worked around by running syft in a container so it doesn't see that /tmp is a tmpfs so there is no urgence.
Environment:
syft version
: mastercat /etc/os-release
or similar): linuxThe text was updated successfully, but these errors were encountered: