News for hackers. Stuff that matters.
Re:Privilege drop, separation, and restricted-service operat... by Zurrrrr on Sunday February 19, 2023 @11:22AM (#34858895)
Security is more than just auditing code to remove bugs - it's also being prepared for worst case scenarios for bugs that inevitably exist but have not yet been found.

For a security focused OS, OpenBSD is terrible in this regard. Pledge and Unveil are simply not sufficient.

Something like SELinux, RSBAC, Even AppArmor is sorely needed.

Re:Privilege drop, separation, and restricted-service operat... by yazzku on Sunday February 19, 2023 @11:53AM (#34859276)
Aren't pledge/unveil precisely preparing for unknown bugs? Also they seem to be much easier to use than doing AppArmor chops.
Re:Privilege drop, separation, and restricted-service operat... by fpoling on Sunday February 19, 2023 @12:41PM (#34859830)
Linux approach delegates security to the system administrator. Hence Linux provides containers, SELinux etc. focusing on securing the existing binaries.

OpenBSD assumes it is the programmer who is responsible for delivering secure code. Hence it provides the tools that require to modify the sources.

One can argue for one or another approach, but both at the end deliver similar reduction of the attack surface.

Re:Privilege drop, separation, and restricted-service operat... by Zurrrrr on Sunday February 19, 2023 @05:09PM (#34862365)
I think that is a flawed way of looking at it. Stuff like SELinux assumes the system administrator or software can't be trusted, and provides ways to protect against future attacks while enforcing only the minimal access needed.

It isn't letting programmers off the hook, and isn't an alternate approach.

Unless you can be absolutely certain of the code you are running, which no one really can, then it's the better approach.

Re:Privilege drop, separation, and restricted-service operat... by traceroute66 on Sunday February 19, 2023 @12:48PM (#34859929)
> Something like SELinux, RSBAC, Even AppArmor

The problem with AppArmor and friends is that they are hell on earth to configure and manage.

And I'm saying that as a security conscious sysadmin !

I don't mind spending little time to lock-down my systems a bit, but writing new AppArmor rules is about as attractive as bashing my head against the proverbial brick wall.

Of course I leave AppArmor enabled to some degree, and I'm happy if a package comes with AppArmor rules ... but I ain't gonna be sacrificing days of my life writing, tweaking, troubleshooting my own rules.

That's why I feel OpenBSD's answer is likely a good compromise. It adds a demonstrable level of security, and it doesn't stress out the sysadmin.

Re:Privilege drop, separation, and restricted-service operat... by binkHN on Sunday February 19, 2023 @01:07PM (#34860120)
> The problem with AppArmor and friends is that they are hell on earth to configure and manage.

> I don't mind spending little time to lock-down my systems a bit, but writing new AppArmor rules is about as attractive as bashing my head against the proverbial brick wall.

Yep. This is one of the prime motivators as to why OpenBSD did what they did. Often times, when AppArmor and similar solutions prevent a program from working properly, the first reaction is to disable it, and then these protections tend to stay disabled.

Re:Privilege drop, separation, and restricted-service operat... by Zurrrrr on Sunday February 19, 2023 @08:23PM (#34863857)
Rules might be a pain, but no more so than writing good firewall rules, and once done don't have to be done again.

It's not the issue some make it out to be

Re:Privilege drop, separation, and restricted-service operat... by commandersaki on Sunday February 19, 2023 @08:50PM (#34864071)
> and once done don't have to be done again

Hardly, you'll have to update the rules when the program gets updated to do new things; whereas with pledge(2)/unveil(2) the developer simply applies more restrictions if needed before the program is distributed.

pledge(2)/unveil(2) is not only superior because it cannot be disabled, it has better aesthetics than any of that apparmor/selinux garbage.

Re:Privilege drop, separation, and restricted-service operat... by Zurrrrr on Sunday February 19, 2023 @09:18PM (#34864239)
On most servers, programs are not doing drastically new things. That really isn't the issue you make it out to be.

The developer applying restrictions ahead of time can't, by nature, mitigate the types of bugs that things like SELinux can protect against.

You really have no clue about what you're talking about.

Re:Privilege drop, separation, and restricted-service operat... by daneel_w on Sunday February 19, 2023 @12:52PM (#34859965)
> "For a security focused OS, OpenBSD is terrible in this regard. Pledge and Unveil are simply not sufficient."

Does that mean that OpenBSD's mitigations are trivial to exploit? "Terrible" and "simply not sufficient" are strong words. If so, can you provide a working proof-of-concept? I keep asking this of people who make this statement because I'm genuinely interested in seeing it demonstrated as it has negative implications for me, but no one wants to spend time proving their point.

Re:Privilege drop, separation, and restricted-service operat... by beachhead on Sunday February 19, 2023 @03:24PM (#34861467)
It'll never happen. Every single time this comes up it turns into the same thing over and over again. You must remember the person that said they'd "write a blogpost bypassing OpenBSD mitigations next week" and that's been well over a month now and, surprise, there's no blog about this.

Everything OpenBSD does is wrong and trivial to bypass but everyone's too busy to do it. Maybe the dumbest part about this is that nobody on the other side of this is making claims that these mitigations are perfect in any way.

Qualys has bypassed some OpenBSD malloc hardening features recently but then they don't go around making wild or insulting claims about how wrong and trivial they are either. Go figure.

Re:Privilege drop, separation, and restricted-service operat... by g0xA52A2A on Sunday February 19, 2023 @04:17PM (#34861953)
Just replying to provide some context [1] for those who come across this comment as I think it's pretty interesting. Also OpenBSD are working on something for this [2].

[1] https://seclists.org/oss-sec/2023/q1/92

[2] https://marc.info/?l=openbsd-tech&m=167673316325935&w=2

Re:Privilege drop, separation, and restricted-service operat... by beachhead on Thursday February 23, 2023 @02:34PM (#34915274)
Re:Privilege drop, separation, and restricted-service operat... by Zurrrrr on Sunday February 19, 2023 @08:27PM (#34863892)
No.

It means if you look at any number of the security vulnerabilities that affected OpenBSD base system that they disclosed, or any number of bugs in third party software they haven't audieted, out of the vulns that allow root and/or rce, a lot of damage can be done on a 'secure' OpenBSD system, which something like SELinux can prevent.

Lets say Apache or something had a remote root bug (despite not running as root) that granted a shell was was pretty easy to exploit. An SELinux system can protect an unkown but actively exploited bug like that more than OpenBSD can.

The OpenBSD approach is just to keep looking and hope you've found every bug that would possibly allow for anything like that, and hope they've found them all.

Re:Privilege drop, separation, and restricted-service operat... by beachhead on Sunday February 19, 2023 @10:15PM (#34864556)
I'm sorry, what?
Re:Privilege drop, separation, and restricted-service operat... by Zurrrrr on Monday February 20, 2023 @05:26AM (#34866859)
Take a breath. Read it again. If you still don't understand something, think about what it is you don't understand, then state your issue clearly so I can help you.
Re:Privilege drop, separation, and restricted-service operat... by beachhead on Monday February 20, 2023 @01:53PM (#34871398)
Nothing you wrote made any sense at all. So, explain the whole thing again, I guess?
Re:Privilege drop, separation, and restricted-service operat... by Zurrrrr on Tuesday February 21, 2023 @07:04AM (#34880124)
It did make sense, so I'm guessing it's just beyond your technical level of comprehension.

I'd suggest reading up more on what stuff like SELinux actually does.

Re:Privilege drop, separation, and restricted-service operat... by beachhead on Tuesday February 21, 2023 @12:30PM (#34883924)
Yeah it couldn't possibly be you.
Re:Privilege drop, separation, and restricted-service operat... by Zurrrrr on Tuesday February 21, 2023 @01:08PM (#34884500)
I don't see how - not to the point where you're claiming you couldn't understand any of what I said.

Why didn't other people have that problem, if it was me?

Re:Privilege drop, separation, and restricted-service operat... by beachhead on Tuesday February 21, 2023 @05:16PM (#34888412)
I'm not sure what to tell you. It didn't make sense. It doesn't make sense. There was nothing technical about what you wrote. Other people don't need to confirm that something doesn't make sense to me. I'm not making a claim, I'm telling you that it didn't make sense. What do you not understand about this?

I'm not trying to insult you or dispute what you wrote. I'm just telling you, again, that it does not make sense.

You keep repeating that all OpenBSD tries to do is audit to find bugs, but that is very obviously not all that they do to prevent exploitation and post-exploitation issues. I'm not sure why you keep doing that. This is one of the parts that doesn't make sense to me.

You say that unveil or pledge aren't enough or aren't as good as SELinux. There is nothing technical about saying that. That's just your opinion that others do not share. I'm not even commenting on whether or not I agree or disagree with you about that. However, you aren't making a point in expressing this opinion. That's something else that doesn't make sense to me.

So, do you want to try to explain what point you're trying to make again? The whole thing. All I'm getting from the things you're saying is that you love SELinux and you have almost no understanding of any other aspect of what OpenBSD does beyond auditing code.

Re:Privilege drop, separation, and restricted-service operat... by Zurrrrr on Tuesday February 21, 2023 @05:38PM (#34888694)
No, you ARE making a claim, and that claim is bullshit. Certain knowledge is required to understand what I wrote and why it makes sense. And it does make sense, which is why other people were able to meaningfully respond to what I wrote.

It's fine that it doesn't make sense to YOU, but you shouldn't confuse that with it not making sense objectively, which it does.

OpenBSD doesn't literally ONLY try to audit bugs, but it is the bulk of their work and they prioritize that over addin or improving mechanisms to lockdown and prevent exploitation issues.

Others can disagree that pledge or unveil are not as good as SELinux, but they would be wrong. It isn't a subjective issue, and you would have to be rather ignorant of the differences to insist it is. SELinux removes the concept of an all powerful root user, and can grant every process the specific minimum access it needs. Pledge and unveil don't come close to offering anything like that.

Then you say I'm not making a point...even though you clearly here disagree with the point I supposedly didn't make. Are you by chance on the spectrum? Just trying to understand your issues with what I wrote, it's quite odd.

I'm not interested to explain anything further as I don't think it would be productive in proportion to the effort I would have to expend. I'm mainly just curious to see where this goes at this point.

Re:Privilege drop, separation, and restricted-service operat... by beachhead on Tuesday February 21, 2023 @05:59PM (#34888939)
Ah, I see you just want to get into a fight.

You've got the wrong guy, ace. Have a good day.

Re:Privilege drop, separation, and restricted-service operat... by Zurrrrr on Wednesday February 22, 2023 @08:39PM (#34905665)
Not trying to fight at all, but no time for someone that has such trouble comprehending something and then blames the author instead of being able to self-reflect.

Best of luck to you in life, Champ.

Re:Privilege drop, separation, and restricted-service operat... by raddan on Sunday February 19, 2023 @10:33PM (#34864652)
Spoken like someone who clearly has never used OpenBSD at all.
Re:Privilege drop, separation, and restricted-service operat... by Zurrrrr on Monday February 20, 2023 @05:26AM (#34866853)
Only on and off for like 20 years....
Re:Privilege drop, separation, and restricted-service operat... by daneel_w on Monday February 20, 2023 @11:08AM (#34869435)
Yes, SELinux and AppArmour can cover these angles in a kind of "application-agnostic" fashion. If anyone would bother using them. Practically nobody does. In the case of SELinux it's usually such a hassle that administrators immediately set the thing to permissive/disabled mode and forget about it. I think OpenBSD's efforts in securing the base system without users having to configure or meddle with the details is a pretty good compromise.
Re:Privilege drop, separation, and restricted-service operat... by Zurrrrr on Tuesday February 21, 2023 @07:06AM (#34880143)
The whole thing about SELinux being so bad it's always just disabled simply isn't true.

Red Hat and Fedora have been using it in the default setup for ages, with permissive roles for unknown stuff but things that ship with RHAT locked down, and their support will even help with that.

OpenBSD's efforts in auditing are not a good compromise. It's not any compromise. It's best practices that do very little to help in the event of an actual breach.

Re:Privilege drop, separation, and restricted-service operat... by daneel_w on Wednesday February 22, 2023 @08:54AM (#34895466)
> "OpenBSD's efforts in auditing are not a good compromise. It's not any compromise. It's best practices that do very little to help in the event of an actual breach."

> "... a remote root bug (despite not running as root) that granted a shell ..."

This example of yours would begin with an exploit (or feature) of the third-party software, which in turn managed to pivot into an exploitable hole in the kernel/base system in order to gain these escalated privileges. Securing the kernel/base system is where their focus is.

I'm not challenging the idea of a blanketing solution like AppArmour, just the notion that the OpenBSD team's efforts are "terrible" and "simply not sufficient".

Re:Privilege drop, separation, and restricted-service operat... by Zurrrrr on Wednesday February 22, 2023 @08:38PM (#34905660)
> This example of yours would begin with an exploit (or feature) of the third-party software, which in turn managed to pivot into an exploitable hole in the kernel/base system in order to gain these escalated privileges. Securing the kernel/base system is where their focus is.

Sure, but the 'base' system doesn't really have anything that people use or that is going to have bugs. It's kind of a copout.

> just the notion that the OpenBSD team's efforts are "terrible" and "simply not sufficient".

Terrible is maybe a bit strong, but they certainly are not sufficient. There are numerous exploits and exploitation paths that pledge and unveil won't prevent, but MAC/RBAC or other DAC alternatives will.

Re:Privilege drop, separation, and restricted-service operat... by mrweasel on Sunday February 19, 2023 @01:25PM (#34860319)
Pledge and Unveil are better in one, maybe two respects.

1) The restrictions are put in place by the developer, who understand the correct and expected behaviour better than a random systems administrator.

2) Neither Pledge nor Unveil can be disabled by the user. Both SELinux and AppArmor (I don't know RSBAC) can be disabled, and is FREQUENTLY disabled because dealing with either systems are a major hassle to configure.

I'm not quite sure how SELinux is better, it's perhaps more granular, but is that better?

Re:Privilege drop, separation, and restricted-service operat... by sillywalk on Sunday February 19, 2023 @02:10PM (#34860741)
I believe that for the OpenBSD developers, SELinux/apparmor/seccmp are against their philosophy. [0]

While they are very powerful tools, they require complex rules maintained outside the actual code, and their complexity may lead you to disable the Security stuff entirely, rather than try to re-write the rules your distro/package came with.

OpenBSD had systrace back in the day to restrict system calls, but it suffered from the Time of Check/Time of Use/ problem, and was only used on one (sshd) program in the base system.

[0] https://www.openbsd.org/papers/hackfest2015-pledge/