• This repository has been archived on 07/Jun/2018
  • Stars
    star
    198
  • Rank 196,898 (Top 4 %)
  • Language
    Go
  • License
    MIT License
  • Created almost 9 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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

More Repositories

1

dockerfiles

Various Dockerfiles I use on the desktop and on servers.
Dockerfile
13,270
star
2

dotfiles

My dotfiles. Buyer beware ;)
Shell
3,166
star
3

.vim

My .vim dotfiles and configurations.
Vim Script
618
star
4

gmailfilters

A tool to sync Gmail filters from a config file to your account.
Go
552
star
5

branch-cleanup-action

A GitHub action to automatically delete the branch after a pull request has been merged.
Shell
427
star
6

dockfmt

Dockerfile format and parser. Like `gofmt` but for Dockerfiles.
Go
425
star
7

k8s-snowflake

Configs and scripts for bootstrapping an opinionated Kubernetes cluster anywhere.
Shell
397
star
8

tdash

A terminal dashboard with stats from Google Analytics, GitHub, Travis CI, and Jenkins. Very much built specific to me.
Go
307
star
9

netscan

Scan network ips and ports.
Go
255
star
10

s3server

Server to index & view files in a s3 or Google Cloud Storage bucket.
Go
235
star
11

morningpaper2remarkable

A bot to sync the morning paper to a remarkable tablet.
Go
219
star
12

gitable

Bot to automatically sync and update an airtable sheet with GitHub pull request and issue data.
Go
201
star
13

advent-of-cuda

Doing advent of code with CUDA and rust.
Rust
200
star
14

hashtag-pull

Get all twitter, vine, and instagram posts with a certain hashtag, print the feed, and save to a database for future use. (old & depreciated)
PHP
180
star
15

gadgets

A repo to keep track of interesting gadgets and toys that I find or someone tells me about.
158
star
16

pony

Local file-based password, API key, secret, recovery code store backed by GPG.
Go
149
star
17

cliaoke

Command Line Karaoke.
Go
147
star
18

jenkins-dsl

Jenkins DSLs for my Jenkins instance, keeps forks up to date, mirrors repositories to private git, builds all Dockerfiles and more.
Groovy
132
star
19

containers

OCI compatible & runc configs for various containers.
Shell
129
star
20

aws-fargate-action

A GitHub action to deploy to AWS Fargate on push to the master branch.
HCL
121
star
21

blog

Source for my blog.
CSS
114
star
22

tupperwarewithspears

Distributed load testing with containers, Apache benchmark, with OpenVSwitch for networking.
Go
108
star
23

openai.vim

OpenAI GPT-3 plugin for vim.
Vim Script
96
star
24

shaking-finger-action

A GitHub action that displays a gif of Conan O'Brien shaking his finger to a pull request on fail.
Shell
95
star
25

cni-benchmarks

A simple program to benchmark various container networking (CNI) plugins.
Go
84
star
26

lkml.wtf

Source code for lkml.wtf.
HTML
78
star
27

jessfraz

74
star
28

pastebinit

Go implementation of pastebinit.
Go
73
star
29

tor

Development fork of https://git.torproject.org/tor.git
C
67
star
30

random-forest-classifier

A random forest classifier in Javascript.
JavaScript
58
star
31

irssi

Official Docker image for irssi.
Shell
50
star
32

strace2elastic

Strace container output to a file, then shove the syscalls into elastic search.
Python
49
star
33

printinator

A MacOS menubar for 3D printers.
Swift
47
star
34

macgyver

The Macgyver of Dlopening: `dlopen` yourself!
Go
45
star
35

ship

Command line tool to track packages using the AfterShip API.
Go
45
star
36

what-can-i-say-im-a-hopeless-open-source-romantic

Repo for designing shirts!
42
star
37

directory-theme

A customizable theme for your Apache or Nginx directory. (old & depreciated)
HTML
39
star
38

terraform-cluster

Scripts to create a minimal mesos or nomad cluster using terraform.
HCL
39
star
39

ykpiv

Go bindings for ykpiv so you can write Go to interact with your yubikeys.
Go
35
star
40

libyubikey

Go bindings for libyubikey so you can write Go to interact with your yubikeys.
Go
35
star
41

dstats

Docker stats dashboard for your terminal. (WIP that was never finished)
JavaScript
34
star
42

tripitcalb0t

Bot to automatically create Google Calendar events from TripIt flight data.
Go
29
star
43

battery

Linux battery status checker.
Makefile
28
star
44

apparmor-docs

Auto generated pdfs of apparmor .odt files direct from launchpad branch.
Makefile
28
star
45

junk

A place for everything without a home.
Go
27
star
46

party-clippy

Go server that shows clippy. Nice for curl in demos.
Go
23
star
47

systemd-butts

Chrome extension to replace systemd with butts on websites.
JavaScript
20
star
48

github-rate-limit

A little web app deployed to Vercel to return a more human-readable JSON output from the GitHub rate limit endpoint.
Go
17
star
49

goodreads-dewey

A tool to get the dewey decimal number for books in your Goodreads account.
Go
16
star
50

docker-presentation

Instructions on building a server with Docker and Nginx on Ubuntu trusty 14.04. (old & depreciated)
Shell
16
star
51

weirdtrickmafia.fm

Site for the podcast.
HTML
15
star
52

linux

Fork of Linux kernel for development (includes linux-security & linux-next).
C
13
star
53

jessfraz-overlay

Portage overlay with custom Gentoo ebuilds.
Shell
12
star
54

secping

A tool for reading the SECURITY_CONTACTS file in a kubernetes repository.
Go
11
star
55

usbc-pal

10
star
56

go-benchmarks

Run go test benchmarks for versions over time.
Dockerfile
6
star
57

snippetlib

Site for hosing code snippets. (old & deprecated)
Less
5
star
58

generator-xbars

Yeoman generator for node with express, handlebars, & bootstrap. (old & depreciated)
JavaScript
3
star
59

present.j3ss.co

Go talk slides made with https://golang.org/x/tools/cmd/present.
Shell
3
star
60

notorious-svg

Barrel Creative Days Project.
CSS
2
star