2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <!-- $LastChangedRevision$ -->
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
14 http://www.apache.org/licenses/LICENSE-2.0
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.
23 <modulesynopsis metafile="mod_ssl_ct.xml.meta">
25 <name>mod_ssl_ct</name>
26 <description>Implementation of Certificate Transparency (RFC 6962)
28 <status>Extension</status>
29 <sourcefile>mod_ssl_ct.c</sourcefile>
30 <identifier>ssl_ct_module</identifier>
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>
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>
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>
59 <p>This implementation for Apache httpd provides these features for TLS
60 servers and proxies:</p>
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
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>
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>
80 <note>This module is experimental for the following reasons:
82 <li>Insufficient test and review</li>
83 <li>Reliance on an unreleased version of OpenSSL (1.0.2, Beta 3 or later) for
85 <li>Incomplete <a href="#audit">off-line audit capability</a></li>
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
95 <title>Server processing overview</title>
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>
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>
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>
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
121 <title>Proxy processing overview</title>
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>
128 <p>On-line verification is attempted for each received SCT:</p>
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
134 <li>For an SCT from a log for which a public key is configured, the server
135 signature will be checked.</li>
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>
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>
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>
154 <section id="logconf">
155 <title>Log configuration</title>
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>
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>
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
174 <p>The information that can be configured about a log using either mechanism is
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>
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.
187 A server must have the public key of the log in order to submit certificates
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>
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>
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.
206 The log URL is also needed by off-line auditing of SCTs received by a
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>
217 <section id="static">
218 <title>Storing SCTs in a form consumable by mod_ssl_ct</title>
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>
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>
230 <section id="logging">
231 <title>Logging CT status in the access log</title>
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>
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>
241 <p>These variables can be logged with the <code>%{<em>varname</em>}e</code>
242 format of <module>mod_log_config</module>.</p>
246 <title>Off-line audit for proxy</title>
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>.
255 <p>Here are rough notes for using <code>ctauditscts</code>:</p>
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>
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
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>
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>
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>
288 <p>If this directive is not specified, data will not be stored for off-line
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>
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>
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
312 <a href="https://code.google.com/p/certificate-transparency/">
313 certificate-transparency</a> open source project.</p>
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>
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>
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>
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>
337 <p>Refer to the documentation for the <program>ctlogconfig</program> program,
338 which manages the database.</p>
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>
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>
360 <name>CTProxyAwareness</name>
361 <description>Level of CT awareness and enforcement for a proxy
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>
369 <p>This directive controls awareness and checks for valid SCTs for a
370 proxy. Several options are available:</p>
374 <dd>The proxy will neither ask for nor examine SCTs. Certificate
375 Transparency processing for the proxy is completely disabled.</dd>
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>
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>
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>
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>
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
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>
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>
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>
429 <p>Typically only a few SCTs would be available, so this directive is only
430 needed in special circumstances.</p>
432 <p>The directive does not take into account SCTs which may be provided in
433 certificate extensions or in stapled OCSP responses.</p>
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>
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>
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>
460 <p>The fields are defined as follows:</p>
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
468 This field should be omitted when <em>public-key-file</em> is provided.</dd>
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>
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>
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.
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>.
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>
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>
498 <seealso><a href="#logconf">Log configuration</a> contains more general information
499 about the fields which can be configured with this directive.</seealso>
504 <name>CTStaticSCTs</name>
505 <description>Static configuration of one or more SCTs for a server certificate
507 <syntax>CTStaticSCTs <em>certificate-pem-file</em> <em>sct-directory</em></syntax>
508 <default>none</default>
509 <contextlist><context>server config</context>
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>
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>
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>
528 <p>If <em>sct-directory</em> is empty, no error will be raised.</p>
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>