This will probably lead to vocal outrage because it's Systemd rather than an alternative project coming up with the solution.
Sudo has long known to have dangerous weaknesses, but it's generally been accepted since sudo solves a bunch of other problems.
If we can fix the problems sudo has, then that's a good thing. Would be nicer if we could split up some of these projects though to stop uber projects.
The outrage is that the solution is to suck the feature into an already massive project built to replace initd and has absorbed several other services (syslog, logind, crond), creating dependencies along the way.
systemd will be superceded, like pulseaudio, because it has an awful design. It'll just be a lot more work for distros to replace because of all the other services it's absorbed. Hopefully by then Poettering will have retired and stopped inflicting his software in people. The problem isn't his initial offerings; those are rather good and solve a problem well. Good enough that distros adopt it. It's just that he can't resist feature envy and bloat, and once a distro has a dependency on his solution, the bloat comes along and it's more work to switch away than just let the bloat take over.
Edit: "superseded?" Where were you when I needed you, autocorrect?
The reason systemd absorbs other services is because it's trying to make a proper integrated OS userland. Having a load of separate components that don't really know anything about each other kiiind of works, but it's super janky.
For example Windows has supported a secure attention key sequence (ctrl-alt-del) for literal decades. Linux still doesn't support this very basic - and critical for shared computing environments like schools - feature, because it requires coordinating X11 and logind and the kernel and god knows what else and they simply aren't properly integrated.
The systemd hatred strongly reminds me of when Xorg started automating the config and you no longer needed xfree86config. You didn't need to manually write mode lines and tell X that your mouse had 3 buttons, and some people did not like that.
Yes it sounds completely insane that people wouldn't like this obvious improvement where things used to require tedious manual configuration and now they worked automatically but some people really didn't I promise! My theory is that it's because a) it made their hard won knowledge obsolete, making them less smart relatively, and b) they resented the fact that they had to go through the pain but new people wouldn't and that isn't fair.
Seems similar with systemd. I would like my laptop to sleep properly please.
Also I have actually read some of the sudo source code. There's absolutely no way that code should be SUID. Insane.
mesa and linux is also "uber projects" i think in certains canes you can't run away from them, systemd is the same, but for privilegiated processes that need to be well integrated for security reasons
While I agree that sometimes Uber projects happen, for efficiency or security reasons, I don't think that Mesa is a good example as they have a scope (implement the OpenGL/Vulkan API) and stick to it.
Systemd is already confusing because of it referencing two different projects, and the overarching systemd projects scope just increases on a regular basis without what appears to external observers as a plan.
This sounds like a great improvement. I have read the sudo source code and anyone that seriously thinks there's no problem with it being SUID is crazy.
That said the whole security model of sudo makes no sense. As soon as you can access a sudoers' account you can trivially steal their password by MitMing sudo and waiting.
I think that is a bit strong. Sure, you aren't gaining much protection if you just allow sudo -su root but there are a lot of valid use cases.
Logging.
A bit of an "explicit" check to keep you from doing something stupid without thinking.
You can configure sudo to only allow specific commands from different users. (Maybe a trusted friend should have permission to reboot your Minecraft server but nothing else)
It seems Poettering is convinced doas, while decreasing attack surface, depends on SUID binary implementation which is a concern in its own right. Poettering is trying to eliminate that dependency in his `run0' implementation to reduce the attack surface even further.
... led various people to revisit the problem and come up with alternatives: most prominently there's probably OpenBSD's sudo replacement called "doas". While it greatly simplifies the tool and removes much of the attack surface, it doesn't change one key thing: it's still a SUID binary.
I personally think that the biggest problem with sudo is the fact it's a SUID binary though β the big attack surface, the plugins, network access and so on that come after it it just make the key problemβ¦
β¦ worse, but are not in themselves the main issue with sudo.
SUID processes are weird concepts: they are invoked by unprivileged code and inherit the execution context intended for and controlled by unprivileged code. By execution context I mean the myriad of properties that a process has on Linux these days, from environment variables, process scheduling properties, cgroup assignments, security contexts, file descriptors passed, and so on and so on. A few of these settings the kernel is niceβ¦
β¦ enough to clean up automatically when a SUID binary is invoked, but much of it has to be cleaned up by the invoked suid binary. This has to be done very very carefully, and history has shown that SUID binaries are generally pretty shit at that.
So, in my ideal world, we'd have an OS entirely without SUID. Let's throw out the concept of SUID on the dump of UNIX' bad ideas. An execution context for privileged code that is half under the control of unprivileged code and that needs careful, β¦
β¦ manual clean-up is just not how security engineering should be done in 2024 anymore.
With systemd v256 we are going one step towards this. There's a new tool in systemd, called "run0". Or actually, it's not a new tool, it's actually the long existing tool "systemd-run", but when invoked under the "run0" name (via a symlink) it behaves a lot like a sudo clone. But with one key difference: it's not in fact SUID. Instead it just asks the service manager to invoke a command or shell underβ¦
β¦ the target user's UID. It allocates a new PTY for that, and then shovels data back and forth from the originating TTY and this PTY.
Or in other words: the target command is invoked in an isolated exec context, freshly forked off PID 1, without inheriting any context from the client (well, admittedly, we do propagate $TERM, but that's an explicit exception, i.e. allowlist rather than denylist).
One could say, "run0" is closer to behaviour of "ssh" than to "sudo", in many ways. Except thatβ¦
it doesn't bother with encryption or cryptographic authentication, key management and stuff, but instead relies on the kernel's local identification mechanisms.
run0 doesn't implement a configuration language of its own btw (i.e. no equivalent of /etc/sudoers). Instead, it just uses polkit for that, i.e. how we these days usually let unpriv local clients be authorized by priv servers.
By isolating the contexts and the resources of client and target we remove some other classes of attacksβ¦
From what I've read, wouldn't this tool become a replacement in the same way wayland replace x11 (different method of escalation and all)? I guess what I was thinking is more like a sudo alternative, like doas for example. In any case, would change like this break a lot of workflow? If so, I doubt it will be the replacement soon.
Wayland took a monolithic system (Xorg) and broke it apart (Wayland, compositors) to try to make a smaller, cleaner codebase with separation of concerns.
systemd took an already separated system of discrete, interchangeable components and, like a katamari, rolls along absorbing services and clumping them together into one giant monolithic system. It started out as a replacement for init.d, and then decided it needed to absorb syslog, and then crond, and then mounting /home, and now it wants sudo.
systemd is the "see:" in the definition of "feature envy." Of you look up the "the Unix philosophy", systemd is the exact opposite; people who oppose systemd don't do it for no reason; they oppose it because it violates every tenant of the Unix philosophy.
I would guess the Wayland people would be aghast at the comparison.
I mean in the sense that they are replacing the method of escalation, I will not talk about its overall architecture as that is a whole can of worms. I am well aware of how SystemD works and its problem too.
This way we will have multiple sudo-tools on one system without the ability to remove all but one. Like now with all this crap like systemd-resolved, systemd-networkd, systemd-anothershitd and a bunch of tools that do the same thing, but are all required.
That doesn't seem to clear up anything other than indicating that the fork was motivated by wanting to do things differently for the sake of being able to do things differently.
Which is fine, I do this often enough. But I don't expect to get a lot of others to follow suit on that basis alone.
You were so preoccupied wondering what asinine comment you could make that you never bothered to read the article and learn the reasons that they should.