by constantcrying · 2y ago · 0 comments
My issue isn't even that someone tries to replace sudo. That may or may not be a completely fine thing to do, depending on the state of sudo and what improvements can be made. But what makes me really upset is this completely unexplainable need to make everything part of one particular init system. There is absolutely no reason to tie your new sudo replacement to systemd. Absolutely none.
This is a completely insane way to develop software, instead of creating a new piece of software in a separate project they will force all their projects simultaneously onto all their users for absolutely no reason.
I am very glad to have jumped ship from systemd. It is particularly bad software created by a team of people who engage in very bad practices and a totally unhealthy view of software in general.
It is not unexplainable at all. In fact, the article explains it very well.
sudo allows you to execute code as another user. If you think about it, you could also replace sudo with ssh to localhost - just set a root password and allow root logins. Now, security-wise, this would obviously be a bad idea. Our current solution is to give the sudo binary itself administrative privileges, which is a slightly less bad idea, but still pretty bad.
Systemd already handles logins, so it is quite obvious that it could also handle this problem very well, and in fact, it already does: there is a tool systemd-run which you can already use. It will create a completely new process and will handle communication to it, just like ssh, but without the above downsides.
Exactly that was my objection.
Reasons:
- systemd is a large beast -- no need to make it larger with unrelated things
- the Unix philosophy seems to be applicable here
- the result should be portable to non-systemd systems
> But what makes me really upset is this completely unexplainable need to make everything part of one particular init system
systemd is not init system, its and umbrella project for various core system components, which includes an init system.
> There is absolutely no reason to tie your new sudo replacement to systemd
well, in this case there is good reason to have it interact with service manager in general
> 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 [...] 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
strictly speaking it's not 100% coupled to systemd specifically, it most likely uses systemds d-bus API, which is part of their "portable and stable" APIs and as such could be implemented by other service managers https://systemd.io/PORTABILITY_AND_STABILITY/
> This is a completely insane way to develop software, instead of creating a new piece of software in a separate project they will force all their projects simultaneously onto all their users for absolutely no reason
The couplings between systemd projects are not that tight, you can pick and choose which parts you want, they explicitly are not "forcing all their projects" to consumers. The minimal systemd build has only init, journald, and udev, which is not exactly sprawling huge. All the rest of the projects are fully optional, and I believe quite many of them can actually work without systemd-init
The point being made is that it directly depends on the init system part.
> well, in this case there is good reason to have it interact with service manager in general
I disagree! There's no reason to not have it be its own daemon with its own configuration and looser bindings to the rest of the systemd ecosystem (e.g. through dbus and other protocols). KDE applications do this a lot, where they take advantage of other KDE components if present. This is strictly a philosophy thing and not a requirement for achieving what he proposes.
> their "portable and stable" APIs
"we're portable if you reimplement our APIs", idk how this is an argument. They consistently make very little effort to be compatible with (or provide fallbacks for) what's already there. Having stable APIs is nice but there's a reason most of the interfaces on that page don't have alternative implementations: They solve questionable problems and provide no tangible benefits over the methods there were before. Yet projects feel compelled to hard-depend on them...
> The couplings between systemd projects are not that tight, you can pick and choose which parts you want, they explicitly are not "forcing all their projects" to consumers.
In practice they are. The primary reason why everything is shipped as a single project is because that makes it easier to make available in different distros (they just enable everything), allowing it to become the "de facto" standard since it's available everywhere. There's a lot of projects that solve some of the systemd tools' in sometimes better ways, that never see the light of day because they don't have a trojan horse to ride in with.
There's a reason why projects like elogind exist, because there's only a very select few systemd tools that work without systemd at all
Obviously one of these groups is lying.
This is literally just basic systems engineering. I don't even know what you are arguing here. The more tightly integrated a system is the harder it is to replace individual components.
https://skarnet.org/software/s6/s6-sudo.html
I was very surprised when I learned about it, but it does make sense (for s6 at least).
> There is absolutely no reason to tie your new sudo replacement to systemd. Absolutely none.
With s6, the idea is to replace a SUID binary with an IPC mechanism. That does make sense, since (parts of) the init system need to be running as root.
> I am very glad to have jumped ship from systemd.
All that aside, so am I.
Same idea with systemd-run.
It's less "a new thing has been created with systemd" and more "a user interface was exposed for an existing functionality".
You should look at it differently, and then it'll make perfect sense.
systemd has long stopped being just an init system. It's a system tooling suite. When thinking about systemd don't think "PID 1", think "Linux New System Software Suite". It's a big umbrella project in the style of Gnome and KDE.
For example, systemd-boot is a perfectly normal bootloader that's just been systemd-themed. It has a "ctl" tool, has the same command-line aesthetics as other systemd-group tooling, and so on. It's not in any way dependent or even interested in the init system.
I think that this has always been the core criticism of anyone who objects to them. Besides systemd, the init system, just being very poorly thought out.
> 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.
I understand your frustration, but systemd isn't the first attempt to build an integrated system. It just happens to run on Linux. It isn't insane to develop software this way, from that perspective.
That's just not true. Just because a system uses systemd the init system doesn't mean the it is forced to use the other components.
Gentoo folks have eudev or seatd but thats an uphill battle.
You can not try to create a large coherent system and then tell people they shouldn't use that particular part. That is totally disingenuous. Systemd is DESIGNED to be an all or nothing deal.
^[Citation needed]
The systemd developers are tying it to systemd because they are systemd developers. If somebody else made something like this, it wouldn't be tied to systemd. But somebody else hasn't made something like this.
Sudo isn't going to just go away (unfortunately). You can keep using your CVE-ridden setuid binary as much as you want.
See 6.6 Error handling and input streams (eg stdin) on https://www.chiark.greenend.org.uk/~ian/userv/spec.html/ch-n...
systemd's run0 on the other hand doesn't require code to be written specifically to work with it.
What? Literally every single other group of software developers has managed to create two projects. Even Microsoft can do it.
It is said right there: the reason is to avoid the awkward SUID issues, and to have a privileged process create the process.
> If I chroot and then run0 will that process also run in the chroot?
That's an interesting question and it's not quite clear to me what should be the answer. For example, one legit answer might be that it would not work at all (in which case you would need to use some other tool that fits your needs), or another would be that the policy can decide what to do in that case.
But wouldn't you agree that it is better security hygiene to explicitly opt-in to inheriting properties when going to an elevated security level, instead of opting out from them?
Why don’t you propose a better solution? How would your non-systemd solution actually work?
Because I'm pretty sure that most of the components are optional.
You did not even discuss the reasoning given for not using sudo to instead hop on your soapbox to say it's bad software with bad practices and that they are stupid.
It's annoying how in the the more surface level Linux communities there's 0 value in discussing systemd.
"1 million lines of code for PID0!"
The new thing is blaming systemd for that recent exploit even though distros were patching in the bug themselves.
People analysing the exploit determined that a new version of systemd was going to prevent the exploit vector so the exploit seemed to have been rushed out.
Isn't this just textbook FUD?
What I've noticed is over the years is systemd would have identified a gap in functionality.
Like systemd-homed having a solution for automatically encrypting home directory when the machine is suspended.
Is that a functionality that OSX has had for years? Yes.
But anti-systemd people will dislike it automatically.
No, I am a dedicated systemd hater ever since I spend over a month full time writing and debugging systemd services for work. Systemd (the init system) is just all around badly designed and executed, I have very little confidence in the developers and their technical abilities and their tendencies to expand into completely unrelated areas for seemingly no reason makes me quite concerned.
I wouldn't blame the xz exploit on them, it is very hard to call it their fault in any way. But I do think it is a symptom of a system which has grown far too thin and wide.
You're essentially saying that the month you spent is enough for you to call it bad and the creators incompetent.
What qualifies you to make a determination like that?
There is never any actual technical reasons it's always about vague things like not adhering to UNIX philosophy, lines of code or it being badly designed (without any real architectural criticism)
This is an article about why they believe sudo isn't a good system. Where's your criticism of that from a technical / security perspective?
It's been about 10 years since systemd was adopted by Debian/Ubuntu/Redhat/Fedora etc.
Millions of deployments over the years. The companies that build and are paid to support for years with SLAs the operating systems are using it without issue.
I did not mention the first two, so please do not pretend I argued that. For bad design look at transactions. That is really dumb and makes the system near incomprehensible. The documentation is bad, dbus is literally so bad they tell you not to use it without a wrapper. The terminology is very questionable and makes it hard to explain what a unit actually does.
But I don't even see that as the worst part. The worst part is that they fundamentally can't do basic software engineering, in the sense that they do not have a defined project scope. Everything is potentially a systemd issue and not once does anyone take a step back and say "maybe systemd" isn't the right place to fix that problem.
>This is an article about why they believe sudo isn't a good system. Where's your criticism of that from a technical / security perspective?
If you don't read my posts please do not respond to me. Look at the first post I made and carefully read it.
Well, there's also a reason they are doing it, and many aspects of it (seatd, timesyncd, resolved, run), and more neat than cobbling together bash scripts. I like it
I appreciate and respect the KISS sentiment of doing one thing and doing it well, but oftentimes I also think open source programs' lack of integration with each other at a fundamental level is also one of its biggest downsides.
Being a Windows wizard unlike most folks around these parts, seeing and using the tight integrations between all the Windows subsystems is frankly marvelous and I wish Linux could have something like that.