1) Generate a GPG private key.
2) Upload the public key to a public key server.
3) Sign your software with the key and generate a .asc file.
4) Upload your .asc file along with the software you signed to your hoster of choice.
5) Have the user copy+paste a shell one-liner that will download the files, download the public key from the public key server, import the key, verify the files are signed correctly, and install them.
The end result is cryptographic verification of your software before installation (using a 3rd party, or possibly multiple 3rd parties if you use multiple key servers) and the user only had to copy+paste a one-liner.
It's not as cool as piping to bash, but it's more secure, and more reliable (what happens when your download fails half way through installing through this bash pipe? what happens if bash hangs half way through? what if you want to install offline?)
It's quite presumptive to presume to know how a target system is to be configured.
no matter which alternative, curl|bash is security risk enough to never use: https://www.idontplaydarts.com/2016/04/detecting-curl-pipe-b...
gpg can help (below from zerotier): curl -s 'https://raw.githubusercontent.com/zerotier/ZeroTierOne/maste...' | gpg --import && \ if z=$(curl -s 'https://install.zerotier.com/' | gpg); then echo "$z" | sudo bash; fi
I'm aware of the fact that you can detect curl | bash server-side, and it's a neat trick, but I don't understand the security risk of it. The server is supplying you with arbitrary content that you're not auditing - what does it matter if it supplies you different arbitrary content?
What's the advantage of the GPG approach? Last I checked, the GPG command was capable of signing malicious binaries.
I do agree about the configuration argument. But that's not a security argument.
If you copy/paste http instead of https then you've given execution control to every single middlebox along the way.
If the code is hosted on an evil sourceforge, then you've given them execution control.
deb packages will do signature checks, any many authors will list checksums in their releases which we can use to verify.
In order to hack that package, someone would have to either A) steal the signing key from the developer's airgapped laptop, or B) hack github.com and 3 independent key servers.
This is not like some kind of "normal" software distribution pattern. Every other modern OS in the world has solved the trust issues by either verifying the software is signed, or requiring you click some button that says "I acknowledge that I am about to totally fuck up my PC with this untrusted software". The Linux distros verify package signatures, Windows verifies exe signatures, Macs do too (afaik?), Android and iOS do.
Curling to a pipe is just devs being lazy. The trust issues were solved a while ago. Not that devs being lazy is anything new. Literally the only reason anyone can use Linux at all without spending 2 weeks setting it up by hand is because somebody other than the software developers did the hard work of packaging it correctly. The curl|bash pattern is just the `./configure && make && make install` of modern devs. (But even then you could still verify the tarball signature before untarring it)
You can literally pull it from a compromised machine with an active attacker and it doesn’t matter. It either has integrity and it’s safe or it fails to install.
That’s a huge difference from encouraging people to exec curl statements from random websites loading JavaScript from ad networks, trackers, etc, etc. You’re not only trusting the original dev, you’re now having to trust the web host and all of the other locations the page sources JavaScript from.
This is why any systems serious about security used signed packages. There are way too many systems/parties in between that can knowingly or unknowingly comprise https downloads. Windows updates, Linux updates (for the majority of package managers), iOS updates, Android updates, etc.
The trust model of “curl | sh” is severely worse than signed packages. They are in no way equivalent.
There is a reason windows/android/Linux distros/iOS do signed software.
This problem was known about and was solved 20+ years ago with signed updates. “curl | sh” is back in vogue because people don’t understand the problem and think https means secure.
The only thing the installer script is doing is autodetecting your OS, picking the correct binary release, downloading it, making it executable, and copying it to /usr/local/bin. The installation instructions could just as easily tell you to do that. As with most go programs, the entire thing is just one file. No libraries, no config files, no dependencies.
Heck, wrapping it in a deb, rpm, and tarball for pacman would be easy as heck, just a one-line installer script: install -m755 <program> <prefix>/bin. I guess single-application developers just really don't like package managers.
Edit: and why even more silent downvotes?