Most container images in production have serious vulnerabilities
darkreading.com
darkreading.com
And this is why the numbers are so high -- because all of those "vulnerability reports" are complete junk most of the time. SSHD warnings for systems which do not run sshd. ImageMagick vulnerabilities for internal code docs generator. A high severity sudo vulnerability which requires a specific very uncommon configuration.
A great idea on paper, but it is achieving an opposite effect, teaching people that most of automated vulnerability detections are junk.
Some times the most secure systems are running insanely old software.
Sometimes software that’s a bit out of date correlates to fewer attacks.
When people are attacked, they upgrade their software. So a company that has gone a long time with no updates, followed by frantically updating everything could be a warning sign.
Scanners are frequently not looking for the breakthrough 0-day vulnerabilities, but just for the low hanging fruit of old and well known vulnerabilities.
All exploited systems before then were either windows nt or Linux. Commercial Unix (Dec, sgi, sun) rarely came up and generally only when there were accounts using identical credentials with a more exploitable platform.
Which seems a bit weird, as they wouldn't have paid a cent before for security auditing OSS codebases.
What's different between full on UNIX systems and Docker, the possibility of deploying code based on scratch images. Imagine a system which only had the pieces necessary to run in production, your security exception reports would go to zero.
Instead of doing the right thing, which would be static and dynamic analysis of the entrypoint to determine the runtime dependencies, the industry has just resorted to saying anything you bundle with your app needs to be 100% invulnerable at all times. It's stupid and practically unachievable if your container is big.
Container scanners and dependency bots like Dependabot are snake oil solutions sold to people too lazy to actually secure their application.
https://sysdig.com/2023-cloud-native-security-and-usage-repo...
It is provided by:
"Sysdig Secure: Cloud, container, and Kubernetes security that closes the loop from source to run."
It's the best interest of security companies to sell scareware.
Based on those headers, the container scanner is convinced that my container is vulnerable to many exciting things, like Atheros WiFi chipset driver vulnerabilities.
One of the easiest ways of dealing with these vulnerabilities is by actually building your images correct there is rarely a need to take on every dependency of your base OS so by either manually crafting images or by using image minimizers like DockerSlim you can make your life much easier.
Vulnerability scanners especially for container images are indeed problematic since they are often only doing static analysis on the image SBOM and comparing it to a list of vulnerabilities, this is where half of the problem begins which is again where tools like DockerSlim come really handy.
DockerSlim also has another benefit of forcing teams to have good test coverage for the minimization process to work correctly and also produces runtime policy files which can be used to restrict containers further.
Take for example various framework vulnerabilities the amount of effort require to ensure that these are not exploitable is monumental even if the specific containerized workload can be proven not to invoke any vulnerable code it doesn’t mean that other workloads won’t today or tomorrow.
Then you have other vulnerabilities that may not be relevant to your workload at all however if your container isn’t locked down properly, you don’t have runtime protection and there are other vulnerabilities they would allow an attacker to chain them together.
This is why reducing the attack surface of the underlying image itself is one of the most cost effective preventative measures you can employ.
Containers shouldn't have anything more than what they need. I downplay the scrutiny a bit, boiling it down to "don't put the bad thing in, to begin with"
The trick is identifying it, of course - but a good start that's commonly missed is simply stripping (or not supplying) the build tools
Many years ago I'd have agreed with this so hard I'd hurt myself. These days I've moved on to a much more nuanced "maybe".
Also many years ago the code might've had half a dozen dependencies and the developers knew quite well how they were used and what code paths were relevant now or in the near future. So it was fairly tractable to say: Nope, that doesn't impact us, ignore.
These days there are thousands of dependencies and if I grab a random developer from the team and ask them "How is libfoo being used?" the response is most likely along the lines of "libfoo? never heard of it" because it was brought in as a third-degree dependency. So is the vulnerable functionality conceivably relevant or not? Nobody in the house knows.
In such a world, it is quite often easiest to have a blanket policy of update/patch everything if at all possible. Only if some upgrade causes trouble, then spend human cycles to review and analyze what's up.
I've seen teams that try to analyze everything fall further and further behind because vulnerabilities come in faster than they can analyze.
With that said, if your application doesn't need these things, why are they in there?
Time and effort, usually. So there's a choice; continue chasing the vulns or you can improve your builds.
You get out what you put in, the process can be valuable. It's not because cargo-culting.
When I look at images where there are thousands of issues... it almost always is something end of life that is not supported. Our folks should not be using it. General rule of thumb, if you see an issue that you can patch - do so. There should be enough automation/testing so that minor version ++ is not a scary event. The real challenge is getting the business side to understand they need to allow time for updating. A SpringBoot 1.2 app might work just fine, from a functionality perspective. We try to use the CVE cleanup as a tech debt indicator to make sure folks are finding the time to upgrade from Java 5. Crazy, right?
Most folks just use a docker image. Few actually build them or know enough to maintain someone elses. Surprisingly rare skill.
Yea, I can take that application and upgrade that library... Will it work? Might crash. Might work fine. Or in the worst case silently corrupt data in an almost unnoticeable way that we don't notice for till 10 million transactions down the line.
Containers are at least as problematic for security updates as a statically linked binary and more inefficient.
In the past year, I've worked with Solaris from 2005 and CentOS 5, and migrated them to either Kubernetes or modern CentOS versions.
I have a Python-based pod that polls an internal API endpoint. Why should I care if the Python container has a critical vulnerability completely unrelated to what it does?
1.) https://en.wikipedia.org/wiki/Swiss_cheese_model
2.) Our own blind spots + unknown unknowns
CON:
1.) There are many false alarms or not critical issues :
see: https://github.com/search?q=org%3Adocker-library+CVE&type=is...