Resolve links/hardlinks for image scanning #5356
Replies: 4 comments 11 replies
-
I think this is a wider issue that affect all kinds of scanning within Trivy. We also don't support the same in misconfiguration scanning. Please see this for context #5002 cc @knqyf263 |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Should we create an issue to track this @knqyf263? |
Beta Was this translation helpful? Give feedback.
-
@knqyf263 did you conclude on how to make this approach because we're dependent on these hardlinks and symlinks as part of #5360 |
Beta Was this translation helpful? Give feedback.
-
We currently skip links when scanning images, because
archive/tar
package can't read value of link.Typically hardlink and base file use same file name, and for us this is not problem because if we missed harklink - we will parse base file.
But 1 case was found:
pnpm
can use hardlinks forpackage.json
files fromnode_modules/.pnpm/...
dir.But base files doesn't use
package.json
filenames.See this comment - #5332 (reply in thread).
To check links - we need to walk each tar archive (zipped layers) 2 times (to find links and read base files).
Trivy will take longer to work.
Perhaps we can add flag to enable link detection.
Welcome with out experiance, ideas, etc.
Beta Was this translation helpful? Give feedback.
All reactions