Point is, somebody made something better than this little install shell script. I'll accept pip, I'm not picky.
There is almost surely no reason for $thing to be writing to my system directories. Nobody should be coaching this, it can go wrong in every way.
Binaries and libraries can come from my home directory. You won't find /home mounted with noexec outside of strict compliance environments.
Build services like OBS and COPR make the actual equipment investment of building packages basically non-existent. Roaming repositories for any distribution you could want.
Leaving the one-time cost of writing out the specs... and I suppose maintaining dependency creep.
That maintenance isn't that expensive because you'd be maintaining them in the script anyway. You're just using common domain language
Do these things and you cover 95% of the DSL:
- PKGBUILD (basically the script, AUR means you'll get maintainers)
- RPM
- DEB
Say a fourth significant option comes around, I'll guarantee you the concepts are similar enough.Macro creep is real, but this is the cost of maintenance work. Give us something to maintain.
Signed,
- A person maintaining several packages for projects with no upstream involvementThey're signed the same way as your first party packages.
If you trust the developer/maintainer, you can trust these services. It's literally the same infrastructure as OpenSUSE/Fedora/Red Hat.
As a developer you don't have to provide the infrastructure or equipment, simply whatever is to be built.
I'm not suggesting people provide their software by pure RPM or DEB files. The repositories do the important part of actually distributing the software.
If you're on either OBS or COPR you're on the fast path to having the OS maintainers do the work for you
This was the main thing I’m reacting to: installing from something like pip is usually running a ton of unvetted code downloaded from the internet. If you trust such package managers, you might as well curl to a shell.
I'll take package managers over shell scripts in concept for one main reason: they reduce reinvention.
The supply chain is always of concern, of course.
A shell script benefits from coreutils -- cp, mv, things like that. You're on your own for everything else, I don't trust that.
They themselves are untrusted code -- for all we know there's no VCS behind it at all. A package manager at least offers some guardrails!
With packages on OBS/COPR, you can at least know/verify the sources you're installing were built in a clean (offline) environment from the upstream sources. It's a small, but notable, improvement.
Also consider you need to rebuild your system and you'd like it to look the same after.
Will you find it easier to run 'pip freeze' / 'dnf history userinstalled'... or crawl your shell history for curl | bash and resolve any drift?
But there's nothing trusted about them is the point, you can ship a deb or rpm with all sorts of scripts running at installation, this is no safer than curl | sh.
If anything it's worse, when you "curl | sh" and it requests sudo you can go "mmm no we're not doing this I will happily risk compromising all my user data but it stops at my system integrity".
rpm or deb you're already running as root.
> If you trust the developer/maintainer, you can trust these services.
And you can also trust their site which you're curl-ing from.
I'm assuming some adherence to these guidelines, otherwise they should be removed from the service: https://docs.fedoraproject.org/en-US/packaging-guidelines/#_...
A package adhering to this guideline modifying system files, as designed, is not a problem. They are explicitly prohibited from modifying user data.
My point with managers vs scripts is that managers provide some sanity. Not perfection.
I trust:
- a versioned package
- built to the linked standards
- from upstream sources in an offline environment
Far more than I do curl | bash. There is far less ambiguity and I can actually reproduce this exact environment at some point.It’s a lot of busy work but we guaranteed that we had all dependencies in house and that the same package had the same layout of files across every OS
Authors better stick to traditional UNIX-style build system, which allows to pickup dependencies from local system without problems, and all distro-specific thing will be done by distro guys.
I've ported 10+ software packages to FreeBSD ports in last 20 years, on principle "I need this, it is not in the ports yet, make new port for it". Typically it takes 2x-3x time to single source build, i.e. one day top, if it is not something super-complex like KDE and it is possible at all (i.e. not very Linux-specific when FreeBSD doesn't have required APIs).
Modern build systems like npm and maven, which want to download and build all dependencies by themselves, are problem for this, I admit.
Adding maintenance overhead to a FOSS project to support a package manager is one thing, adding support for every Flavor Of The Week package manager after that initial time investment is tougher, especially when the first one is no longer en vogue.
tl;dr : the thousands of ways to package data for NIX creates a situation in which hurts maintainability unless the package maintainer lucks into picking the one that their crowd wants for any length of time. Piping data from curl works just about anywhere, even if it's a huge security faux-pas waiting to happen.
semi-unrelated aside : it strikes me as humorous that people on that side of OS aisle have cared so much about pipes being a security issue for years and years, whereas on the MS side of things people still distribute (sometimes unsigned) binaries all over the place, from all over the place, by any random mary/joe. (not to say that that's not the case on the nix side, but it feels more commonplace in MS land, that's for sure.)
Nobody has time to create packages for 8 different distros.
But it's not about you giving an rpm package at will. It's about the distro including packages in its official distribution and many people installing the very exact same package. Instead of people randomly pulling install scripts from the Web which can, for all we know, at every curl, be fetching a different install script.
In addition to that Debian has an ever growing number of packages which are fully reproducible, bit for bit. All these executables, reproducible bit by bit.
When I install a package from Debian I know many people have already both scrutinized it and installed it. It's not a guaranteed nothing shady is going on but what's safer:
- installing a Debian package (moreover reproducible bit for bit) which many people already installed
- curl bash'ing some URL at random
Anyone who says the two offer the same guarantees is smoking something heavy.
It's all too easy to sneak it in a backdoor for, say, once every 100 download when you moreover detect, as in TFA, that curl bash'ing is ongoing. And it's hard to catch. And it's near impossible to reproduce.
When you install from a package that's full reproducible: there's nowhere to run, nowhere to hide, for the backdoor once noticed. It shall eventually be caught.
Here's why it matters (FWIW there are tens of thousands of Debian packages which are fully reproducible):
https://reproducible-builds.org/
Thinking that installing a package "isn't really any better" than curl bash'ing from a URL is, plain simply, wrong.
yeah, if the package is delivered through the same channel as the bash script, and not anchored by anything external, you lose those benefits. but even hosting the package contents through pip or cargo or AUR or just unaffiliated and manually synced mirrors is a (relatively easy) way to decrease that attack surface.
If you want to depend on system-wide stuff, or, worse yet, provide shared system-wide stuff, it's time to create a proper OS package (a bunch of them: Debian, Ubuntu, Fedora, Nix, etc).
The curl | bash approach has only one upside: you can store the script, inspect it, then run. I did that a couple times. Because otherwise it's a pretty scary operation, a very literal RCE.
Not having to waste countless hours on whatever distro's package format of choice is a pretty big upside.
And those are also RCEs if you're not upstreaming the package (which you likely are not because that increases the amount of time needed by an order of magnitude) as most package managers have multiple scripting points which run arbitrary code, and usually run as root already.
Something like: https://getsum.pub
You need to use an appropriate license, you can't download stuff from the internet, you can't vendor libraries.
Ubuntu, Debian, Gentoo, Arch, etc., support third-party repositories and packages with bad licenses: the user adds the repo / installs the deb / etc. Pacman, in particular, even has direct support for such, and calls them out (to help ensure the user knows, and perhaps reads, the license).
Then I know I can gracefully uninstall the package by just asking the package manager to do that.
(You don't have to unvendor libs, either: if you install into something like /opt/$pakage_name, you can keep vendored libs in there. You should unvendor them, though.
Yeah, downloading stuff from the Internet in the middle of a package install is definitely harder with some package managers, but IMO that's a poor practice.)