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) for basic
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.</dd>
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>
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>
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.
203 The log URL is also needed by off-line auditing of SCTs received by a
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>
214 <section id="logging">
215 <title>Logging CT status in the access log</title>
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>
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>
224 <p>These variables can be logged with the <code>%{<em>varname</em>}e</code>
225 format of <module>mod_log_config</module>.</p>
229 <title>Off-line audit for proxy</title>
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>
240 <p>Here are rough notes for using <code>ctauditscts</code>:</p>
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>
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
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>
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>
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>
270 <p>If this directive is not specified, data will not be stored for off-line
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>
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>
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>
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>
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>
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>
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>
318 <p>Refer to the documentation for the <program>ctlogconfig</program> program,
319 which manages the database.</p>
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>
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>
341 <name>CTProxyAwareness</name>
342 <description>Level of CT awareness and enforcement for a proxy
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>
350 <p>This directive controls awareness and checks for valid SCTs for a
351 proxy. Several options are available:</p>
355 <dd>The proxy will neither ask for nor examine SCTs. Certificate
356 Transparency processing for the proxy is completely disabled.</dd>
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>
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>
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>
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>
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
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>
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>
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>
410 <p>Typically only a few SCTs would be available, so this directive is only
411 needed in special circumstances.</p>
413 <p>The directive does not take into account SCTs which may be provided in
414 certificate extensions or in stapled OCSP responses.</p>
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>
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>
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>
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
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>
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>
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>
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>
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>
466 <seealso><a href="#logconf">Log configuration</a> contains more general information
467 about the fields which can be configured with this directive.</seealso>
472 <name>CTStaticSCTs</name>
473 <description>Static configuration of one or more SCTs for a server certificate
475 <syntax>CTStaticSCTs <em>certificate-pem-file</em> <em>sct-directory</em></syntax>
476 <default>none</default>
477 <contextlist><context>server config</context>
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>
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>
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>
496 <p>If <em>sct-directory</em> is empty, no error will be raised.</p>
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>