6 ms·
deb/rpm is better because it's usually signed by maintainer with GPG keys. I think that it's harder to steal keys from maintainer than to infiltrate web server.
by vbezhenar 8y ago
deb/rpm is better because it's usually signed by maintainer with GPG keys. I think that it's harder to steal keys from maintainer than to infiltrate web server.
- api 8y agoWe came up with a way to do gpg verified curl | bash for ZeroTier. It still works without gpg too. Scroll down to Linux. https://zerotier.com/download.shtml https://zerotier.com/download.shtml
- e12e 8y agoQuote(trying to fit it to narrow widt, for others on mobile): curl -s \ 'https://pgp.mit.edu/pks/lookup?op=get&search=0x1657198823E52A61' | gpg --import \ && if z=$(curl -s 'https://install.zerotier.com/' | gpg); then echo "$z" | sudo bash; fi It's interesting - it tries to import a given gpg key from keyserver, then grabs a gpg armored text file with a bash header - with the gpg header wrapped in a here-document: #!/bin/bash <<ENDOFSIGSTART= -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 ENDOFSIGSTART= I'm unsure, but I think you could just stick your malicious code before the signature? #!/bin/bash sudo much_evil <<ENDOFSIGSTART= -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 ENDOFSIGSTART= So it really isn't any better, as far as I can tell. There's also a trade-off between scripts that can be typed (curl https://i.com.com https://i.com.com) and need copy-pasting - as copy-pasting also isn't safe - even if that's a somewhat different attack vector (compromising the web site, altering js depending on visitor).
- api 8y agoPutting malicious code before the signature doesn't work because gpg chops it out. It only outputs the verified part. It is definitely a kludge though.
- cjbprime 8y agoFor the most part you receive the GPG keys over the same TLS connection, though.
- sigjuice 8y agoNot sure what you mean. I don’t think apt-get install foo involves transferring GPG keys.
- cjbprime 8y agoWe're comparing the security properties of `curl https://somesite.com/foo.sh https://somesite.com/foo.sh | bash` with `curl https://somesite.com/foo.deb` https://somesite.com/foo.deb` and `curl https://somesite.com/apt.key https://somesite.com/apt.key | sudo apt-key add - && sudo apt-get update && sudo apt-get install some-software` I don't think there are very meaningful differences in the security properties -- I don't think it's more difficult to become compromised by one than by one of the others.
- hueving 8y agoNo, you're deliberately choosing a bad way to get a key to try to prove your point. You shouldn't be fetching a key from the site that might be compromised.
- geocar 8y ago> You shouldn't be fetching a key from the site that might be compromised. You shouldn't, but people do, and are being directed to do so increasingly as Linux becomes more popular. Software developers want to be software publishers so bad that they're just going to keep pushing, and therein lies the risk: If people get the impression that packages are somehow more secure than shell scripts, then these kinds of attacks will simply become more prevalent. To you it's obvious that packages aren't more secure, it's how you get them that makes their normal use more secure. That's apparently too subtle a point for even big companies like Microsoft. https://pydio.com/en/docs/v8/ed-debianubuntu-systems https://pydio.com/en/docs/v8/ed-debianubuntu-systems https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-docker-ce https://docs.docker.com/install/linux/docker-ce/ubuntu/#inst... https://www.spotify.com/uk/download/linux/ https://www.spotify.com/uk/download/linux/ https://www.elastic.co/guide/en/apm/server/current/setup-repositories.html https://www.elastic.co/guide/en/apm/server/current/setup-rep... https://ring.cx/en/download/gnu-linux https://ring.cx/en/download/gnu-linux http://docs.grafana.org/installation/debian/ http://docs.grafana.org/installation/debian/ https://support.plex.tv/articles/235974187-enable-repository-updating-for-supported-linux-server-distributions/ https://support.plex.tv/articles/235974187-enable-repository... https://stack-of-tasks.github.io/pinocchio/download.html https://stack-of-tasks.github.io/pinocchio/download.html http://download.mantidproject.org/ubuntu.html http://download.mantidproject.org/ubuntu.html https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-apt?view=azure-cli-latest https://docs.microsoft.com/en-us/cli/azure/install-azure-cli... (!!!)
- geocar 8y agoThey could be. dpkg and rpm will still install unsigned packages by default. That's one problem. Another problem is that people are being trained to get software [directly] from software developers.