News for hackers. Stuff that matters.
Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by beachstartup on Monday July 08, 2013 @02:16PM (#6008196)
> root@host:~# curl http://get.docker.io | sh

No no no. Do NOT do this. Kids these days...

Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by tlrobinson on Monday July 08, 2013 @02:22PM (#6008240)
Honest 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.

Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by WestCoastJustin on Monday July 08, 2013 @02:48PM (#6008408)
On 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.
Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by tlrobinson on Monday July 08, 2013 @02:50PM (#6008422)
But would you review the source of Docker too?
Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by WestCoastJustin on Monday July 08, 2013 @03:01PM (#6008497)
I 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.

Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by JasonFruit on Monday July 08, 2013 @08:31PM (#6010364)
Completely 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.)
Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by mgkimsal on Tuesday July 09, 2013 @01:17AM (#6011233)
I met someone who pronounced "queue" as "kway", as in "I need to go clear my mail kway".

That is all.

Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by zobzu on Monday July 08, 2013 @06:21PM (#6009745)
Do you reverse engineer your CPU's schematics?

This can go on pretty far - trust is always an eventually unsolvable issue.

There is a certain level of trust that is easy to achieve and easy to get. Trusting dotcloud is easier than trusting everyone on the internet is pink bunny. Happens to be that HTTPS and signing aren't exactly hard either ;-)

Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by jlgreco on Monday July 08, 2013 @02:27PM (#6008272)
Why don't we just add "click to execute" to browsers while we are at it... /s
Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by tlrobinson on Monday July 08, 2013 @02:34PM (#6008323)
Because 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)

Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by jlgreco on Monday July 08, 2013 @02:38PM (#6008344)
> 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.

Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by tlrobinson on Monday July 08, 2013 @02:41PM (#6008359)
The 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.
Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by ics on Monday July 08, 2013 @04:24PM (#6009044)
> 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/

Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by jol on Monday July 08, 2013 @02:25PM (#6008263)
I don't, but for install script one can look at least from where the stuff will come. if the download link was using ssl...
Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by tlrobinson on Monday July 08, 2013 @02:37PM (#6008335)
I 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.

Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by burke on Monday July 08, 2013 @02:53PM (#6008440)
One 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.

Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by zobzu on Monday July 08, 2013 @06:17PM (#6009729)
Put your packages in signed repositories and start serving over https. Then people can even do apt-get install docker. yay.
Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by jpetazzo on Monday July 08, 2013 @06:24PM (#6009753)
Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by beaumartinez on Monday July 08, 2013 @02:25PM (#6008259)
You 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.

Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by Groxx on Monday July 08, 2013 @02:39PM (#6008347)
Of course, because binaries are incapable of doing the same thing as `curl x | sh`...
Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by antocv on Monday July 08, 2013 @03:55PM (#6008880)
This also sucks because the scripts always assume some variant of Ubuntu or Debian. Um, no, thank you, damn hipsters.
Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by slashdotdotorg on Monday July 08, 2013 @08:58PM (#6010450)
Exactly _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.
Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by peatmoss on Tuesday July 09, 2013 @09:38AM (#6012562)
He'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.

Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by antocv on Tuesday July 09, 2013 @03:21AM (#6011540)
I apologize to Debian users. Respect.
Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by aclevernickname on Tuesday July 09, 2013 @02:51PM (#6014476)
I have debian bo on vinyl.
Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by shykes on Monday July 08, 2013 @05:45PM (#6009550)
The website offers install instructions for several OSes: http://docs.docker.io/en/latest/installation/
Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by mateuszf on Tuesday July 09, 2013 @05:50AM (#6011852)
On Arch Linux installation is as simple as chosen_aur_wrapper -S lxc-docker-git
Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by throwaway2048 on Monday July 08, 2013 @05:33PM (#6009476)
drivebyacct2 you are hellbanned, time for drivebyacct3 i guess
Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by rogaha on Monday July 08, 2013 @02:29PM (#6008287)
You can also install using this procedure: http://docs.docker.io/en/latest/installation/binaries/
Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by txutxu on Monday July 08, 2013 @02:53PM (#6008441)
I 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.

Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by rsync on Monday July 08, 2013 @06:25PM (#6009760)
"But rendering a font gives execution with your user"

Would you point us to a reference, or a further explanation for this claim ? I am genuinely interested...

Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by txutxu on Monday July 08, 2013 @06:38PM (#6009823)
Sure, it was just an example...

http://securitytracker.com/id/1024283

Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by anonymoushn on Monday July 08, 2013 @04:04PM (#6008930)
This is how rvm's authors want you to install rvm :)
Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by kawsper on Monday July 08, 2013 @11:30PM (#6010933)
rvm uses https, which is far better than plain http.
Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by malandrew on Monday July 08, 2013 @02:32PM (#6008302)
Is 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?

Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by RodgerTheGreat on Monday July 08, 2013 @02:59PM (#6008484)
Well, detecting potentially malicious shell scripts is merely a matter of solving the halting problem...

Food for thought: http://www.cs.dartmouth.edu/~sergey/langsec/

Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by malandrew on Monday July 08, 2013 @03:48PM (#6008829)
Would 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.
Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by RodgerTheGreat on Monday July 08, 2013 @04:10PM (#6008962)
Even 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'.
Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by tlrobinson on Monday July 08, 2013 @08:49PM (#6010425)
Or... use Docker!

Seriously, Docker is perfect for creating a sandbox with all dependencies to help new users get up and running quickly and safely. Every project should come with a Dockerfile and/or Vagrantfile.

Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by vidarh on Monday July 08, 2013 @04:23PM (#6009038)
... 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).
Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by gcr on Monday July 08, 2013 @07:12PM (#6010023)
Sounds like a great application of Docker, come to think of it. I'm sure it's quite possible to spin up a new docker VM from a shell script and do exactly that.

Hm, the only problem is installing Docker in the first place ...

Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by shykes on Monday July 08, 2013 @07:38PM (#6010131)
We're working on a few things that will make that much easier :)
Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by jol on Monday July 08, 2013 @03:02PM (#6008506)
I am not very good at unix command line, but maybe it could be done like this: curl http://get.docker.io > /tmp/docker-install && sh /tmp/docker-install && rm /tmp/docker-install that gives quick and easy way to inspect by executing only first command and then inspecting the source, i.e., 1) copy just first part curl http://get.docker.io > /tmp/docker-install 2) then inspect, e.g. cat /tmp/docker-install 3) run the install sh /tmp/docker-install && rm /tmp/docker-install or, if not reviewing run whole at once

p.s. I know, that there should not be direct copy-paste from browser to console and this method leaves a file in /tmp on installation failure

Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by darkarmani on Tuesday July 09, 2013 @11:38AM (#6013194)
> The usability of the curl pipe approach is here to stay, so the least we can do is help people be safe with it.

I don't think this is true. It's just going to take a very popular project getting their DNS hijacked before everyone wakes up.

Well, you are right about the usability part. That part is amazing. It's just that curl-pipe is not the answer.

Re:Docker Desktop: Your Desktop over ssh inside of a Docker ... by rogaha on Monday July 08, 2013 @08:42PM (#6010404)
I have updated the blog post with a more secure way of installing docker.