-
Notifications
You must be signed in to change notification settings - Fork 690
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
Keep package-installed files listing for Debian packages installed in a distroless image #1876
Comments
This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days. |
@pombredanne I would love to help, do you already have something I can start with? |
@fedemengo sorry for a late reply. I do not have anything done yet, but I would likely either:
|
After a brief investigation the metadata file passed to
and
So we must be losing the file information somewhere else. I'll keep digging. |
This ensures that a "distroless" container layer tarball built from Debian packages contains not only the control file of each package, but also the md5sums file that lists original files included in a package. The md5sums file is extracted from a .deb package and saved side-by-side with the control under this path: var/lib/dpkg/status.d/<package-name>.md5sums Reference: bazelbuild#1876 Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
@fedemengo I do not think anything is "lost" .... but rather that in rules_docker/container/build_tar.py Line 224 in 6ea707b
we have only one file that's extracted and that's the control file: rules_docker/container/build_tar.py Line 41 in 6ea707b
we want the md5sums file to be extracted. I pushed a PR here with a test: #2065 |
This ensures that a "distroless" container layer tarball built from Debian packages contains not only the control file of each package, but also the md5sums file that lists original files included in a package. The md5sums file is extracted from a .deb package and saved side-by-side with the package control file under this path: var/lib/dpkg/status.d/<package-name>.md5sums Reference: bazelbuild#1876 Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
This ensures that a "distroless" container layer tarball built from Debian packages contains not only the control file of each package, but also the md5sums file that lists original files included in a package. If present, we extract the md5sums file and save is side-by-side with the package control file under this path: var/lib/dpkg/status.d/<package-name>.md5sums Reference: bazelbuild#1876 Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
I would really appreciate some review of #2065 before it goes stale. |
This ensures that a "distroless" container layer tarball built from Debian packages contains not only the control file of each package, but also the md5sums file that lists original files included in a package. If present, we extract the md5sums file and save is side-by-side with the package control file under this path: var/lib/dpkg/status.d/<package-name>.md5sums Reference: bazelbuild#1876 Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
This ensures that a "distroless" container layer tarball built from Debian packages contains not only the control file of each package, but also the md5sums file that lists original files included in a package. If present, we extract the md5sums file and save is side-by-side with the package control file under this path: var/lib/dpkg/status.d/<package-name>.md5sums Reference: bazelbuild#1876 Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
This ensures that a "distroless" container layer tarball built from Debian packages contains not only the control file of each package, but also the md5sums file that lists original files included in a package. If present, we extract the md5sums file and save is side-by-side with the package control file under this path: var/lib/dpkg/status.d/<package-name>.md5sums Reference: bazelbuild#1876 Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
This ensures that a "distroless" container layer tarball built from Debian packages contains not only the control file of each package, but also the md5sums file that lists original files included in a package. If present, we extract the md5sums file and save is side-by-side with the package control file under this path: var/lib/dpkg/status.d/<package-name>.md5sums Reference: bazelbuild#1876 Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
* Add md5sums file list to distroless container This ensures that a "distroless" container layer tarball built from Debian packages contains not only the control file of each package, but also the md5sums file that lists original files included in a package. If present, we extract the md5sums file and save is side-by-side with the package control file under this path: var/lib/dpkg/status.d/<package-name>.md5sums Reference: #1876 Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Remove trailing whitespaces Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
* Add md5sums file list to distroless container This ensures that a "distroless" container layer tarball built from Debian packages contains not only the control file of each package, but also the md5sums file that lists original files included in a package. If present, we extract the md5sums file and save is side-by-side with the package control file under this path: var/lib/dpkg/status.d/<package-name>.md5sums Reference: bazelbuild#1876 Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> * Remove trailing whitespaces Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days. |
This issue was automatically closed because it went 30 days without a reply since it was labeled "Can Close?" |
🚀 feature request
Relevant Rules
When a package is installed, only metadata are kept and the list of installed files is lost/not saved with the package metadata.
I have a concern with what happens here:
rules_docker/container/build_tar.py
Line 224 in d18033b
Description
In a distroless container image, the as-installed .deb packages are not saved with their files/md5sums file lists in what would be in
/var/lib/dpkg/info
on a regular Debian install. As a result, it is not possible to relate an installed package in a distroless image/layer to the set of files that were installed with this package.This data can be important for software composition analysis and its security and license compliance tracking applications.
Describe the solution you'd like
Each installed package should include some installed file listing possibly added in some per package file in the
status.d/
directory. This is a Debian standard in/var/lib/dpkg/info/<package name>
This would make distroless images more readily introspectable, otherwise there is no intrisic way to relate a package (in status.d) to the set of its installed files.
@tejal29 you committed this originally with @dlorenc ... any insight to share there?
Describe alternatives you've considered
I cannot fathom an in-container alternative to keep a tab of each packaged-installed file. Tracking outside would mean maintaining some external database which does not seem practical.
The text was updated successfully, but these errors were encountered: