tang.8 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. .\" generated with Ronn/v0.7.3
  2. .\" http://github.com/rtomayko/ronn/tree/0.7.3
  3. .
  4. .TH "TANG" "8" "June 2017" "" ""
  5. .
  6. .SH "NAME"
  7. \fBtang\fR \- Network\-Based Cryptographic Binding Server
  8. .
  9. .SH "OVERVIEW"
  10. Tang is a service for binding cryptographic keys to network presence\. It offers a secure, stateless, anonymous alternative to key escrow services\.
  11. .
  12. .P
  13. The Tang project arose as a tool to help the automation of decryption\. Existing mechanisms predominantly use key escrow systems where a client encrypts some data with a symmetric key and stores the symmetric key in a remote server for later retrieval\. The desired goal of this setup is that the client can automatically decrypt the data when it is able to contact the escrow server and fetch the key\.
  14. .
  15. .P
  16. However, escrow servers have many additional requirements, including authentication (so that clients can\'t get keys they aren\'t suppossed to have) and transport encryption (so that attackers listening on the network can\'t eavesdrop on the keys in transit)\.
  17. .
  18. .P
  19. Tang avoids this complexity\. Instead of storing a symmetric key remotely, the client performs an asymmetric key exchange with the Tang server\. Since the Tang server doesn\'t store or transport symmetric keys, neither authentication nor encryption are required\. Thus, Tang is completely stateless and zero\-configuration\. Further, clients can be completely anonymous\.
  20. .
  21. .P
  22. Tang does not provide a client\. But it does export a simple REST API and it transfers only standards compliant JSON Object Signing and Encryption (JOSE) objects, allowing you to create your own clients using off the shelf components\. For an off\-the\-shelf automated encryption framework with support for Tang, see the Clevis project\. For the full technical details of the Tang protocol, see the Tang project\'s homepage\.
  23. .
  24. .SH "GETTING STARTED"
  25. Getting a Tang server up and running is simple:
  26. .
  27. .IP "" 4
  28. .
  29. .nf
  30. $ sudo systemctl enable tangd\.socket \-\-now
  31. .
  32. .fi
  33. .
  34. .IP "" 0
  35. .
  36. .P
  37. That\'s it\. The server is now running with a fresh set of cryptographic keys and will automatically start on the next reboot\.
  38. .
  39. .SH "CONFIGURATION"
  40. Tang intends to be a minimal network service and therefore does not have any configuration\. To adjust the network settings, you can override the \fBtangd\.socket\fR unit file using the standard systemd mechanisms\. See \fBsystemd\.unit\fR(5) and \fBsystemd\.socket\fR(5) for more information\.
  41. .
  42. .SH "KEY ROTATION"
  43. In order to preserve the security of the system over the long run, you need to periodically rotate your keys\. The precise interval at which you should rotate depends upon your application, key sizes and institutional policy\. For some common recommendations, see: https://www\.keylength\.com\.
  44. .
  45. .P
  46. To rotate keys, first we need to generate new keys in the key database directory\. This is typically \fB/var/db/tang\fR\. For example, you can create new signature and exchange keys with the following commands:
  47. .
  48. .IP "" 4
  49. .
  50. .nf
  51. # DB=/var/db/tang
  52. # jose jwk gen \-i \'{"alg":"ES512"}\' \-o $DB/new_sig\.jwk
  53. # jose jwk gen \-i \'{"alg":"ECMR"}\' \-o $DB/new_exc\.jwk
  54. .
  55. .fi
  56. .
  57. .IP "" 0
  58. .
  59. .P
  60. Next, rename the old keys to have a leading \fB\.\fR in order to hide them from advertisement:
  61. .
  62. .IP "" 4
  63. .
  64. .nf
  65. # mv $DB/old_sig\.jwk $DB/\.old_sig\.jwk
  66. # mv $DB/old_exc\.jwk $DB/\.old_exc\.jwk
  67. .
  68. .fi
  69. .
  70. .IP "" 0
  71. .
  72. .P
  73. Tang will immediately pick up all changes\. No restart is required\.
  74. .
  75. .P
  76. At this point, new client bindings will pick up the new keys and old clients can continue to utilize the old keys\. Once you are sure that all the old clients have been migrated to use the new keys, you can remove the old keys\. Be aware that removing the old keys while clients are still using them can result in data loss\. You have been warned\.
  77. .
  78. .SH "HIGH PERFORMANCE"
  79. The Tang protocol is extremely fast\. However, in the default setup we use systemd socket activiation to start one process per connection\. This imposes a performance overhead\. For most deployments, this is still probably quick enough, given that Tang is extremely lightweight\. But for larger deployments, greater performance can be achieved\.
  80. .
  81. .P
  82. Our recommendation for achieving higher throughput is to proxy traffic to Tang through your existing web services using a connection pool\. Since there is one process per connection, keeping a number of connections open in this setup will enable effective parallelism since there are no internal locks in Tang\.
  83. .
  84. .P
  85. For Apache, this is possible using the \fBProxyPass\fR directive of the \fBmod_proxy\fR module\.
  86. .
  87. .SH "HIGH AVAILABILITY"
  88. Tang provides two methods for building a high availability deployment\.
  89. .
  90. .IP "1." 4
  91. Client redundency (recommended)
  92. .
  93. .IP "2." 4
  94. Key sharing with DNS round\-robin
  95. .
  96. .IP "" 0
  97. .
  98. .P
  99. While it may be tempting to share keys between Tang servers, this method should be avoided\. Sharing keys increases the risk of key compromise and requires additional automation infrastructure\.
  100. .
  101. .P
  102. Instead, clients should be coded with the ability to bind to multiple Tang servers\. In this setup, each Tang server will have its own keys and clients will be able to decrypt by contacting a subset of these servers\.
  103. .
  104. .P
  105. Clevis already supports this workflow through its \fBsss\fR plugin\.
  106. .
  107. .P
  108. However, if you still feel that key sharing is the right deployment strategy, Tang will do nothing to stop you\. Just (securely!) transfer all the contents of the database directory to all your servers\. Make sure you don\'t forget the unadvertised keys! Then set up DNS round\-robin so that clients will be load balanced across your servers\.
  109. .
  110. .SH "COMMANDS"
  111. The Tang server provides no public commands\.
  112. .
  113. .SH "AUTHOR"
  114. Nathaniel McCallum <npmccallum@redhat\.com>
  115. .
  116. .SH "SEE ALSO"
  117. \fBsystemd\.unit\fR(5), \fBsystemd\.socket\fR(5), \fBjose\-jwk\-gen\fR(1)
  118. .
  119. .SH "FURTHER READING"
  120. .
  121. .IP "\(bu" 4
  122. Clevis : https://github\.com/latchset/clevis
  123. .
  124. .IP "\(bu" 4
  125. Tang : https://github\.com/latchset/tang
  126. .
  127. .IP "\(bu" 4
  128. JOSE : https://datatracker\.ietf\.org/wg/jose/charter/
  129. .
  130. .IP "\(bu" 4
  131. mod_proxy : https://httpd\.apache\.org/docs/2\.4/mod/mod_proxy\.html
  132. .
  133. .IP "" 0