1TANG(8)                                                                TANG(8)
2
3
4

NAME

6       tang - Network-Based Cryptographic Binding Server
7

OVERVIEW

9       Tang  is  a service for binding cryptographic keys to network presence.
10       It offers a secure, stateless, anonymous alternative to key escrow ser‐
11       vices.
12
13       The  Tang project arose as a tool to help the automation of decryption.
14       Existing mechanisms predominantly use key escrow systems where a client
15       encrypts some data with a symmetric key and stores the symmetric key in
16       a remote server for later retrieval. The desired goal of this setup  is
17       that  the  client can automatically decrypt the data when it is able to
18       contact the escrow server and fetch the key.
19
20       However, escrow servers have many  additional  requirements,  including
21       authentication (so that clients can´t get keys they aren´t suppossed to
22       have) and transport encryption (so that attackers listening on the net‐
23       work can´t eavesdrop on the keys in transit).
24
25       Tang  avoids  this  complexity.  Instead  of  storing  a  symmetric key
26       remotely, the client performs an asymmetric key exchange with the  Tang
27       server.  Since  the  Tang  server  doesn´t store or transport symmetric
28       keys, neither authentication nor encryption are required. Thus, Tang is
29       completely  stateless  and  zero-configuration. Further, clients can be
30       completely anonymous.
31
32       Tang does not provide a client. But it does export a  simple  REST  API
33       and  it  transfers  only  standards  compliant  JSON Object Signing and
34       Encryption (JOSE) objects, allowing you  to  create  your  own  clients
35       using  off the shelf components. For an off-the-shelf automated encryp‐
36       tion framework with support for Tang, see the Clevis project.  For  the
37       full  technical  details  of  the Tang protocol, see the Tang project´s
38       homepage.
39

GETTING STARTED

41       Getting a Tang server up and running is simple:
42
43
44
45           $ sudo systemctl enable tangd.socket --now
46
47
48
49       That´s it. The server is now running with a fresh set of  cryptographic
50       keys and will automatically start on the next reboot.
51

CONFIGURATION

53       Tang  intends  to  be  a minimal network service and therefore does not
54       have any configuration. To adjust the network settings, you  can  over‐
55       ride  the tangd.socket unit file using the standard systemd mechanisms.
56       See systemd.unit(5) and systemd.socket(5) for more information.
57

KEY ROTATION

59       In order to preserve the security of the system over the long run,  you
60       need  to  periodically  rotate your keys. The precise interval at which
61       you should rotate depends upon your application, key sizes and institu‐
62       tional     policy.    For    some    common    recommendations,    see:
63       https://www.keylength.com.
64
65       To rotate keys, first we need to generate new keys in the key  database
66       directory.  This is typically /var/db/tang. For example, you can create
67       new signature and exchange keys with the following commands:
68
69
70
71           # DB=/var/db/tang
72           # jose jwk gen -i ´{"alg":"ES512"}´ -o $DB/new_sig.jwk
73           # jose jwk gen -i ´{"alg":"ECMR"}´ -o $DB/new_exc.jwk
74
75
76
77       Next, rename the old keys to have a leading . in  order  to  hide  them
78       from advertisement:
79
80
81
82           # mv $DB/old_sig.jwk $DB/.old_sig.jwk
83           # mv $DB/old_exc.jwk $DB/.old_exc.jwk
84
85
86
87       Tang will immediately pick up all changes. No restart is required.
88
89       At  this  point,  new client bindings will pick up the new keys and old
90       clients can continue to utilize the old keys. Once you  are  sure  that
91       all  the  old  clients  have been migrated to use the new keys, you can
92       remove the old keys. Be aware that removing the old keys while  clients
93       are still using them can result in data loss. You have been warned.
94

HIGH PERFORMANCE

96       The  Tang  protocol is extremely fast. However, in the default setup we
97       use systemd socket activiation to start  one  process  per  connection.
98       This  imposes  a  performance  overhead.  For most deployments, this is
99       still probably quick enough, given that Tang is extremely  lightweight.
100       But for larger deployments, greater performance can be achieved.
101
102       Our  recommendation for achieving higher throughput is to proxy traffic
103       to Tang through your existing web services  using  a  connection  pool.
104       Since  there is one process per connection, keeping a number of connec‐
105       tions open in this setup will enable effective parallelism since  there
106       are no internal locks in Tang.
107
108       For  Apache,  this  is  possible  using  the ProxyPass directive of the
109       mod_proxy module.
110

HIGH AVAILABILITY

112       Tang provides two methods for building a high availability deployment.
113
114       1.  Client redundency (recommended)
115
116       2.  Key sharing with DNS round-robin
117
118
119
120       While it may be tempting to  share  keys  between  Tang  servers,  this
121       method  should  be avoided. Sharing keys increases the risk of key com‐
122       promise and requires additional automation infrastructure.
123
124       Instead, clients should be coded with the ability to bind  to  multiple
125       Tang  servers.  In  this setup, each Tang server will have its own keys
126       and clients will be able to decrypt by contacting  a  subset  of  these
127       servers.
128
129       Clevis already supports this workflow through its sss plugin.
130
131       However,  if  you  still  feel that key sharing is the right deployment
132       strategy, Tang will do nothing to stop you. Just  (securely!)  transfer
133       all  the  contents  of the database directory to all your servers. Make
134       sure  you  don´t  forget  the  unadvertised  keys!  Then  set  up   DNS
135       round-robin so that clients will be load balanced across your servers.
136

COMMANDS

138       The Tang server provides no public commands.
139

AUTHOR

141       Nathaniel McCallum <npmccallum@redhat.com>
142

SEE ALSO

144       systemd.unit(5), systemd.socket(5), jose-jwk-gen(1)
145

FURTHER READING

147       ·   Clevis : https://github.com/latchset/clevis
148
149       ·   Tang : https://github.com/latchset/tang
150
151       ·   JOSE : https://datatracker.ietf.org/wg/jose/charter/
152
153       ·   mod_proxy : https://httpd.apache.org/docs/2.4/mod/mod_proxy.html
154
155
156
157
158
159
160                                   June 2017                           TANG(8)
Impressum