-
Notifications
You must be signed in to change notification settings - Fork 594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Symlink traversal confusion when scanning unpacked filesystems #1359
Labels
bug
Something isn't working
Comments
We still need to figure out the right solution here, but this definitely seems like something we want to support. |
3 tasks
I'm going to leave this open until it gets implemented in Syft proper, not just the API. |
This was referenced Jan 30, 2023
This was referenced Feb 6, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Assume we have a directory containing an unpacked container image in the
target
directory:We could also create
target.tar
out of this sametarget
directory:$ tar cf target.tar target/*
If we scan this as a directory source, we can note a couple warning message that indicate that syft is scanning directories that weren't intended by the user:
These warnings start to appear because of the symlinks
/bin/tar
to/bin/busybox
and/var/run
to/run
. I would expect these contents to be resolved entirely within the provided path, but it seems like this behavior is intentional, though I'm not sure of the context: see https://github.com/anchore/syft/blob/main/syft/source/directory_resolver.go#L530-L532 introduced in #442.What's even weirder to me is this behavior is identical even when scanning
file:target.tar
(since it shares the same directory resolver code, after unpacking it into a tmp directory):After raising on the community slack, @kzantow suggested a possible new source type,
root-dir
(or similar), where all content could be resolved internally, additionally, with the same cataloguers as theimage:
source (since those also differ).The text was updated successfully, but these errors were encountered: