]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_ssl_ct.xml
minor improvements
[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) for basic
84   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.</dd>
186
187     <dt>general trust/distrust setting</dt>
188     <dd>This is a mechanism to distrust or restore trust in a particular log,
189     for whatever reason (including simply avoiding interaction with the
190     log in situations where it is off-line).</dd>
191
192     <dt>minimum and/or maximum valid timestamps</dt>
193     <dd>When configured, the proxy will check that timestamps from SCTs
194     are within the valid range.</dd>
195
196     <dt>log URL</dt>
197     <dd>The URL of the log (for its API) is required by a server in order to
198     submit server certificates to the log.  The server will submit
199     each server certificate in order to obtain an SCT for each log with a 
200     configured URL, except when the log is also marked as distrusted or the
201     current time is not within any configured valid timestamp range.
202     <br />
203     The log URL is also needed by off-line auditing of SCTs received by a
204     proxy.</dd>
205   </dl>
206
207   <p>Generally, only a small subset of this information is configured for a
208   particular log.  Refer to the documentation for the <directive 
209   module="mod_ssl_ct">CTStaticLogConfig</directive> directive and the 
210   <program>ctlogconfig</program> command for more specific information.</p>
211
212 </section>
213
214 <section id="logging">
215   <title>Logging CT status in the access log</title>
216
217   <p>Both proxy and server modes set the <code>SSL_CT_PEER_STATUS</code>
218   variable to indicate if the peer is CT-aware.</p>
219
220   <p>Proxy mode sets the <code>SSL_PROXY_SCT_SOURCES</code> variable to
221   indicate whether and where SCTs were obtained (ServerHello, certificate
222   extension, etc.).</p>
223
224   <p>These variables can be logged with the <code>%{<em>varname</em>}e</code>
225   format of <module>mod_log_config</module>.</p>
226 </section>
227
228 <section id="audit">
229   <title>Off-line audit for proxy</title>
230
231   <p>Experimental support for this is implemented in the <code>ctauditscts</code>
232   command (in the httpd source tree, not currently installed), which itself
233   relies on the <code>verify_single_proof.py</code> tool in the 
234   <em>certificate-transparency</em> open source project.  <code>ctauditscts</code>
235   can parse data for off-line audit (enabled with the <directive module="mod_ssl_ct">
236   CTAuditStorage</directive> directive) and invoke <code>verify_single_proof.py</code>.
237   However, <code>verify_single_proof.py</code> is not complete currently and does
238   not provide a way to identify audit failures.</p>
239
240   <p>Here are rough notes for using <code>ctauditscts</code>:</p>
241
242   <ul>
243     <li>Set <code>PYTHONPATH</code> to include the <code>src/python</code>
244     directory within the <em>certificate-transparency</em> tools.</li>
245     <li>Set <code>PATH</code> to include the <code>src/python/ct/client/tools</code>
246     directory.</li>
247     <li>Run <code>ctauditscts</code>, passing the value of the
248     <directive>CTAuditStorage</directive> directive and, optionally, the path to
249     the log configuration database.  The latter will be used to look up log URLs
250     by log id.</li>
251   </ul>
252
253   <p>The data saved for audit can also be used by other programs; refer to the
254   <code>ctauditscts</code> source code for details.</p>
255 </section>
256
257 <directivesynopsis>
258 <name>CTAuditStorage</name>
259 <description>Existing directory where data for off-line audit will be stored</description>
260 <syntax>CTAuditStorage <em>directory</em></syntax>
261 <default>none</default>
262 <contextlist><context>server config</context></contextlist>
263
264 <usage>
265   <p>The <directive>CTAuditStorage</directive> directive sets the name of a
266   directory where data will be stored for off-line audit.  If <em>directory</em>
267   is not absolute then it is assumed to be relative to <directive module="core">
268   DefaultRuntimeDir</directive>.</p>
269
270   <p>If this directive is not specified, data will not be stored for off-line
271   audit.</p>
272
273   <p>The directory will contain files named <code><em>PID</em>.tmp</code> for
274   active child processes and files named <code><em>PID</em>.out</code> for exited
275   child processes.  These <code>.out</code> files are ready for off-line audit. 
276   The experimental command <code>ctauditscts</code> (in the httpd source tree, not
277   currently installed) interfaces with <em>certificate-transparency</em> tools to
278   perform the audit.</p>
279 </usage>
280 </directivesynopsis>
281
282 <directivesynopsis>
283 <name>CTLogClient</name>
284 <description>Location of certificate-transparency log client tool</description>
285 <syntax>CTLogClient <em>executable</em></syntax>
286 <default>none</default>
287 <contextlist><context>server config</context>
288 </contextlist>
289
290 <usage>
291   <p><em>executable</em> is the full path to the log client tool, which is
292   normally file <code>src/client/ct</code> within the source tree of the 
293   <a href="https://code.google.com/p/certificate-transparency/">
294   certificate-transparency</a> open source project.</p>
295
296   <p>An alternative implementation could be used to retrieve SCTs for a
297   server certificate as long as the command-line interface is equivalent.</p>
298
299   <p>If this directive is not configured, server certificates cannot be
300   submitted to logs in order to obtain SCTs; thus, only admin-managed
301   SCTs will be provided to clients.</p>
302 </usage>
303 </directivesynopsis>
304
305 <directivesynopsis>
306 <name>CTLogConfigDB</name>
307 <description>Log configuration database supporting dynamic updates</description>
308 <syntax>CTLogConfigDB <em>filename</em></syntax>
309 <default>none</default>
310 <contextlist><context>server config</context></contextlist>
311
312 <usage>
313   <p>The <directive>CTLogConfigDB</directive> directive sets the name of a database
314   containing configuration about known logs.  If <em>filename</em> is not absolute
315   then it is assumed to be relative to
316   <directive module="core">ServerRoot</directive>.</p>
317
318   <p>Refer to the documentation for the <program>ctlogconfig</program> program,
319   which manages the database.</p>
320 </usage>
321 </directivesynopsis>
322
323 <directivesynopsis>
324 <name>CTMaxSCTAge</name>
325 <description>Maximum age of SCT obtained from a log, before it will be
326 refreshed</description>
327 <syntax>CTMaxSCTAge <em>num-seconds</em></syntax>
328 <default>1 day</default>
329 <contextlist><context>server config</context></contextlist>
330
331 <usage>
332   <p>Server certificates with SCTs which are older than this maximum age will
333   be resubmitted to configured logs.  Generally the log will return the same SCT
334   as before, but that is subject to log operation.  SCTs will be refreshed as
335   necessary during normal server operation, with new SCTs returned to clients
336   as they become available.</p>
337 </usage>
338 </directivesynopsis>
339
340 <directivesynopsis>
341 <name>CTProxyAwareness</name>
342 <description>Level of CT awareness and enforcement for a proxy
343 </description>
344 <syntax>CTProxyAwareness <em>oblivious|aware|require</em></syntax>
345 <default>aware</default>
346 <contextlist><context>server config</context>
347 <context>virtual host</context></contextlist>
348
349 <usage>
350   <p>This directive controls awareness and checks for valid SCTs for a
351   proxy.  Several options are available:</p>
352
353   <dl>
354     <dt>oblivious</dt>
355     <dd>The proxy will neither ask for nor examine SCTs.  Certificate
356     Transparency processing for the proxy is completely disabled.</dd>
357
358     <dt>aware</dt>
359     <dd>The proxy will perform all appropriate Certificate Transparency
360     processing, such as asking for and examining SCTs.  However, the
361     proxy will not disallow communication if the origin server does
362     not provide any valid SCTs.</dd>
363
364     <dt>require</dt>
365     <dd>The proxy will abort communication with the origin server if it
366     does not provide at least one SCT which passes on-line validation.</dd>
367   </dl>
368
369 </usage>
370 </directivesynopsis>
371
372 <directivesynopsis>
373 <name>CTSCTStorage</name>
374 <description>Existing directory where SCTs are managed</description>
375 <syntax>CTSCTStorage <em>directory</em></syntax>
376 <default>none</default>
377 <contextlist><context>server config</context>
378 </contextlist>
379
380 <usage>
381   <p>The <directive>CTSCTStorage</directive> directive sets the name of a
382   directory where SCTs and SCT lists will will be stored.  If <em>directory</em>
383   is not absolute then it is assumed to be relative to <directive module="core">
384   DefaultRuntimeDir</directive>.</p>
385
386   <p>A subdirectory for each server certificate contains information relative
387   to that certificate; the name of the subdirectory is the SHA-256 hash of the
388   certificate.</p>
389
390   <p>The certificate-specific directory contains SCTs retrieved from configured 
391   logs, SCT lists prepared from statically configured SCTs and retrieved SCTs,
392   and other information used for managing SCTs.</p>
393 </usage>
394 </directivesynopsis>
395
396 <directivesynopsis>
397 <name>CTServerHelloSCTLimit</name>
398 <description>Limit on number of SCTs that can be returned in
399 ServerHello</description>
400 <syntax>CTServerHelloSCTLimit <em>limit</em></syntax>
401 <default>100</default>
402 <contextlist><context>server config</context>
403 </contextlist>
404
405 <usage>
406   <p>This directive can be used to limit the number of SCTs which can be
407   returned by a TLS server in ServerHello, in case the number of configured
408   logs and statically-defined SCTs is relatively high.</p>
409
410   <p>Typically only a few SCTs would be available, so this directive is only
411   needed in special circumstances.</p>
412
413   <p>The directive does not take into account SCTs which may be provided in
414   certificate extensions or in stapled OCSP responses.</p>
415 </usage>
416 </directivesynopsis>
417
418 <directivesynopsis>
419 <name>CTStaticLogConfig</name>
420 <description>Static configuration of information about a log</description>
421 <syntax>CTStaticLogConfig <em>log-id|-</em> <em>public-key-file|-</em>
422 <em>1|0|-</em> <em>min-timestamp|-</em> <em>max-timestamp|-</em>
423 <em>log-URL|-</em></syntax>
424 <default>none</default>
425 <contextlist><context>server config</context>
426 </contextlist>
427
428 <usage>
429   <p>This directive is used to configure information about a particular log.
430   This directive is appropriate when configuration information changes rarely.
431   If dynamic configuration updates must be supported, refer to the 
432   <directive module="mod_ssl_ct">CTLogConfigDB</directive> directive.</p>
433
434   <p>Each of the six fields must be specified, but usually only a small
435   amount of information must be configured for each log; use <em>-</em> when no
436   information is available for the field.  The fields are defined as follows:</p>
437
438   <dl>
439     <dt><em>log-id</em></dt>
440     <dd>This is the id of the log, which is the SHA-256 hash of the log's
441     public key.</dd>
442
443     <dt><em>public-key-file</em></dt>
444     <dd>This is the name of a file containing the PEM encoding of the log's
445     public key.  If the name is not absolute, then it is assumed to be relative
446     to <directive module="core">ServerRoot</directive>.</dd>
447
448     <dt><em>trust</em></dt>
449     <dd>This is a generic <q>trust</q> flag.  Set this field to <em>0</em> to
450     distrust this log.</dd>
451
452     <dt><em>min-timestamp</em></dt>
453     <dd>SCTs received from this log by the proxy are invalid if the timestamp
454     is older than this value.</dd>
455
456     <dt><em>max-timestamp</em></dt>
457     <dd>SCTs received from this log by the proxy are invalid if the timestamp
458     is newer than this value.</dd>
459
460     <dt><em>log-URL</em></dt>
461     <dd>This is the URL of the log, for use in submitting server certificates
462     and in turn obtaining an SCT to be sent to clients.</dd>
463   </dl>
464 </usage>
465
466 <seealso><a href="#logconf">Log configuration</a> contains more general information
467 about the fields which can be configured with this directive.</seealso>
468
469 </directivesynopsis>
470
471 <directivesynopsis>
472 <name>CTStaticSCTs</name>
473 <description>Static configuration of one or more SCTs for a server certificate
474 </description>
475 <syntax>CTStaticSCTs <em>certificate-pem-file</em> <em>sct-directory</em></syntax>
476 <default>none</default>
477 <contextlist><context>server config</context>
478 </contextlist>
479
480 <usage>
481   <p>This directive is used to statically define one or more SCTs corresponding
482   to a server certificate.  This mechanism can be used instead of or in
483   addition to dynamically obtaining SCTs from configured logs.  Any changes to
484   the set of SCTs for a particular server certificate will be adopted dynamically
485   without the need to restart the server.</p>
486
487   <p><em>certificate-pem-file</em> refers to the server certificate in PEM
488   format.  If the name is not absolute, then it is assumed to be relative to
489   <directive module="core">ServerRoot</directive>.</p>
490
491   <p><em>sct-directory</em> should contain one or more files with extension
492   <code>.sct</code>, representing one or more SCTs corresponding to the
493   server certificate.  If <em>sct-directory</em> is not absolute, then it is 
494   assumed to be relative to <directive module="core">ServerRoot</directive>.</p>
495
496   <p>If <em>sct-directory</em> is empty, no error will be raised.</p>
497
498   <p>This directive could be used to identify directories of SCTs maintained by
499   other infrastructure, provided that they are saved in binary format with
500   file extension <em>.sct</em></p>
501 </usage>
502 </directivesynopsis>
503
504 </modulesynopsis>