News for hackers. Stuff that matters.
Re:SELinux is unmanageable; just turn it off if it gets in y... by throw0101a on Wednesday April 27, 2022 @07:37AM (#31178656)
> The whole container movement can be seen as putting the apps in a sarcophagus like Chernobyl. […] Who is responsible that it is air tight? Well, uh, nobody, really.

The people who designed the container/sarcophagus system. If it's not secure don't sell it as secure: see the difference between Linux containers and FreeBSD jails or Solaris zones.

> You can't even blame the applications for that. Let's say you want to build a good, secure application. How do you know what files your application will try to open? What syscalls it wants to call? Library and framework functions tend to not document that properly.

As a developer / software "engineer" it is your responsibility to know how the components you choose work and how much you can rely on them. When a structural engineer selects certain types of steel or concrete to be used in the construction of a bridge, it is their responsibility to know the characteristics of the raw materials.

When you ship a software product, enable SELinux or AppArmor and audit what it does: then ship an SELinux/AppArmor profiles.

See also OpenBSD's pledge(2) framework where the developer embeds system calls in their (C) code to promise to only access certain OS features:

* https://awesomekling.github.io/pledge-and-unveil-in-Serenity...

* https://man.openbsd.org/pledge.2

Re:SELinux is unmanageable; just turn it off if it gets in y... by consp on Wednesday April 27, 2022 @07:43AM (#31178694)
> it is your responsibility to know how the components you choose work and how much you can rely on them

Unfortunately that is not always your choice and arguing against it most commonly costs you more than you like. My experience is quite often timelines get underestimated massively with software so you end up doing what you can with the resources given. If you pull this into the bridge metafore the bridge still stands but can collapse any time and as long as it doesn't collapse during rush hour and can be rebuilt before the next morning it's all fine.

Re:SELinux is unmanageable; just turn it off if it gets in y... by brightball on Wednesday April 27, 2022 @08:03AM (#31178845)
Yep, this is accurate. People making decisions often value “works”/“ships” more than “secure” and the time allocations reflect it.

I wish it wasn’t the case, but it is.

Re:SELinux is unmanageable; just turn it off if it gets in y... by caymanjim on Wednesday April 27, 2022 @09:32AM (#31179635)
It's pragmatism. If something doesn't work, it doesn't matter how secure it is.
Re:SELinux is unmanageable; just turn it off if it gets in y... by paledot on Wednesday April 27, 2022 @09:41AM (#31179770)
If something isn't secure, it doesn't work. At that point, you would've been better off shipping a wireframe.
Re:SELinux is unmanageable; just turn it off if it gets in y... by caymanjim on Wednesday April 27, 2022 @10:10AM (#31180104)
A door with a broken lock still provides value. An online PDF converter on a website without SSL still provides value. I'm not saying security doesn't matter or that it shouldn't be a priority, but things don't need to be perfect to be useful. It makes sense to focus more on functionality than security in many areas. I host a bunch of web apps behind a firewall that aren't secure enough to expose to the public Internet. Even commercial ones.
Re:SELinux is unmanageable; just turn it off if it gets in y... by paledot on Wednesday April 27, 2022 @12:23PM (#31182020)
Unfortunately, that's exactly the problem. If it didn't provide value, no one would use it and its lack of security would be a moot point.

The PDF converter is a great example. It's functional, people use it - to transfer potentially highly sensitive documents over an insecure connection. At that point, it provides value in the same way that a Nigerian prince provides banking services.

Re:SELinux is unmanageable; just turn it off if it gets in y... by throwaway889900 on Wednesday April 27, 2022 @10:31AM (#31180370)
For you, no risk seems acceptable when it comes to security. That is generally not the case for most people, who will accept some level of risk (ie an insecure program) if it provides value to them. That's the whole point of risk management.
Re:SELinux is unmanageable; just turn it off if it gets in y... by paledot on Wednesday April 27, 2022 @11:46AM (#31181463)
Pardon me for being pithy. We've all heard the adage about perfect security being a logical impossibility. I will say instead that if a tool doesn't have security proportionate to its risk factor integrated in its design, it doesn't work.
Re:SELinux is unmanageable; just turn it off if it gets in y... by freeopinion on Wednesday April 27, 2022 @09:45AM (#31179818)
There are lots of decision points. Some people are deciding what to sell; others are deciding what to purchase. An organization that de-prioritizes security in what they produce could be punished by organizations that prioritize security in what they consume. In this way, decisions are shared to some extent. Consumers might be misled over the short-term, but at some point they become complicit.

If a datacenter continues to purchase a model of generator after five high-profile failures of that model, they can argue all they want that it is the only model on the market that meets their needs. But clearly uptime is not their biggest consideration.

Re:SELinux is unmanageable; just turn it off if it gets in y... by loeg on Wednesday April 27, 2022 @10:16AM (#31180152)
> When you ship a software product, enable SELinux or AppArmor and audit what it does: then ship an SELinux/AppArmor profiles.

It's not just sysamins -- developers don't understand SELinux, either.

As a dev, I find least-privilege sandboxing (e.g., look at how sshd is structured) and capabilities (e.g. FreeBSD capsicum) somewhat non-intuitive, but at least tractable to understand. SELinux is a blackhole.

Re:SELinux is unmanageable; just turn it off if it gets in y... by ethbr0 on Wednesday April 27, 2022 @08:55AM (#31179256)
>> The whole container movement can be seen as putting the apps in a sarcophagus like Chernobyl. […] Who is responsible that it is air tight? Well, uh, nobody, really.

> The people who designed the container/sarcophagus system.

Original comment misses two nuances with the gripe.

1. Container creators and software creators are not the same people. So they can (and should!) have different goals and priorities. For containers, security and reliability. For software, make it work.

2. There is a nuanced, different interface between software-system and container-system, created by encapsulating a system-like environment inside the container. Much of what software does can be encapsulated. Which allows a more controlled (and much smaller) subset to exit the container.

Re:SELinux is unmanageable; just turn it off if it gets in y... by throw0101a on Wednesday April 27, 2022 @11:43AM (#31181417)
> 1. Container creators and software creators are not the same people. So they can (and should!) have different goals and priorities. For containers, security and reliability. For software, make it work.

If the container system designers did their job properly it won't matter what the software does inside of it, as breakouts shouldn't be possible.

It has been a few years since I looked, but last time I checked there hasn't been a vulnerability in FreeBSD's jails code that allowed someone to break out. The closest to it was an issue with devfs that allowed 'tunnelling' out, but not with the actual Jails code itself:

* https://www.freebsd.org/security/advisories/FreeBSD-SA-14:07...

Meanwhile, with Docker (including CVE-2019-5736, which allows for overwriting runc on the host system):

* https://www.cvedetails.com/vulnerability-list/vendor_id-1353...

> 2. There is a nuanced, different interface between software-system and container-system

One keeps things inside and other other often doesn't?

Re:SELinux is unmanageable; just turn it off if it gets in y... by ethbr0 on Wednesday April 27, 2022 @03:05PM (#31184366)
One side has a huge footprint to secure (software-system), because it's every way software could ever need to interact with a local system.

The other can expose a much smaller one (container-system), because it only needs to include things one would have gone off-local-machine for (i.e. networking).

So from a security boundary, containers are basically a machine-internal firewall between programs and the host.

Re:SELinux is unmanageable; just turn it off if it gets in y... by throw0101a on Wednesday April 27, 2022 @03:16PM (#31184496)
> So from a security boundary, containers are basically a machine-internal firewall between programs and the host.

Which is only useful if they actually provide security.

Re:SELinux is unmanageable; just turn it off if it gets in y... by ethbr0 on Wednesday April 27, 2022 @05:46PM (#31186220)
You're missing my point.

It's effectively impossible to ever provide security at the program-system interface, due to the surface area. (I.e. the SELinux problem)

The very concept of having a container (that internally simulates a system) creates fundamentally different opportunities that allow both (programs that work) and (security).

Whinging about whether or not current containers do a good or bad job of it is a less interesting, short term quibble.