]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_ssl_ct.xml
s/\<\(\w\+\)\>\s\+\<\1\>/\1/g
[apache] / docs / manual / mod / mod_ssl_ct.xml
1 <?xml version="1.0"?>
2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <!-- $LastChangedRevision$ -->
5
6 <!--
7  Licensed to the Apache Software Foundation (ASF) under one or more
8  contributor license agreements.  See the NOTICE file distributed with
9  this work for additional information regarding copyright ownership.
10  The ASF licenses this file to You under the Apache License, Version 2.0
11  (the "License"); you may not use this file except in compliance with
12  the License.  You may obtain a copy of the License at
13
14      http://www.apache.org/licenses/LICENSE-2.0
15
16  Unless required by applicable law or agreed to in writing, software
17  distributed under the License is distributed on an "AS IS" BASIS,
18  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  See the License for the specific language governing permissions and
20  limitations under the License.
21 -->
22
23 <modulesynopsis metafile="mod_ssl_ct.xml.meta">
24
25 <name>mod_ssl_ct</name>
26 <description>Implementation of Certificate Transparency (RFC 6962)
27 </description>
28 <status>Extension</status>
29 <sourcefile>mod_ssl_ct.c</sourcefile>
30 <identifier>ssl_ct_module</identifier>
31
32 <summary>
33
34 <p>This module provides an implementation of Certificate Transparency, in
35 conjunction with <module>mod_ssl</module> and command-line tools from the
36 <a href="https://code.google.com/p/certificate-transparency/">certificate-transparency</a>
37 open source project.  The goal of Certificate Transparency is to expose the
38 use of server certificates which are trusted by browsers but were mistakenly
39 or maliciously issued.  More information about Certificate Transparency is
40 available at <a href="http://www.certificate-transparency.org/">
41 http://www.certificate-transparency.org/</a>.  Key terminology used in
42 this documentation:</p>
43
44 <dl>
45   <dt>Certificate log</dt>
46   <dd>A certificate log, referred to simply as <q>log</q> in this documentation,
47   is a network service to which server certificates have been submitted.  A
48   user agent can confirm that the certificate of a server which it accesses
49   has been submitted to a log which it trusts, and that the log itself has
50   not been tampered with.</dd>
51
52   <dt>Signed Certificate Timestamp (SCT)</dt>
53   <dd>This is an acknowledgement from a log that it has accepted a valid
54   certificate.  It is signed with the log's public key.  One or more SCTs
55   is passed to clients during the handshake, either in the ServerHello
56   (TLS extension), certificate extension, or in a stapled OCSP response.</dd>
57 </dl>
58
59 <p>This implementation for Apache httpd provides these features for TLS
60 servers and proxies:</p>
61
62 <ul>
63   <li>Signed Certificate Timestamps (SCTs) can be obtained from logs
64   automatically and, in conjunction with any statically configured SCTs, sent
65   to aware clients in the ServerHello (during the handshake).</li>
66   <li>SCTs can be received by the proxy from origin servers in the ServerHello,
67   in a certificate extension, and/or within stapled OCSP responses; any SCTs
68   received can be partially validated on-line and optionally queued for off-line
69   audit.</li>
70   <li>The proxy can be configured to disallow communication with an origin
71   server which does not provide an SCT which passes on-line validation.</li>
72 </ul>
73
74 <p>Configuration information about logs can be defined statically in the web
75 server configuration or maintained in a SQLite3 database.  In the latter case,
76 <module>mod_ssl_ct</module> will reload the database periodically, so any
77 site-specific infrastructure for maintaining and propagating log configuration
78 information does not have to also restart httpd to make it take effect.</p>
79
80 <note>This module is experimental for the following reasons:
81 <ul>
82   <li>Insufficient test and review</li>
83   <li>Reliance on an unreleased version of OpenSSL (1.0.2, Beta 3 or later) for
84   basic operation</li>
85   <li>Incomplete <a href="#audit">off-line audit capability</a></li>
86 </ul>
87
88 <p>Configuration mechanisms, format of data saved for off-line audit, and
89 other characteristics are subject to change based on further feedback and
90 testing.</p>
91 </note>
92 </summary>
93
94 <section id="server">
95   <title>Server processing overview</title>
96
97   <p>Servers need to send SCTs to their clients.  SCTs in a certificate
98   extension or stapled OCSP response will be sent without any special program
99   logic.  This module handles sending SCTs configured by the administrator or
100   received from configured logs.</p>
101
102   <p>The number of SCTs sent in the ServerHello (i.e., not including those in a
103   certificate extension or stapled OCSP response) can be limited by the
104   <directive module="mod_ssl_ct">CTServerHelloSCTLimit</directive>
105   directive.</p>
106
107   <p>For each server certificate, a daemon process maintains an SCT list to be
108   sent in the ServerHello, created from statically configured SCTs as well as
109   those received from logs.  Logs marked as untrusted or with a maximum valid
110   timestamp before the present time will be ignored.  Periodically the daemon
111   will submit certificates to a log as necessary (due to changed log
112   configuration or age) and rebuild the concatenation of SCTs.</p>
113
114   <p>The SCT list for a server certificate will be sent to any client that
115   indicates awareness in the ClientHello when that particular server certificate
116   is used.</p>
117
118 </section>
119
120 <section id="proxy">
121   <title>Proxy processing overview</title>
122
123   <p>The proxy indicates Certificate Transparency awareness in the ClientHello
124   by including the <em>signed_certificate_timestamp</em> extension.  It can
125   recognize SCTs received in the ServerHello, in an extension in the certificate
126   for an origin server, or in a stapled OCSP response.</p>
127
128   <p>On-line verification is attempted for each received SCT:</p>
129
130   <ul>
131     <li>For any SCT, the timestamp can be checked to see if it is not yet valid
132     based on the current time as well as any configured valid time interval for
133     the log.</li>
134     <li>For an SCT from a log for which a public key is configured, the server
135     signature will be checked.</li>
136   </ul>
137
138   <p>If verification fails for at least one SCT and verification was not
139   successful for at least one SCT, the connection is aborted if
140   <directive module="mod_ssl_ct">CTProxyAwareness</directive> is set to
141   <em>require</em>.</p>
142
143   <p>Additionally, the server certificate chain and SCTs are stored for off-line
144   verification if the <directive module="mod_ssl_ct">CTAuditStorage</directive>
145   directive is configured.</p>
146
147   <p>As an optimization, on-line verification and storing of data from the
148   server is only performed the first time a web server child process receives
149   the data.  This saves some processing time as well as disk space.  For typical
150   reverse proxy setups, very little processing overhead will be required.</p>
151
152 </section>
153
154 <section id="logconf">
155   <title>Log configuration</title>
156
157   <p>Servers and proxies use different information about logs for their processing.
158   This <em>log configuration</em> can be set in two ways:</p>
159
160   <ul>
161     <li>Create a log configuration database using <program>ctlogconfig</program>,
162     and configure the path to that database using the <directive module="mod_ssl_ct">
163     CTLogConfig</directive> directive.  This method of configuration supports
164     dynamic updates; <module>mod_ssl_ct</module> will re-read the database at
165     intervals.  Additionally, the off-line audit program <code>ctauditscts</code>
166     can use this configuration to find the URL of logs.</li>
167
168     <li>Configure information about logs statically using the <directive
169     module="mod_ssl_ct">CTStaticLogConfig</directive> directive.  As with all other
170     directives, the server must be restarted in order to pick up changes to the
171     directives.</li>
172   </ul>
173
174   <p>The information that can be configured about a log using either mechanism is
175   described below:</p>
176
177   <dl>
178     <dt>log id</dt>
179     <dd>The log id is the SHA-256 hash of the log's public key, and is part of
180     every SCT.  This is a convenient way to identify a particular log when
181     configuring valid timestamp ranges or certain other information.</dd>
182
183     <dt>public key of the log</dt>
184     <dd>A proxy must have the public key of the log in order to check the
185     signature in SCTs it receives which were obtained from the log.
186     <br />
187     A server must have the public key of the log in order to submit certificates
188     to it.</dd>
189
190     <dt>general trust/distrust setting</dt>
191     <dd>This is a mechanism to distrust or restore trust in a particular log,
192     for whatever reason (including simply avoiding interaction with the
193     log in situations where it is off-line).</dd>
194
195     <dt>minimum and/or maximum valid timestamps</dt>
196     <dd>When configured, the proxy will check that timestamps from SCTs
197     are within the valid range.</dd>
198
199     <dt>log URL</dt>
200     <dd>The URL of the log (for its API) is required by a server in order to
201     submit server certificates to the log.  The server will submit
202     each server certificate in order to obtain an SCT for each log with a
203     configured URL, except when the log is also marked as distrusted or the
204     current time is not within any configured valid timestamp range.
205     <br />
206     The log URL is also needed by off-line auditing of SCTs received by a
207     proxy.</dd>
208   </dl>
209
210   <p>Generally, only a small subset of this information is configured for a
211   particular log.  Refer to the documentation for the <directive
212   module="mod_ssl_ct">CTStaticLogConfig</directive> directive and the
213   <program>ctlogconfig</program> command for more specific information.</p>
214
215 </section>
216
217 <section id="static">
218   <title>Storing SCTs in a form consumable by mod_ssl_ct</title>
219
220   <p><module>mod_ssl_ct</module> allows you to configure SCTs statically
221   using the <directive>CTStaticSCTs</directive> directive.  These must be
222   in binary form, ready to send to a client.</p>
223
224   <p>Sample code in the form of a Python script to build an SCT in the correct
225   format from data received from a log can be found in
226   <a href="https://github.com/tomrittervg/ct-tools">Tom Ritter's ct-tools
227   repository</a>.  Refer to <code>write-sct.py</code></p>
228 </section>
229
230 <section id="logging">
231   <title>Logging CT status in the access log</title>
232
233   <p>Proxy and server modes set the <code>SSL_CT_PROXY_STATUS</code> and
234   <code>SSL_CT_CLIENT_STATUS</code> variables, respectively, to indicate
235   if the corresponding peer is CT-aware.</p>
236
237   <p>Proxy mode sets the <code>SSL_CT_PROXY_SCT_SOURCES</code> variable to
238   indicate whether and where SCTs were obtained (ServerHello, certificate
239   extension, etc.).</p>
240
241   <p>These variables can be logged with the <code>%{<em>varname</em>}e</code>
242   format of <module>mod_log_config</module>.</p>
243 </section>
244
245 <section id="audit">
246   <title>Off-line audit for proxy</title>
247
248   <p>Experimental support for this is implemented in the <code>ctauditscts</code>
249   command, which itself relies on the <code>verify_single_proof.py</code> tool in the
250   <em>certificate-transparency</em> open source project.  <code>ctauditscts</code>
251   can parse data for off-line audit (enabled with the <directive module="mod_ssl_ct">
252   CTAuditStorage</directive> directive) and invoke <code>verify_single_proof.py</code>.
253   </p>
254
255   <p>Here are rough notes for using <code>ctauditscts</code>:</p>
256
257   <ul>
258     <li>Create a <em>virtualenv</em> using the <code>requirements.txt</code> file
259     from the <em>certificate-transparency</em> project and run the following steps
260     with that <em>virtualenv</em> activated.</li>
261     <li>Set <code>PYTHONPATH</code> to include the <code>python</code>
262     directory within the <em>certificate-transparency</em> tools.</li>
263     <li>Set <code>PATH</code> to include the <code>python/ct/client/tools</code>
264     directory.</li>
265     <li>Run <code>ctauditscts</code>, passing the value of the
266     <directive>CTAuditStorage</directive> directive and, optionally, the path to
267     the log configuration database.  The latter will be used to look up log URLs
268     by log id.</li>
269   </ul>
270
271   <p>The data saved for audit can also be used by other programs; refer to the
272   <code>ctauditscts</code> source code for details on processing the data.</p>
273 </section>
274
275 <directivesynopsis>
276 <name>CTAuditStorage</name>
277 <description>Existing directory where data for off-line audit will be stored</description>
278 <syntax>CTAuditStorage <em>directory</em></syntax>
279 <default>none</default>
280 <contextlist><context>server config</context></contextlist>
281
282 <usage>
283   <p>The <directive>CTAuditStorage</directive> directive sets the name of a
284   directory where data will be stored for off-line audit.  If <em>directory</em>
285   is not absolute then it is assumed to be relative to <directive module="core">
286   DefaultRuntimeDir</directive>.</p>
287
288   <p>If this directive is not specified, data will not be stored for off-line
289   audit.</p>
290
291   <p>The directory will contain files named <code><em>PID</em>.tmp</code> for
292   active child processes and files named <code><em>PID</em>.out</code> for exited
293   child processes.  These <code>.out</code> files are ready for off-line audit.
294   The experimental command <code>ctauditscts</code> (in the httpd source tree, not
295   currently installed) interfaces with <em>certificate-transparency</em> tools to
296   perform the audit.</p>
297 </usage>
298 </directivesynopsis>
299
300 <directivesynopsis>
301 <name>CTLogClient</name>
302 <description>Location of certificate-transparency log client tool</description>
303 <syntax>CTLogClient <em>executable</em></syntax>
304 <default>none</default>
305 <contextlist><context>server config</context>
306 </contextlist>
307
308 <usage>
309   <p><em>executable</em> is the full path to the log client tool, which is
310   normally file <code>cpp/client/ct</code> (or <code>ct.exe</code>) within the
311   source tree of the
312   <a href="https://code.google.com/p/certificate-transparency/">
313   certificate-transparency</a> open source project.</p>
314
315   <p>An alternative implementation could be used to retrieve SCTs for a
316   server certificate as long as the command-line interface is equivalent.</p>
317
318   <p>If this directive is not configured, server certificates cannot be
319   submitted to logs in order to obtain SCTs; thus, only admin-managed
320   SCTs or SCTs in certificate extensions will be provided to clients.</p>
321 </usage>
322 </directivesynopsis>
323
324 <directivesynopsis>
325 <name>CTLogConfigDB</name>
326 <description>Log configuration database supporting dynamic updates</description>
327 <syntax>CTLogConfigDB <em>filename</em></syntax>
328 <default>none</default>
329 <contextlist><context>server config</context></contextlist>
330
331 <usage>
332   <p>The <directive>CTLogConfigDB</directive> directive sets the name of a database
333   containing configuration about known logs.  If <em>filename</em> is not absolute
334   then it is assumed to be relative to
335   <directive module="core">ServerRoot</directive>.</p>
336
337   <p>Refer to the documentation for the <program>ctlogconfig</program> program,
338   which manages the database.</p>
339 </usage>
340 </directivesynopsis>
341
342 <directivesynopsis>
343 <name>CTMaxSCTAge</name>
344 <description>Maximum age of SCT obtained from a log, before it will be
345 refreshed</description>
346 <syntax>CTMaxSCTAge <em>num-seconds</em></syntax>
347 <default>1 day</default>
348 <contextlist><context>server config</context></contextlist>
349
350 <usage>
351   <p>Server certificates with SCTs which are older than this maximum age will
352   be resubmitted to configured logs.  Generally the log will return the same SCT
353   as before, but that is subject to log operation.  SCTs will be refreshed as
354   necessary during normal server operation, with new SCTs returned to clients
355   as they become available.</p>
356 </usage>
357 </directivesynopsis>
358
359 <directivesynopsis>
360 <name>CTProxyAwareness</name>
361 <description>Level of CT awareness and enforcement for a proxy
362 </description>
363 <syntax>CTProxyAwareness <em>oblivious|aware|require</em></syntax>
364 <default>aware</default>
365 <contextlist><context>server config</context>
366 <context>virtual host</context></contextlist>
367
368 <usage>
369   <p>This directive controls awareness and checks for valid SCTs for a
370   proxy.  Several options are available:</p>
371
372   <dl>
373     <dt>oblivious</dt>
374     <dd>The proxy will neither ask for nor examine SCTs.  Certificate
375     Transparency processing for the proxy is completely disabled.</dd>
376
377     <dt>aware</dt>
378     <dd>The proxy will perform all appropriate Certificate Transparency
379     processing, such as asking for and examining SCTs.  However, the
380     proxy will not disallow communication if the origin server does
381     not provide any valid SCTs.</dd>
382
383     <dt>require</dt>
384     <dd>The proxy will abort communication with the origin server if it
385     does not provide at least one SCT which passes on-line validation.</dd>
386   </dl>
387
388 </usage>
389 </directivesynopsis>
390
391 <directivesynopsis>
392 <name>CTSCTStorage</name>
393 <description>Existing directory where SCTs are managed</description>
394 <syntax>CTSCTStorage <em>directory</em></syntax>
395 <default>none</default>
396 <contextlist><context>server config</context>
397 </contextlist>
398
399 <usage>
400   <p>The <directive>CTSCTStorage</directive> directive sets the name of a
401   directory where SCTs and SCT lists will be stored.  If <em>directory</em>
402   is not absolute then it is assumed to be relative to <directive module="core">
403   DefaultRuntimeDir</directive>.</p>
404
405   <p>A subdirectory for each server certificate contains information relative
406   to that certificate; the name of the subdirectory is the SHA-256 hash of the
407   certificate.</p>
408
409   <p>The certificate-specific directory contains SCTs retrieved from configured
410   logs, SCT lists prepared from statically configured SCTs and retrieved SCTs,
411   and other information used for managing SCTs.</p>
412 </usage>
413 </directivesynopsis>
414
415 <directivesynopsis>
416 <name>CTServerHelloSCTLimit</name>
417 <description>Limit on number of SCTs that can be returned in
418 ServerHello</description>
419 <syntax>CTServerHelloSCTLimit <em>limit</em></syntax>
420 <default>100</default>
421 <contextlist><context>server config</context>
422 </contextlist>
423
424 <usage>
425   <p>This directive can be used to limit the number of SCTs which can be
426   returned by a TLS server in ServerHello, in case the number of configured
427   logs and statically-defined SCTs is relatively high.</p>
428
429   <p>Typically only a few SCTs would be available, so this directive is only
430   needed in special circumstances.</p>
431
432   <p>The directive does not take into account SCTs which may be provided in
433   certificate extensions or in stapled OCSP responses.</p>
434 </usage>
435 </directivesynopsis>
436
437 <directivesynopsis>
438 <name>CTStaticLogConfig</name>
439 <description>Static configuration of information about a log</description>
440 <syntax>CTStaticLogConfig <em>log-id|-</em> <em>public-key-file|-</em>
441 <em>1|0|-</em> <em>min-timestamp|-</em> <em>max-timestamp|-</em>
442 <em>log-URL|-</em></syntax>
443 <default>none</default>
444 <contextlist><context>server config</context>
445 </contextlist>
446
447 <usage>
448   <p>This directive is used to configure information about a particular log.
449   This directive is appropriate when configuration information changes rarely.
450   If dynamic configuration updates must be supported, refer to the
451   <directive module="mod_ssl_ct">CTLogConfigDB</directive> directive.</p>
452
453   <p>Each of the six fields must be specified, but usually only a small
454   amount of information must be configured for each log; use <em>-</em> when no
455   information is available for the field.  For example, in support of a
456   server-only configuration (i.e., no proxy), the administrator might
457   configure only the log URL to be used when submitting server certificates
458   and obtaining a Signed Certificate Timestamp.</p>
459
460   <p>The fields are defined as follows:</p>
461
462   <dl>
463     <dt><em>log-id</em></dt>
464     <dd>This is the id of the log, which is the SHA-256 hash of the log's
465     public key, provided in hexadecimal format.  This string is 64 characters
466     in length.
467     <br />
468     This field should be omitted when <em>public-key-file</em> is provided.</dd>
469
470     <dt><em>public-key-file</em></dt>
471     <dd>This is the name of a file containing the PEM encoding of the log's
472     public key.  If the name is not absolute, then it is assumed to be relative
473     to <directive module="core">ServerRoot</directive>.</dd>
474
475     <dt><em>trust/distrust</em></dt>
476     <dd>Set this field to <em>1</em> to distrust this log, or to otherwise avoid
477     using it for server certificate submission.  Set this to <em>-</em> or
478     <em>0</em> (the default) to treat the log normally.</dd>
479
480     <dt><em>min-timestamp</em> and <em>max-timestamp</em></dt>
481     <dd>A timestamp is a time as expressed in the number of milliseconds since the
482     epoch, ignoring leap seconds.  This is the form of time used in Signed Certificate
483     Timestamps.  This must be provided as a decimal number.
484     <br />
485     Specify <strong><code>-</code></strong> for one of the timestamps if it is unknown.
486     For example, when configuring the minimum valid timestamp for a log which remains
487     valid, specify <strong><code>-</code></strong> for <em>max-timestamp</em>.
488     <br />
489     SCTs received from this log by the proxy are invalid if the timestamp
490     is older than <em>min-timestamp</em> or newer than <em>max-timestamp</em>.</dd>
491
492     <dt><em>log-URL</em></dt>
493     <dd>This is the URL of the log, for use in submitting server certificates
494     and in turn obtaining an SCT to be sent to clients.</dd>
495   </dl>
496 </usage>
497
498 <seealso><a href="#logconf">Log configuration</a> contains more general information
499 about the fields which can be configured with this directive.</seealso>
500
501 </directivesynopsis>
502
503 <directivesynopsis>
504 <name>CTStaticSCTs</name>
505 <description>Static configuration of one or more SCTs for a server certificate
506 </description>
507 <syntax>CTStaticSCTs <em>certificate-pem-file</em> <em>sct-directory</em></syntax>
508 <default>none</default>
509 <contextlist><context>server config</context>
510 </contextlist>
511
512 <usage>
513   <p>This directive is used to statically define one or more SCTs corresponding
514   to a server certificate.  This mechanism can be used instead of or in
515   addition to dynamically obtaining SCTs from configured logs.  Any changes to
516   the set of SCTs for a particular server certificate will be adopted dynamically
517   without the need to restart the server.</p>
518
519   <p><em>certificate-pem-file</em> refers to the server certificate in PEM
520   format.  If the name is not absolute, then it is assumed to be relative to
521   <directive module="core">ServerRoot</directive>.</p>
522
523   <p><em>sct-directory</em> should contain one or more files with extension
524   <code>.sct</code>, representing one or more SCTs corresponding to the
525   server certificate.  If <em>sct-directory</em> is not absolute, then it is
526   assumed to be relative to <directive module="core">ServerRoot</directive>.</p>
527
528   <p>If <em>sct-directory</em> is empty, no error will be raised.</p>
529
530   <p>This directive could be used to identify directories of SCTs maintained by
531   other infrastructure, provided that they are saved in binary format with
532   file extension <em>.sct</em></p>
533 </usage>
534 </directivesynopsis>
535
536 </modulesynopsis>