News for hackers. Stuff that matters.
Re:SELinux is unmanageable; just turn it off if it gets in y... by greedo on Wednesday April 27, 2022 @10:55AM (#31180665)
I've tried to explain to our Devops guys that they need to automate their patching so that a new container is fully patched before deployment. They had no idea what I was talking about. I said, "you have containers that run for months, right? And they aren't modified at all after deployment, right? So how do you address new vulnerabilities? How often are you patching your base image?"

Just clueless looks.

Re:SELinux is unmanageable; just turn it off if it gets in y... by monkpit on Wednesday April 27, 2022 @11:12AM (#31180890)
How would you accomplish this exactly? Your use case may vary, but in my mind dependencies shouldn’t just be upgraded by some automated system without some sort of feedback mechanism (like tests).

If you’re going to run tests against the new dependencies, then why not just shift that whole activity to the development process itself (not the deployment system)?

When dependencies are sufficiently different from the existing prod dependencies, you can release a new version, instead of expecting ops/devops to take care of your dependencies for you.

Re:SELinux is unmanageable; just turn it off if it gets in y... by greedo on Wednesday April 27, 2022 @11:24AM (#31181096)
I'm actually agnostic as to how it's achieved. I just think that the idea of running a container for three months without patching the underlying OS is nuts. Generally our guys only redeploy a container when there's been an update, so that OS is pretty stale compared to what I'm running on traditional VMs. It really was more of a reflection on how DevOps can become too focused on application development and deployment, as opposed to deploying holistic systems. We have coders writing apps that feed into our CI/CD system, we have admins who manage kubernetes/Swarm, and we have traditional sysadmins managing VMs. All with differing priorities and focuses.
Re:SELinux is unmanageable; just turn it off if it gets in y... by Spivak on Wednesday April 27, 2022 @12:47PM (#31182404)
I kinda stopped worrying too much about it because the "OS" (really userspace) that lives in a container isn't in a position to be exploited like the underlying VM OS is. Nothing in the container is privileged and there are no security boundaries that exist within a container. You should care exactly as much about container image updates as you do gem/npm/pip updates and I guarantee you have months old deps pinned in a lockfile somewhere.

What people hear is "Oh my god you're still running Ubuntu 14.04?!?" but what is actually happening is all the defenses and security boundaries are being enforced by a fully patched RHEL 7 instance with SELinux, the completely unprivileged application code just happens to have an old version of libz bundled with it. So for sure the application is in a position to be compromised depending on how old the libs and the vulns that might exist but that's the developer's concern exactly like their NPM deps.

Re:SELinux is unmanageable; just turn it off if it gets in y... by greedo on Wednesday April 27, 2022 @02:36PM (#31183988)
So an application runs in a container that has a vulnerable OS. This has network access, DB access, NFS or SMB access. All valuable stuff. And then the container's OS gets breached due to the vulnerability. Sure, the VM hosting the Docker containers is secure, but that doesn't really matter if the breached container had access to PII or other valuable data.

This idea that people have about containers being 'the "OS (really userspace)' is fundamentally wrong. It's the equivalent of a VM, just (hopefully) stripped down to the bare essentials. There's no magic that protects it. The Docker host sure doesn't protect it, and in fact the Docker host can be vulnerable to exploitation from its containers, just as a vSphere host (or any other hypervisor) can be exploited if its VMs are insecure.

Re:SELinux is unmanageable; just turn it off if it gets in y... by Spivak on Wednesday April 27, 2022 @03:10PM (#31184423)
> And then the container's OS gets breached

This can't happen. There is no "OS" actually running. It's a bunch of binaries and files sitting in a tar archive that the process running can access and link against. What are you going to breach? All the networking, firewalls, kernel, remote access like SSH, and privilege management is the hosts. The only process running in the container is the application.

What you mean is "what if the application running in the container is compromised?" For example what if there's a RCE vuln in the version of libcurl that the app links against? Absolutely! Now you've got a huge problem but this is exactly the same as if there was an RCE in leftPad. In container world that's now the developer's problem instead of yours. Everything in the container is vendored, just pretend it was all statically linked. It's not like an VM where ops patches it.

> It's the equivalent of a VM, just (hopefully) stripped down to the bare essentials

No, no 1000 times no. It's in all ways the equivalent of a process (or tree of processes) running on the host machine. From a security perspective a container is no different than any other binary running on the host. You have it exactly right, there is exactly zero magic and no inherent security.

You should lose exactly as much sleep over outdated container images as you lose over outdated rubygems in your developers' Bundle.lock. Whether that means a lot or a little depends on the company and how security critical the application is.

Re:SELinux is unmanageable; just turn it off if it gets in y... by greedo on Wednesday April 27, 2022 @05:17PM (#31185916)
Thank you for this clear explanation without any attacks! I hate to think how many people I've misinformed about this at work. I think what caused my confusion is how our devops team has been using Docker. They've basically treated it as a vm environment that doesn't require approval from my team. And some of their practices just seem to cause me stress that I should just free myself from.

Would it blow your mind to hear that some devops people actually run more than one application in a container? And that one of those apps might just be sshd? That's one of the many that I know about. Why they wouldn't just run docker exec?

Re:SELinux is unmanageable; just turn it off if it gets in y... by xyzzy123 on Wednesday April 27, 2022 @01:17PM (#31182842)
Ok you got me (I laughed)

I'm just so sick of the container security shills; in particular I'm tired of people selling debian advisories with zero value add on enterprise contract.

Re:SELinux is unmanageable; just turn it off if it gets in y... by monkpit on Wednesday April 27, 2022 @12:45PM (#31182375)
Ah, the OS itself. I thought you meant the application dependencies.
Re:SELinux is unmanageable; just turn it off if it gets in y... by _joel on Wednesday April 27, 2022 @12:50PM (#31182447)
If you're using an upstream image from a distro, pull that down, update it, push it back to a registry, then use that as your base image. Do that every day in a CI/CD (or just cron) system, such that you've got logs, auditing and fires off alerts if something breaks.

Add update steps to the builds of your final image containers too at the start, to catch any delta that may have happened during last base image patch.

There are also container scanning tools but they can produce some false positives sometimes but useful nonetheless.

You still run tests as normal against the new images before promoting, just like normal.

Re:SELinux is unmanageable; just turn it off if it gets in y... by greedo on Wednesday April 27, 2022 @02:43PM (#31184078)
Exactly what I've been trying to push to the team.
Re:SELinux is unmanageable; just turn it off if it gets in y... by xyzzy123 on Wednesday April 27, 2022 @12:52PM (#31182482)
If that matters why hasn't the internet exploded yet?

Hardly anyone is doing that thing and it seems to not matter. People who panic only when they see $STUPIDLY_NAMED_ISSUE seem fine.

Re:SELinux is unmanageable; just turn it off if it gets in y... by Sebb767 on Wednesday April 27, 2022 @03:50PM (#31184887)
Ransomware incidents are rampant and PII breaches are quite common. Remember Equifax, who lost the PII of basically all adult US citizens?

Sure, there are extremely sophisticated, targeted hacks. But those are the minority. There are also hacks where hacker groups accidentally (!) shut down an oil pipeline. The reason the internet hasn't completely burned down is three-fold:

- We accepted breaches as something "that just happens" and that "nothing is 100% secure" - which is true, yes, but applied very broadly.

- Our operating systems are generally well secured and most exploits are very situational.

- The hacker groups (at least most of them) don't put in too much effort either, since they make a very good living of the lowest common denominator.

Re:SELinux is unmanageable; just turn it off if it gets in y... by greedo on Wednesday April 27, 2022 @02:48PM (#31184136)
I work for a stodgy company with over $4B under management. In a highly regulated industry where you have to publicly announce breaches. Sure it may not matter to a quick startup where someone is re-inventing Uber for gokarts, or other small industries, but when you have to satisfy auditors and regulators across different jurisdictions, you can't take a laissez faire attitude towards patching and compliance.

And considering how many breaches occur on a weekly basis compromising customer PII etc, its foolhardy to say the Internet hasn't exploded yet. It's been in a continual burn for decades.

Re:SELinux is unmanageable; just turn it off if it gets in y... by icedchai on Wednesday April 27, 2022 @02:15PM (#31183703)
Unless there's a vulnerability in something internet facing, you can go a very long time without updating anything. So, yes, it doesn't matter... except when it does. I've logged into production systems with multi year uptimes, with updates that haven't been applied in just as long.

Many orgs have a if it's not broke, don't fix it policy. Applying needless updates are just as likely to screw something up.

Re:SELinux is unmanageable; just turn it off if it gets in y... by greedo on Wednesday April 27, 2022 @02:52PM (#31184188)
Many orgs get breached (or have no way to detect if they've been breached).

It depends on both your industry and your risk tolerance. We generally apply every security patch that comes along for RHEL. Application patching is different, it depends on the severity and what the vendor will support. If we can't patch, we try to apply compensating controls to mitigate the risk.

And the pride we all used to have with long uptimes is really a poor badge of courage. It shows a misplaced trust in either your security, or the threat model you face.

OS security patches (at least for RHEL) pose little risk of breaking applications. In the last 15 years, I've never once had to roll back a security patch from RH.

Re:SELinux is unmanageable; just turn it off if it gets in y... by db48x on Thursday April 28, 2022 @01:38AM (#31189111)
Security patches can be applied even to the kernel without restarting anything though, so having a high uptime is not mutually exclusive with staying up to date. Of course, you do have to pay extra for live patching.
Re:SELinux is unmanageable; just turn it off if it gets in y... by greedo on Thursday April 28, 2022 @09:22AM (#31192128)
I'm still leery of ksplice etc. And the cost is a factor too.
Re:SELinux is unmanageable; just turn it off if it gets in y... by db48x on Thursday April 28, 2022 @05:40PM (#31198560)
/me nods, but it is so very _very_ convenient.