8 ms·
> root@host:~# curl http://get.docker.io http://get.docker.io | sh No no no. Do NOT do this. Kids these days...
by beachstartup 13y ago
> root@host:~# curl http://get.docker.io http://get.docker.io | sh
No no no. Do NOT do this. Kids these days...
- tlrobinson 13y agoHonest question: do you audit every line of code you ever download and execute? Edit: Ironically Docker itself has the potential to help solve the problem of running untrusted open source code. I think every open source project should include either a Dockerfile or Vagrantfile to help users get up and running quickly, and safely run untrusted projects.
- jol 13y agoI don't, but for install script one can look at least from where the stuff will come. if the download link was using ssl...
- tlrobinson 13y agoI agree, they should use SSL (and don't use a URL shortener, which they don't, but I've seen before). Ideally it would download a file from Github too, that way you can be sure it's coming straight from the publicly visible open source repo, and you can audit if you want. But I think the general outrage over this technique is overblown.
- jlgreco 13y agoWhy don't we just add "click to execute" to browsers while we are at it... /s
- tlrobinson 13y agoBecause people who use command lines / open source software generally have better judgement about this sort of thing than the average user? You either have to trust Docker (a fairly well known project built by reputable people) isn't going to root your machine, or download the source yourself and audit it. This is no worse than suggesting you "git clone whatever; cd whatever; make" (aside from the lack of SSL)
- jlgreco 13y ago> You either have to trust Docker ...and everybody else on my network, with that method. Doing that I don't even get the chance to think "Hey wait a second, why was this only 50 bytes of shell script...". The reason that you see outrage for this "method" is because it is born of laziness and far too reminiscent of more disturbing times in computer security.
- tlrobinson 13y agoThe original poster didn't say his issue was with the lack of HTTPS so I assumed he doesn't approve of this technique in general, but yes, I agree HTTPS should be used.
- ics 13y ago> Because people who use command lines / open source software generally have better judgement about this sort of thing Why do we need an instruction on downloading the source to begin with? It really just promotes bad habits with those who know no better, i.e. new/inexperienced developers. The problem is when people see instructions like that on 20% of the guides they read in earnest, trusting that everything is OK if enough people say it. One hopes they stumble upon a discussion like this so that they can consider the consequences but that just isn't going to happen to everyone. True, one should exercise equal caution while cloning, gem-ing[1], etc. It would be great if authors would just link to the source and paste the relevant lines from the README if necessary. [1] http://andre.arko.net/2013/03/29/rubygems-openssl-and-you/ http://andre.arko.net/2013/03/29/rubygems-openssl-and-you/
- WestCoastJustin 13y agoOn my linux machines, generally, I'll only install software from trusted sources, say rpm repos or ubuntu sources. In this case, yes, I would review the source of this file before running it. For example, I would notice that it requires apt-get echo "Ensuring basic dependencies are installed..." apt-get -qq update apt-get -qq install lxc wget bsdtar Then it downloads some binary into /usr/local/bin, at this point, I'd probably configure a VM to review this further.
- tlrobinson 13y agoBut would you review the source of Docker too?
- WestCoastJustin 13y agoI think I get where you're going with this, in that, the burden to run this and review the source is too high, that it almost seems like a waste of time. If that is your point, then I agree with you. I don't know much about docker, but doing a "curl | sh" peeks my interest, then downloading additional binaries into /usr/local/bin, I'd want to take a closer look. Obviously, this is a case by case review, till it sits well with me. If I was going to run this in production, I'd want to have a really good idea of what this was doing and what to expect, so I'd probably take a closer look at the source if it was not clear from the documentation.
- JasonFruit 13y agoCompletely non-judgmentally, it's piques my interest, so you can spell it right next time. (I have the opposite problem: I spell things right and say them wrong.)
- mgkimsal 13y agoI met someone who pronounced "queue" as "kway", as in "I need to go clear my mail kway". That is all.
- 13y ago
- deleted 13y ago[deleted]
- beaumartinez 13y agoYou can curl the URL and see what it is you'll be executing. You don't get that with an obscure binary you download from the web. But the URL should be HTTPS.
- rogaha 13y agoYou can also install using this procedure: http://docs.docker.io/en/latest/installation/binaries/ http://docs.docker.io/en/latest/installation/binaries/
- malandrew 13y agoIs there any tool to automate the introspection of curl pipes to warn of potentially malicious code that needs to be given further attention? The usability of the curl pipe approach is here to stay, so the least we can do is help people be safe with it. Anyone have other ideas for making curl pipes safer?
- RodgerTheGreat 13y agoWell, detecting potentially malicious shell scripts is merely a matter of solving the halting problem... Food for thought: http://www.cs.dartmouth.edu/~sergey/langsec/ http://www.cs.dartmouth.edu/~sergey/langsec/
- malandrew 13y agoWould there be any benefit in creating a VM on the fly, running the shell script in the VM and there reporting back on what was modified by the shell script. If all goes well, I reckon you can then safely run the script on the host machine.
- RodgerTheGreat 13y agoEven if you can be bothered to semi-manually audit the changes a script applies to the VM and can afford the time and space overheads of such a "guess-and-check" approach, a malicious server could send you a different script the second time you requested it, or the script could in turn pull down other payloads differently the second time it executed. If you try to extract a diff of the changes applied to the VM and then reapply it to your host machine to ensure the behavior is the same, why not simply have an installer system which behaves in a more restricted way to begin with? The root of the problem is that shell scripts fetched from remote servers are far too flexible to be 'safe'.
- vidarh 13y ago... except when someone writes a script that guesses (or reliably detects, depending on container technology) whether it's running in a VM/container and acts differently then. Or if it only acts maliciously say, one out of five times ("old school" viruses would often do that - destroy your floppies sometimes, but most of the time just spread).
- Groxx 13y agoOf course, because binaries are incapable of doing the same thing as `curl x | sh`...
- burke 13y agoOne alternative would be a graphical installer that asks for your root password. It would very likely also be served over unencrypted HTTP. This happens all the time, and HN never calls anyone out on it. How is this different, other than a graphical installer being completely unauditable, whereas curl|sh is quite trivially auditable? Both run code as root.
- txutxu 13y agoI think there is more danger in html5 dinamyc fonts, or more evil in a dns request, than an opensource project installer. Of course, don't do this on your most beloved production machine, if you can package it properly, test it, etc But rendering a font gives execution with your user, so don't be so afraid of a installer "you can read" and has an interesting purpose.
- antocv 13y agoThis also sucks because the scripts always assume some variant of Ubuntu or Debian. Um, no, thank you, damn hipsters.
- mateuszf 13y agoOn Arch Linux installation is as simple as chosen_aur_wrapper -S lxc-docker-git
- drivebyacct2 13y agoOn what planet is an Ubuntu user a "hipster"?
- throwaway2048 13y agodrivebyacct2 you are hellbanned, time for drivebyacct3 i guess
- shykes 13y agoThe website offers install instructions for several OSes: http://docs.docker.io/en/latest/installation/ http://docs.docker.io/en/latest/installation/
- slashdotdotorg 13y agoExactly _what_ is your qualification for debian being lumped in with hipsters? Some of us have used it as the most rock solid STABLE linux distro for servers and desktops for quite a long time.
- antocv 13y agoI apologize to Debian users. Respect.
- peatmoss 13y agoHe's an avid Yggdrasil user. As an aside, I miss some of the raw diversity that was present in the old Linux distros. Slackware was my drug of choice due to its steadfastly BSD flavor. I guess Slackware is still around, but have no idea what its status is and whether Patrick ever moved it over to system v-ish convention in order to be more like other Linux distros. I guess that distinction is even a bit anachronistic given all the fancy changes to the way init is done nowadays.
- anonymoushn 13y agoThis is how rvm's authors want you to install rvm :)
- kawsper 13y agorvm uses https, which is far better than plain http.
- rogaha 13y agoI have updated the blog post with a more secure way of installing docker.