Import old website, converted to MarkDown format.
[wiki] / goals.mdwn
1 ## Design goals
2
3 This is a list of the design goals for tinc, sorted on importance.
4 Although we already achieved a lot of what is below, not all goals
5 are covered yet.
6
7 **Be as secure as possible**
8
9 This should of course be the primary goal of any VPN
10 implementation. Security is not only achieved by applying strong
11 cryptography, we are also trying to make tinc free of buffer
12 overflows and other design faults that could allow root exploits,
13 trying to prevent private data from lying around (in memory, swap
14 or regular files), trying to prevent errors from human carelessness
15 (wrong permissions on files containing the configuration and
16 private keys), trying to avoid security problems arising from the
17 interaction between different (security) mechanisms. We also hope
18 we can get a lot of people and possibly security experts to audit
19 our code.
20
21 **Allow for scalability**
22
23 After our first real stable implementation of tinc (around version
24 0.2.19), we noticed that setting up a large VPN with many sites
25 required a lot of tunnels. Even worse, because we used a star
26 network, the node in the middle was passing through a lot of
27 network traffic for other nodes. From then on we tried to make the
28 tinc daemon accept more than one connection, and let the tinc
29 daemons contact each other directly in the most direct way, without
30 requiring the VPN sites to configure all those direct routes
31 themselves. We hope to let tinc scale to VPNs with over 1000
32 sites.
33
34 **Stability and reliability**
35
36 We are trying to make sure the tinc daemons stay up and running no
37 matter what happens. Network errors should not be a reason for
38 requiring an administrator to restart the daemons. We try to make
39 sure tinc runs as long as your UPS does.
40
41 **Easy configuration**
42
43 The configuration of tinc should be as easy as possible. Any error
44 made in the configuration files can be a compromise to security.
45 However, we do require the administrator to have a good knowledge
46 of network administration.
47
48 **Flexibility**
49
50 Of course, we want tinc to be able to run in any kind of setup or
51 environment. We try to make tinc run on as many operating systems
52 and architectures as possible, and make it provide a solution for
53 any network topology.
54
55 ## Plans for tinc 1.0.x
56
57 The stable branch of tinc, with version numbers 1.0.x, will not see
58 any significant development. Only bugs will be fixed, and perhaps
59 non-invasive features that do not conflict with existing features
60 and do not depend on new libraries might be added.
61
62 ## Plans for tinc 1.1
63
64 The 1.1 branch of tinc has been created as a stepping stone towards
65 2.0. Only gradual changes to the source code are allowed, ensuring
66 that the code is always in a mostly usable state. The protocol will
67 stay compatible with that of the 1.0 branch. The following features
68 are planned in this branch:
69
70 **Replaceble cryptography backend**
71
72 The 1.0 branch uses OpenSSL exclusively. Although this library is
73 well known and widely available, it has two drawbacks: it is quite
74 large and its license is not completely compatible with the GPL. In
75 1.1 there will be an abstraction layer that allows tinc to be
76 linked with different cryptography libraries. At least OpenSSL and
77 libgcrypt will be supported.
78
79 **Control socket**
80
81 The 1.0 branch has limitted support to control a running tinc
82 daemon. In 1.1 the tinc daemon will have a control socket that
83 allows a tinc control program to connect to it and issue commands
84 to or retrieve information from the running daemon. This will also
85 allow for a GUI or dock applet to control tinc or show its status.
86
87 **Automatic connection management**
88
89 The 1.0 branch can exchange packets directly with other peers via
90 UDP, creating a full mesh. However, the TCP control connections are
91 only made according to the manually specified ConnectTo statements
92 in the tinc.conf files. It is desirable to have tinc manage the
93 creation of control connections as well, so that the administrator
94 does not have to do this manually anymore.
95
96 **Deal with NAT**
97
98 The 1.0 branch by default tries to exchange packets via UDP.
99 However, if one or more peers are behind a NAT, and source ports
100 might be changed or packets may not arrive at all, the
101 administrator had to manually enable the TCPOnly option or use
102 another workaround to get tinc to work. Tinc should be able to cope
103 with altered source ports, and should detect whether or not packet
104 exchange via UDP works at all, and if not fall back to TCP.
105
106 ## Plans for tinc 2.0
107
108 The 2.0 branch will be a complete rewrite of tinc. Expectations
109 have changed in the past 10 years. Applications should just work,
110 and should do as much as possible automatically. For example,
111 setting up a VPN with 1.0 requires the administrator to create a
112 number of configuration files (tinc.conf, tinc-up, a host config
113 file), generate keys, and exchange host config files with peers
114 somehow. This should be reduced to a simple `tinc setup`
115 command, which asks the user a few relevant details (name, subnet),
116 and perhaps asks if the credentials (the host config file in 1.0)
117 should be sent to another person, via email or other means. The
118 recipient of these credentials should just pipe them through
119 `tinc import` which would show a fingerprint and ask the
120 user if he was sure, and would then automatically update the
121 running tinc daemon's configuration with the new information. Of
122 course, there should also be a GUI to manage one's setup,
123 preferably well integrated into the OS and desktop environment of
124 the user's choice. Features from the 1.0 and 1.1 branches will be
125 included in the 2.0 branch if possible. Other features planned for
126 2.0 are:
127
128 **Certificate based authorisation**
129
130 In tinc 1.x authentication and authorisation is based on exchange
131 of public RSA keys and full trust principles. For finer control
132 over the VPN, and to limit the damage a rogue peer can do, a web of
133 trust should be formed using certificates. This can be in the style
134 of X.509, i.e. with a single authority who can sign certificates
135 for peers and the subnets they are allocated, or in the style of
136 PGP, where peers can sign each other, and if there are enough
137 signatures, they can allow communication. Trust management should
138 be simple, for example using a command like
139
140     tinc trust *foo*
141
142 which should let the local tinc
143 daemon trust information from the peer named *foo*. To authorise
144 the use of addresses on the VPN, a command like the following could
145 be used:
146
147     tinc allow *bar* 192.168.3.0/24
148
149 This should generate a small certificate that proves that the node that
150 issued this command trusts node *bar* with the 192.168.3.0/24 range
151 of addresses. This certificate should then be added to the local
152 tinc daemon's configuration, but also spread immediately amongst
153 the other peers in the VPN. It is also important to allow trust and
154 authorisation to be revoked in the same way:
155
156     tinc distrust *foo*
157
158 This should make the local tinc daemon stop trusting any information from *foo*.
159
160     tinc deny *bar*
161
162 This should generate a certificate (with a newer timestamp than the previous one) denying
163 *bar* any access, and spread this amongst the other peers as well.
164 The other peers should replace the previous certificates for *bar*
165 from this peer with the new one, and recalculate their trust of
166 *bar* based on other certificates they might have.
167
168 **Replacable tunnel backend**
169
170 Tinc 1.x uses its own protocols to set up tunnels to other tinc
171 daemons. Once a tunnel has been set up, it synchronises the other
172 end with the rest of the VPN. Whereas most other VPN daemons
173 concentrate on the workings of a single tunnel, this is of less
174 importance to tinc, which is more about managing lots of tunnels
175 between peers to create a seamless network. It also is better to
176 use a well-established protocol such as SSH or TLS instead of our
177 own. Also, it is not necessary at all to use the same protocol for
178 all the connections in a single VPN. Tinc should therefore allow
179 tunnel backends as plugins, and allow other peers to be reached via
180 URLs such as `ssh://some.server.org` or
181 `https://another.server.net:4443`.