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
{{ message }}
Repository navigation
Include Ubuntu as a variant for faster patch releases #708
When using security scanners, there are often complaints about unfixed CVEs in the Debian image. Debian, for better or worse, seems to value increased stability, leading to more, older (found) bugs vs. Ubuntu's quicker releases which probably cause more new bugs. Which is better? ¿Porque no los dos?
I think the "underlying distribution is irrelevant" doesn't always hold. Frequently, in order to build packages that don't ship manylinux* binaries (which don't work on Alpine, so we're past that immediately), some system libraries need to be installed, so you can't really be distro agnostic.
You also can't be agnostic when dealing with security issues. Unless your application is pretty narrow, it's going to be calling out to many other libraries to access a database, format an image, compress a file, send some network traffic...
Because these CVEs come and get squashed, it's hard to "replicate" this issue, but for some example as of now, here's Apache, which has a known vuln in Debian Bullseye, but it's patched in Ubuntu 20.04 Focal. I don't use Apache as much as nginx, but I've had vulnerable libpng's and such show up. In general the trend seems to be that Ubuntu security fixes can roll out faster.
Sure, in a perfect world we'd support every combination of every popular distribution across every actively supported/maintained version of both Python and the distributions, but both from a support/maintenance perspective and a build time/complexity perspective, that just isn't reasonable. For example, each version of just Python 3.11 on each version of Alpine we support takes upwards of 30 minutes to build (so that's a full hour of straight compilation just for two versions of Alpine on one single version of Python). 😬 🙈
I imagine our Dockerfile for the Debian-based variants is probably generic enough that swapping the FROM over to Ubuntu will probably "just work" (especially given folks doing "out there" things like what's described in #706), but unfortunately that's the extent to which we're willing to take this given the other constraints involved.
We were unable to use Debian for our base images due to missing library versions for what we are attempting to install, but Ubuntu works for our purposes.
I understand the decision to not take on additional complexity by providing support for ubuntu based images as its essential to ensure that a project is sustainable to maintain. This comment is solely made to convey an example of the value of ubuntu over debian for reference.
I distribute Docker images where we didn't mind either debian or ubuntu, so we switched to using the python images based to not need to install python ourselves via an ubuntu image. We are now considering reverting back because of the amounts of known vulnerabilities reported by container scanners.
I tracked it down to debian:bullseye vs ubuntu:22.04 and the vast difference in vulnerabilities in the default packages installed and for additional optional packages. Container security scanner trivy reported the following differences between the distributions after we installed some optional apt packages.
debian:bullseye, without vim as an apt package installed - Total: 95 (... HIGH: 40, CRITICAL: 4) debian:bullseye, with vim as an apt package installed - Total: 625 (... HIGH: 454, CRITICAL: 20) ubuntu:22.04, with vim as an apt package installed - Total: 0 (... HIGH: 0, CRITICAL: 0)
In practice I don't know if this is a security problem, but the noise of reported known vulnerabilities is a problem. For example, one of the critical vulnerabilities as reported by trivy is disputed to be a problem at all. At the same time, another critical vulnerability known since 2019 is fixed in debian:bookworm/sid but not part of bullseye. This CVE was patched 2019 by ubuntu it seems, and part of the ubuntu:20.04 and ubuntu:22.04 when they were released.
For some added insight, the primary reason I've found over the years that CVE scanners are less kind to Debian than they are to Ubuntu is that Ubuntu clearly marks CVEs as "WONTFIX" (which the scanners than interpret as "hide this CVE"), where the Debian Security Team never says outright that something will not be fixed because any Debian Developer / member of the project (or someone with enough time to do the work and find a sponsor for it) can fix any issue they like.
For example, the maintainer of a given package could choose to fix every CVE filed against their packages in stable, if they so chose, even if the Security Team at large has decided that most of them aren't worth fixing in stable. The way the Security Team normally telegraphs their evaluation of the CVE's severity within the context of the Debian package and how it is used is with a "no-dsa" tag in the notes, which IMO all the scanning vendors should pick up and interpret the same as they do "WONTFIX" in Ubuntu (because it really is the exact same meaning), but I have not seen any of them doing so, even in spite of the many long meetings I've had with several of them describing this. 😞
See docker-library/mysql#188 (comment) for an example where I went through a very long list of CVEs on the mysql image and highlighted the notes from the Debian Security Team to illustrate this better.
Activity
yosifkit commentedon Mar 24, 2022
My stance remains unchanged: #61 (comment).
nicktimko commentedon Mar 25, 2022
I think the "underlying distribution is irrelevant" doesn't always hold. Frequently, in order to build packages that don't ship
manylinux*binaries (which don't work on Alpine, so we're past that immediately), some system libraries need to be installed, so you can't really be distro agnostic.You also can't be agnostic when dealing with security issues. Unless your application is pretty narrow, it's going to be calling out to many other libraries to access a database, format an image, compress a file, send some network traffic...
Because these CVEs come and get squashed, it's hard to "replicate" this issue, but for some example as of now, here's Apache, which has a known vuln in Debian Bullseye, but it's patched in Ubuntu 20.04 Focal. I don't use Apache as much as nginx, but I've had vulnerable libpng's and such show up. In general the trend seems to be that Ubuntu security fixes can roll out faster.
2.4.52-1~deb11u2is vulnerableSome commands to check package versions and their output...
tianon commentedon Mar 25, 2022
Sure, in a perfect world we'd support every combination of every popular distribution across every actively supported/maintained version of both Python and the distributions, but both from a support/maintenance perspective and a build time/complexity perspective, that just isn't reasonable. For example, each version of just Python 3.11 on each version of Alpine we support takes upwards of 30 minutes to build (so that's a full hour of straight compilation just for two versions of Alpine on one single version of Python). 😬 🙈
I imagine our
Dockerfilefor the Debian-based variants is probably generic enough that swapping theFROMover to Ubuntu will probably "just work" (especially given folks doing "out there" things like what's described in #706), but unfortunately that's the extent to which we're willing to take this given the other constraints involved.marc-pensa commentedon May 10, 2022
Can confirm, replacing
FROM debian:bullseye-slimwithFROM ubuntu:20.04in the https://github.com/docker-library/python/blob/master/3.10/slim-bullseye/Dockerfile works like a charm.We were unable to use Debian for our base images due to missing library versions for what we are attempting to install, but Ubuntu works for our purposes.
tianon commentedon Jun 13, 2022
Closing, as this is unfortunately not something we plan to support. Sorry! ❤️ (see #708 (comment))
consideRatio commentedon Oct 28, 2022
I understand the decision to not take on additional complexity by providing support for
ubuntubased images as its essential to ensure that a project is sustainable to maintain. This comment is solely made to convey an example of the value ofubuntuoverdebianfor reference.I distribute Docker images where we didn't mind either debian or ubuntu, so we switched to using the
pythonimages based to not need to install python ourselves via anubuntuimage. We are now considering reverting back because of the amounts of known vulnerabilities reported by container scanners.I tracked it down to
debian:bullseyevsubuntu:22.04and the vast difference in vulnerabilities in the default packages installed and for additional optional packages. Container security scannertrivyreported the following differences between the distributions after we installed some optional apt packages.debian:bullseye, withoutvimas anaptpackage installed - Total: 95 (... HIGH: 40, CRITICAL: 4)debian:bullseye, withvimas anaptpackage installed - Total: 625 (... HIGH: 454, CRITICAL: 20)ubuntu:22.04, withvimas anaptpackage installed - Total: 0 (... HIGH: 0, CRITICAL: 0)In practice I don't know if this is a security problem, but the noise of reported known vulnerabilities is a problem. For example, one of the critical vulnerabilities as reported by
trivyis disputed to be a problem at all. At the same time, another critical vulnerability known since 2019 is fixed in debian:bookworm/sid but not part of bullseye. This CVE was patched 2019 by ubuntu it seems, and part of the ubuntu:20.04 and ubuntu:22.04 when they were released.Due to this, the open source project I'm working in is moving back towards
ubuntufor now - jupyterhub/zero-to-jupyterhub-k8s#2921.Thank you for your work in this project, the
pythonimages are very helpful!!! ❤️ 🎉tianon commentedon Oct 28, 2022
Thank you for your kind words ❤️
For some added insight, the primary reason I've found over the years that CVE scanners are less kind to Debian than they are to Ubuntu is that Ubuntu clearly marks CVEs as "WONTFIX" (which the scanners than interpret as "hide this CVE"), where the Debian Security Team never says outright that something will not be fixed because any Debian Developer / member of the project (or someone with enough time to do the work and find a sponsor for it) can fix any issue they like.
For example, the maintainer of a given package could choose to fix every CVE filed against their packages in stable, if they so chose, even if the Security Team at large has decided that most of them aren't worth fixing in stable. The way the Security Team normally telegraphs their evaluation of the CVE's severity within the context of the Debian package and how it is used is with a "no-dsa" tag in the notes, which IMO all the scanning vendors should pick up and interpret the same as they do "WONTFIX" in Ubuntu (because it really is the exact same meaning), but I have not seen any of them doing so, even in spite of the many long meetings I've had with several of them describing this. 😞
See docker-library/mysql#188 (comment) for an example where I went through a very long list of CVEs on the
mysqlimage and highlighted the notes from the Debian Security Team to illustrate this better.consideRatio commentedon Oct 29, 2022
@tianon wow amazing work in detailing this situation!!!
I pinged you in jupyterhub/zero-to-jupyterhub-k8s#2918 (comment), asking if you know a place where this is being tracked by trivy (or debian).