-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
feat(python): support PKG-INFO and METADATA #716
feat(python): support PKG-INFO and METADATA #716
Comments
Hello , i would like to take on this feature |
hello, so i've spent some time on this, and figured out the following:
Let me know what you think. Cheers |
This issue aims to scan python packages without Pipfile.lock. Some packages are not listed in Pipfile.lock and it might be false negative. It would be great if you get a bigger list than Pipfile.lock. |
Clair appears to take a similar approach here if that is useful to anyone who may take on implementing this: https://github.com/quay/claircore/blob/master/python/packagescanner.go |
This issue is stale because it has been labeled with inactivity. |
Currently, Trivy traverses all paths and looks for all Pipfile.lock or poetry.lock in a container image. However, the image sometimes has only Pipfile.lock and doesn't install python packages listed in the Pipfile.lock. A python package should have PKG-INFO and METADATA depending on
egg
orwheel
.https://packaging.python.org/discussions/wheel-vs-egg/
To avoid false positives from Pipfile.lock, we are probably able to take advantage of
*.dist-info/METADATA
and*.egg-info/PKG-INFO
file.How it works:
*.dist-info
and*.egg-info
directory*.egg-info
is sometimes a file.PKG-INFO
orMETADATA
under those directoriesHow to implement it:
pkg/egg/parse.go
orpkg/python/egg/parse.go
analyzer/library/egg/egg.go
I'm sure the first two tasks are not difficult and good for the first contributor as well. There are a few things to consider when implementing it in Trivy.
The text was updated successfully, but these errors were encountered: