Skip to content
This repository was archived by the owner on Apr 1, 2019. It is now read-only.

Securely install Tor#8

Closed
Hainish wants to merge 3 commits intopatrickod:masterfrom
Hainish:master
Closed

Securely install Tor#8
Hainish wants to merge 3 commits intopatrickod:masterfrom
Hainish:master

Conversation

@Hainish
Copy link

@Hainish Hainish commented Feb 24, 2015

Check the tor tarball with appropriate signing keys to ensure authenticity of the download.

The reason for the /tmp/gpg directory is to silo off keys we're not sure about, since we download with the (still) insecure gpg --recv-keys <short-key-id> - see https://evil32.com/. Even though this has been patched in latest versions of GPG, the packages in Ubuntu have yet to catch up.

With --export <fingerprint>, we can be sure we're selecting by the entire key, which is imported to the keyring we actually verify with. If the verify fails, docker build will halt.

I also have the slim version of this, which is to run all the download and build steps in a single Dockerfile command, available at https://github.com/Hainish/docker-tor/tree/slim. This may be desirable for those downloading the docker image based on filesize. It also may be undesirable for those building manually, if some intermediate step fails they can't easily re-run. For this reason I haven't included it in this PR.

@Hainish
Copy link
Author

Hainish commented Feb 24, 2015

legind@X1 ~/workspace/docker-tor (master) $ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
tor-server-slim     latest              751d16b377c6        59 seconds ago      335.9 MB
tor-server          latest              ebd3c8e2dac8        About an hour ago   469.4 MB

ypid added a commit to ypid/docker-tor that referenced this pull request Mar 29, 2015
…od#8.

* Debian is the recommended base image for Docker.
* Changed volume of tor home dir to the default one /var/lib/tor.
  Note that when I do `docker rm … && docker run …` docker will not use
  the previously used volume but instead create a new container
  resulting in new private keys being generated.
  I use `docker run -v /srv/tor:/var/lib/tor` for persistent storage.
* apt automatically checks packages with GPG. Related to patrickod#8.
* One could also run tor inside the Docker container as debian-tor user.
  But note that the UID of debian-tor might be mapped to a different user
  outside of the container resulting in read+write access for this user
  to the private key.
@patrickod
Copy link
Owner

Sorry about the delayed response here. I accidentally unsubscribed from my own repositories.

I had a look at #9 and I think it does a good job of a) verifying the package being installed and b) cutting down the resulting image. It weight in at 268MB when I took it for a spin locally.

I'm inclined to close this in favour of #9, but would love feedback if I'm missing anything RE: package verification. I'm not hugely familiar with how Debian deals with this.

Thanks for the PR! Sorry for the delayed response 😨

@patrickod patrickod closed this in ed316bf May 2, 2015
patrickod added a commit that referenced this pull request May 2, 2015
Updated to tor 0.2.5.11 from deb package and switched to Debian jessie. Closes #8.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants