an introduction to the tor ecosystem for developers · 2020. 2. 2. · whatistor?...

48
An Introduction to the Tor Ecosystem for Developers Alexander Færøy February , FOSDEM

Upload: others

Post on 12-Sep-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

An Introduction to the Tor Ecosystem forDevelopers

Alexander FærøyFebruary 2, 2020

FOSDEM

Page 2: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

About Me

• Core Developer at The Tor Projectsince early 2017.

• Free So�ware developer since 2006.• Worked with distributed systems inthe Erlang programming language,WebKit-basedmobile web browsers,consulting, and firmwaredevelopment.

• Co-organizing the annual Danishhacker festival BornHack.

1

Page 3: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

What is Tor?

• Online anonymity, and censorshipcircumvention.◦ Free so�ware.◦ Open network.

• Community of researchers,developers, users, and relayoperators.

• U.S. 501(c)(3) non-profitorganization.

2

Page 4: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

HistoryEarly 2000s Working with the U.S. Naval Research Laboratory.2004 Sponsorship by the Electronic Frontier Foundation.2006 The Tor Project, Inc. became a non-profit.2008 Tor Browser development.2010 The Arab spring.2013 The summer of Snowden.2018 Anti-censorship team created.2019 Tor Browser for Android released.2020 Network Health team created.

3

Page 5: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

Somewhere between 2,000,000 and 8,000,000 daily users.

Page 6: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay
Page 7: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay
Page 8: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

But we also ship Tor to others:

• We have our own Debian mirror on deb.torproject.org.• Other free so�ware distributions. This is o�en where the relayoperators get their Tor version from.

• Brave’s "Private Tab" feature uses Tor.• OnionShare, SecureDrop, etc.

Page 9: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

The Tor Network

2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020

0

2,000

4,000

6,000

8,000

Number of Relays

Relays

Bridges

Source: metrics.torproject.org 8

Page 10: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

The Tor Network

2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020

0

200

400

600

BandwidthinGbit/s

Total Relay Bandwidth

Advertised Bandwidth

Bandwidth History

Source: metrics.torproject.org 9

Page 11: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

The Tor Network

Tor’s safety comes from diversity:

1. Diversity of relays. The more relays we have and the morediverse they are, the fewer attackers are in a position to dotra�ic confirmation.

2. Diversity of users and reasons to use it. 50,000 users in Iranmeans almost all of them are normal citizens.

Research problem: How do wemeasure diversity over time?

10

Page 12: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

The Tor Network

2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020

0

2,000

4,000

6,000

Number of Relays per Platform

Linux

BSD

Windows

macOS

Other

Source: metrics.torproject.org 11

Page 13: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

https://trac.torproject.org/

11

Page 14: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

11

Page 15: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

Network Team

The team dedicated to develop andmaintain the “Tor” codebase.

Internally, we o�en refer to “Tor” as “little-t-tor”.

Deal with everything that “impacts the network”.

12

Page 16: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

Network Team

• The reference Tor implementation is written in C.• Ongoing experiments with Mozilla’s Rust programminglanguage.

• Follow best practices: high coverage for tests, integrationtests, coverity, static code analysis, and code review policies.

• The team is responsible for: feature development, codereviews, auditing, working with downstream projects (TorBrowser and distro packagers), and specification design andimplementation.

13

Page 17: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

Source: viva64.com 14

Page 18: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

Tor Releases

Version Merge Window Feature Freeze Release End of Life

0.3.5 (LTS) 15/6/2018 15/9/2018 7/1/2019 1/2/20220.4.0 15/10/2018 15/1/2019 2/5/2019 2/2/20200.4.1 15/2/2018 15/5/2019 20/8/2019 20/5/20200.4.2 10/6/2019 15/9/2019 9/12/2019 15/9/20220.4.3 11/10/2019 15/1/2020 15/4/2019 TBD

0.4.4 15/2/2020 15/5/2020 15/8/2020 TBD0.4.5 15/6/2020 15/9/2020 15/12/2020 TBD

15

Page 19: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

Contributing to Tor

1. Find a ticket on https://trac.torproject.org/ thatyou are interested in hacking on.

2. Hack on it until you think it’s time to share your work.3. Ensure that tests and various other code requirements aresatisfied using make check.

4. Write a "changes" file.5. Open a PR on https://github.com/torproject/torand await review.

16

Page 20: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

Contributing to Tor

• For “upfront CI” we use a mixture of Travis and AppVeyor. Thiscovers (some of) Linux, macOS, and Windows.

• Once a patch lands, we have a setup of Jenkins builder too.• Check whether “changes” file is included, whether functionsbecome overly complex, etc.

17

Page 21: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

Contributing to Tor

Protocol changes require a specification proposal and discussionbefore implementation.

Specifications can be found at gitweb.torproject.org/torspec.

18

Page 22: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

Bandwidth Scanning

The Tor Network

E1R1

R3

R4

R5 R6

R2

WebserverBandwidth Scanner

19

Page 23: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

Bandwidth Scanning

The Tor Network

E1R1

R3

R4

R5 R6

R2

WebserverBandwidth Scanner

20

Page 24: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

Bandwidth Scanning

The Tor Network

E1R1

R3

R4

R5 R6

R2

WebserverBandwidth Scanner

21

Page 25: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

Simple Bandwidth Scanner

• Bandwidth Scanner implemented in the Python programminglanguage.

• Well-documented internals.• Used by 3 out of 6 of the Directory Authorities that use inputfrom Bandwidth Scanners.

• Could benefit frommore contributors :-)• Written by juga0, Matt Traudt, and teor.

https://sbws.readthedocs.io/

22

Page 26: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

Anti-censorship Team

• New team created in early 2019 to handle all anti-censorshipwork that was previously handled by the network team.

• Develops andmaintains the Pluggable Transports that areshipped with in Tor Browser.

• Focus on Snowflake, BridgeDB, and Gettor.

23

Page 27: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay
Page 28: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

Pluggable TransportsCensored Region

Alice

PT Client

Bridge Relay

PT ServerObfuscated Protocol

25

Page 29: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

BridgeDB

Source: bridges.torproject.org

26

Page 30: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

BridgeDB access via Moat

27

Page 31: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

SnowflakeCensored Region

Alice

Snowflake PT Client Snowflake PT Server

BridgeSnowflake Broker

28

Page 32: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

SnowflakeCensored Region

Alice

Snowflake PT Client Snowflake PT Server

BridgeSnowflake Broker

29

Page 33: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

SnowflakeCensored Region

Alice

Snowflake PT Client Snowflake PT Server

BridgeSnowflake Broker

30

Page 34: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

SnowflakeCensored Region

Alice

Snowflake PT Client Snowflake PT Server

BridgeSnowflake Broker

31

Page 35: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

SnowflakeCensored Region

Alice

Snowflake PT Client Snowflake PT Server

BridgeSnowflake Broker

32

Page 36: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

Snowflake

33

Page 37: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

Snowflake

• The Client and Broker component written in Google’s Goprogramming language.

• Proxy WebExtension written in JavaScript.• Go version exists of the Proxy for more static deployments.

https://snowflake.torproject.org/

34

Page 38: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

Applications Team

The team responsible for the user-facing applications such as TorBrowser.

Works closely with the UX team on analysing and improving theuser experience of our products.

35

Page 39: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

Tor Browser

=

36

Page 40: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

Tor BrowserAnti-Censorship Team• FTE.• Meek.• Obfs 3 and 4.• Scramblesuit.

Applications Team• Tor Launcher.• Tor Button.

Network Team• Tor ("little-t-tor")

37

Page 41: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

Reproducible Builds

Source BinaryBuild Step

38

Page 42: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

Reproducible Builds

Source Binary

Verifiable

Build Step

39

Page 43: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

Reproducible Builds

Source Binary

Verifiable Usable

Build Step

40

Page 44: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

Reproducible Builds

Source Binary

Verifiable Usable?

Build Step

41

Page 45: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

Other Projects

Unfortunatenly, we don’t have time to go over everything we do inthe Tor Project in this talk. We also have teams doing amazingwork in areas such as:

• Infrastructure.• UX.• Handling metrics in a safe manner.• Andmuchmore!

42

Page 46: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

How can you help?

• Hack on some of our cool projects.• Find, andmaybe fix, bugs in Tor.• Test Tor on your platform of choice.• Work on some of the many openresearch projects.

• Run a Tor relay or a bridge!• Teach others about Tor and privacy ingeneral.

• Donate at donate.torproject.org

43

Page 47: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

Questions?

Page 48: An Introduction to the Tor Ecosystem for Developers · 2020. 2. 2. · WhatisTor? Onlineanonymity,andcensorship circumvention. Freeso˝ware. Opennetwork. Communityofresearchers, developers,users,andrelay

This work is licensed under a

Creative CommonsAttribution-ShareAlike 4.0 International License

cba