cfssl.txt 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. THE CFSSL PROGRAM
  2. The CFSSL program is a TLS / PKI tool that provides command line
  3. tools for
  4. * bundling certificates
  5. * create private keys, certificate signing requests, and certificates
  6. * signing certificate signing requests
  7. * scanning a host to evaluate its TLS security
  8. * signing OCSP requests
  9. * running a CA server
  10. * running an OCSP server
  11. The cfssl server can be used either as a standalone server or as a set
  12. of locally-running instances that talk to a remote CA. For example, a
  13. set of servers might run the cfssl program locally to facilitate
  14. generating certificates for services on the server. These local
  15. servers can be configured to send their certificate signing requests
  16. to a remote cfssl or multirootca server that actually contains the
  17. signing key(s).
  18. CONFIGURATION
  19. The configuration file for cfssl is a JSON dictionary with keys for
  20. signing profiles, OCSP configuration, authentication, and remote
  21. servers.
  22. AUTHENTICATION
  23. See also: authentication.txt
  24. Authentication is used to restrict access to the signing keys when
  25. cfssl is run as a server. A client making a request generates an
  26. authentication token for their request, submitting this token
  27. alongside the request. The authentication section is used to tell
  28. cfssl that authentication is required and how to authenticate.
  29. This section consists of a dictionary of authenticators under the key
  30. "auth_keys"; each authenticator should have the keys "type" and "key",
  31. both strings. For example, to use the standard authenticator with the
  32. (hex-encoded) key "0123456789ABCDEF0123456789ABCDEF" as the "primary"
  33. authenticator, the "auth_keys" section might look like
  34. "auth_keys": {
  35. "primary": {
  36. "type":"standard",
  37. "key":"0123456789ABCDEF0123456789ABCDEF"
  38. }
  39. }
  40. The authentication documentation covers available authenticators and
  41. their key formats.
  42. REMOTE SIGNERS
  43. A local cfssl instance can forward signing requests to another
  44. instance; this might be useful where the CA keys should remain on only
  45. one machine.
  46. A remote is specified as a host:port, or as a comma-separated list of
  47. host:ports. If the remote is a comma-separated list, each server will
  48. be tried in sequence until one succeeds. That is, if the list is
  49. "ca1.example.org:8888, ca2.example.org:8888, ca3.example.org:8888"
  50. each signing request will first go to ca1, falling back to ca2 if this
  51. fails, and finally falling back to ca3.
  52. SIGNING PROFILES
  53. CFSSL supports different profiles for generating various types of
  54. certificates, as well as a default profile to be used when no profile
  55. is given.
  56. A signing profile may contain the following fields, requiring at a
  57. minimum the expiry field. Fields that are not required may be left
  58. blank.
  59. + expiry: This should contain a time duration in the form
  60. understood by Go's time package[1]. This unfortunately means
  61. that the maximum unit of time that can be used here is the hour.
  62. + usages: strings of key usages. The following are acceptable key
  63. usages:
  64. + Key Usages
  65. + signing
  66. + digital signature
  67. + content commitment
  68. + key encipherment
  69. + key agreement
  70. + data encipherment
  71. + cert sign
  72. + crl sign
  73. + encipher only
  74. + decipher only
  75. + Ext Key Usages
  76. + any
  77. + server auth
  78. + client auth
  79. + code signing
  80. + email protection
  81. + s/mime
  82. + ipsec end system
  83. + ipsec tunnel
  84. + ipsec user
  85. + timestamping
  86. + ocsp signing
  87. + microsoft sgc
  88. + netscape sgc
  89. + issuer_urls: a list of Authority Information Access (RFC 5280
  90. 4.2.2.1) URLs pointing to the issuer certificate.
  91. + ocsp_url: the URL of the OCSP server that should be used to
  92. check the certificate's status.
  93. + crl_url: the URL of the CRL server for this CA.
  94. + ca_constraint: this object controls the CA bit and CA pathlen
  95. constraint of the returned certificates. For example, in order
  96. to issue a intermediate CA certificate with pathlen = 1, we put
  97. {"is_ca": true, "max_path_len":1}. For another example, to
  98. issue an intermediate CA certificate with pathlen = 0, we put
  99. {"is_ca": true, "max_path_len":0, "max_path_len_zero": true}.
  100. Notice the extra "max_path_len_zero" field: Without it, the
  101. intermediate CA certificate will have no pathlen constraint.
  102. + ocsp_no_check: this should be true if the id-pkix-ocsp-nocheck
  103. extension should be used (RFC 2560 4.2.2.2.1).
  104. + backdate: this is a time duration (the same used for the expiry
  105. field) that specifies an amount of backdating to be applied to
  106. new certificates.
  107. + auth_key: this should contain the name of an authentication key
  108. specified in the authentication portion of the configuration
  109. file. This key should be used by clients using the authentication
  110. scheme described in 'authentication.txt'.
  111. + remote: this should contain the name of a remote signer as
  112. specified in the remote signer section of the configuration
  113. file. This is used for unauthenticated CFSSL remotes.
  114. + auth_remote: this is an object containing an "auth_key" and
  115. "remote" key. This is an entry for an authenticated remote
  116. signer. The "auth_key" should contain the name of an
  117. authentication key specified in the authentication portion of
  118. the configuration file, and "remote" should contain the name of
  119. a remote signer as specified in the remote signer section of the
  120. configuration file.
  121. + not_before: if provided, this specifies an override for the Not
  122. Before date in certificates signed by the CA.
  123. + not_after: if provided, this specifies an override for the Not
  124. After date in certificates signed by the CA.
  125. + name_whitelist: if provided, this should be a regular expression
  126. for permitted SANs.
  127. The signing profiles reside in the "signing" dictionary. This may
  128. contain a "default" field which contains the profile to use by default
  129. for requests, and a "profiles" dictionary mapping profile names to
  130. their profile. If the default profile isn't present, the following
  131. default profile is used:
  132. {
  133. "usages": ["signing", "key encipherment", "server auth", "client auth"],
  134. "expiry": "8760h"
  135. }
  136. The expiration time of 8760h is equivalent to one year.
  137. A minimal configuration file might look like:
  138. {
  139. "signing": {
  140. "profiles": {
  141. "CA": {
  142. "usages": ["cert sign"],
  143. "expiry": "720h",
  144. "auth_key": "ca-auth",
  145. "remote": "localhost"
  146. },
  147. "email": {
  148. "usages": ["s/mime"],
  149. "expiry": "720h"
  150. }
  151. },
  152. "default": {
  153. "usages": ["digital signature", "email protection"],
  154. "expiry": "8000h"
  155. }
  156. },
  157. "auth_keys": {
  158. "ca-auth": {
  159. "type":"standard",
  160. "key":"0123456789ABCDEF0123456789ABCDEF"
  161. }
  162. },
  163. "remotes": {
  164. "localhost": "127.0.0.1:8888"
  165. }
  166. }
  167. [1] https://golang.org/pkg/time/#ParseDuration