GithubHelp home page GithubHelp logo

jessfraz / onion Goto Github PK

View Code? Open in Web Editor NEW
199.0 16.0 18.0 2.46 MB

Tor networking plugin for Docker containers. Route all container tcp traffic through Tor.

License: MIT License

Makefile 14.36% Go 74.49% Shell 11.15%

onion's Introduction

onion

Travis CI

Tor networking plugin for docker containers

Installation

Binaries

Via Go

$ go get github.com/jessfraz/onion

Usage

NOTE: Make sure you are using Docker 1.9 or later

WARNING: Use with caution this is still under active development

WARNING: By default all outbound udp traffic in the network should be blocked because it will not be routed through tor.

Start the tor router

NOTE: in the future it should be easier to start any container to route and have the plugin be smart about finding it, but for now.... deal with it.

$ docker run -d \
    --net host \
    --name tor-router \
    jess/tor-router

# follow the logs to make sure it is bootstrapped successfully
$ docker logs -f tor-router

Run the plugin container

$ docker run -d \
    --net host \
    --cap-add NET_ADMIN \
    --name onion \
    -v /run/docker/plugins:/run/docker/plugins \
    -v /var/run/docker.sock:/var/run/docker.sock \
    jess/onion

Create a new network

$ docker network create -d tor vidalia

Test it out!

$ docker run --rm -it --net vidalia jess/httpie -v --json https://check.torproject.org/api/ip

Running the tests

Unit tests:

$ make test

Integration tests:

$ make dtest

Thanks

Thanks to the libnetwork team for writing the networking go plugin and of course the networking itself ;) Also a lot of this code is from the bridge driver in libnetwork itself.

Also huge thanks to the Tor project for protecting the internet.

TODO

  • FIND A WAY TO DO THIS WITHOUT IPTABLES
  • the tor router should be discoverable as any docker image or container name etc and the ports for forwarding should be able to be found through that
  • the tor router should not have to be run as --net host
  • moar tests (unit and integration)
  • exposing ports in the network is a little funky
  • saving state?
  • make deny all udp traffic configurable
  • udp integration tests suck
  • unit tests

onion's People

Contributors

calavera avatar jessfraz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

onion's Issues

DNS not resolved

Hi,

thanks for this project. Actually this was exactly what I was looking for!

I tried to follow the docs and started everything without noticeable errors but my app containers cannot resolve DNS it seems:

@da5e3bcb90a0:~> curl canihazip.com/s
curl: (6) Couldn't resolve host 'canihazip.com'

Is there any meaningful way to provide debug information?

Failed to create NAT chain!

Hey @jfrazelle

So I upgraded to 4.7.4 of Linux as well as enabled NAT and OverlayFS as modules.

I'm wondering if you ever encountered this issue when bringing up the network (vidalia) via this plugin?

Error response from daemon: NetworkDriver.CreateNetwork: Setup iptables chains failed: Failed to create NAT chain: Iptables not found

If not, I'll continue to search away. Can't seem to find a solution at the moment.

I'm using --iptables=true within the Docker daemon, despite having the NAT module + iptables module enabled ¯_(ツ)_/¯

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.