The simplicity of pledge is good enough for 99% of use-cases I'd wager AND easy to add to existing code.
If a piece of important or foundational software wants to lock itself down today, look at the myriad of convoluted "solutions" mentioned in a sibling comment. If you wanted to discourage progress in this area, that's how you'd design something. I'm not assuming malice, obviously, but it's certainly a product of the endless nitpicking and "not good enough, doesn't cover <niche usecase>" type of thinking.
EDIT:
> and the ones that do will likely be lazy
I'd argue the opposite, any developer taking the time to add some pledge calls to their code is probably mindful of security and wants to improve it. If you wanted to be lazy, you'd just... not implement pledge at all since it'd get in your way and be too restrictive.
Meanwhile, complex external systems like SELinux end up being unused because they are complex and external (and thus can just be ignored).
https://github.com/jart/pledge
https://justine.lol/pledge/
pledge() allows developers to further restrict a program dynamically at runtime. More like defensive driving.
Both are useful techniques.
It doesn't. You can download malware and the app can cryptolock your entire system. Sure, if the malware called pledge to block opening files but what malware is going to do that?
Wdym? It's very notably used in Android
I also doubt you can take pictures of me when it doesn't have cameras attached. If it did and you were to take pictures, you'd see some blinking leds and cables all day.
And I highly doubt you could take remote control even if I had openssh open to the public.
Perhaps your industry just doesn't care about the same things the openbsd community does.
Edit: I missed the ssh key stealing. My keys are always encrypted.
I have never seen SELinux used on a regular server. Heck, Amazon Linux AMIs on AWS even disable it by default.
Yeah, yeah, personal experience and all that.