[c9b953e6] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
| 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
[4a16903] | 7 | <!ENTITY certhost "https://hg.mozilla.org/">
|
---|
| 8 | <!ENTITY certpath "/lib/ckfw/builtins/certdata.txt">
|
---|
[2198a32] | 9 | <!ENTITY make-ca-buildsize "6.6 MB (with all runtime deps)">
|
---|
[c1cd435e] | 10 | <!ENTITY make-ca-time "0.1 SBU (with all runtime deps)">
|
---|
[4a16903] | 11 |
|
---|
[5c3f3856] | 12 | <!ENTITY make-ca-download "https://github.com/djlucas/make-ca/releases/download/v&make-ca-version;/make-ca-&make-ca-version;.tar.xz">
|
---|
[810753b0] | 13 | <!ENTITY make-ca-size "28.5 KB">
|
---|
| 14 | <!ENTITY make-ca-md5sum "e0356f5ae5623f227a3f69b5e8848ec6">
|
---|
[c9b953e6] | 15 | ]>
|
---|
| 16 |
|
---|
[697e6ca5] | 17 | <sect1 id="make-ca" xreflabel="make-ca-&make-ca-version;">
|
---|
[2198a32] | 18 | <?dbhtml filename="make-ca.html"?>
|
---|
[c9b953e6] | 19 |
|
---|
| 20 | <sect1info>
|
---|
| 21 | <date>$Date$</date>
|
---|
| 22 | </sect1info>
|
---|
| 23 |
|
---|
[697e6ca5] | 24 | <title>make-ca-&make-ca-version;</title>
|
---|
[2198a32] | 25 | <indexterm zone="make-ca">
|
---|
| 26 | <primary sortas="a-make-ca">make-ca</primary>
|
---|
[c9b953e6] | 27 | </indexterm>
|
---|
| 28 |
|
---|
| 29 | <sect2 role="package">
|
---|
[2198a32] | 30 | <title>Introduction to make-ca</title>
|
---|
[c9b953e6] | 31 |
|
---|
[697e6ca5] | 32 | <para>
|
---|
| 33 | Public Key Infrastructure (PKI) is a method to validate the authenticity
|
---|
| 34 | of an otherwise unknown entity across untrusted networks. PKI works by
|
---|
| 35 | establishing a chain of trust, rather than trusting each individual host
|
---|
| 36 | or entity explicitly. In order for a certificate presented by a remote
|
---|
| 37 | entity to be trusted, that certificate must present a complete chain of
|
---|
| 38 | certificates that can be validated using the root certificate of a
|
---|
| 39 | Certificate Authority (CA) that is trusted by the local machine.
|
---|
| 40 | </para>
|
---|
| 41 |
|
---|
| 42 | <para>
|
---|
| 43 | Establishing trust with a CA involves validating things like company
|
---|
| 44 | address, ownership, contact information, etc., and ensuring that the CA
|
---|
| 45 | has followed best practices, such as undergoing periodic security audits
|
---|
| 46 | by independent investigators and maintaining an always available
|
---|
| 47 | certificate revocation list. This is well outside the scope of BLFS (as
|
---|
| 48 | it is for most Linux distributions). The certificate store provided here
|
---|
| 49 | is taken from the Mozilla Foundation, who have established very strict
|
---|
| 50 | inclusion policies described <ulink
|
---|
| 51 | url="https://www.mozilla.org/en-US/about/governance/policies/security-group/certs/">here</ulink>.
|
---|
| 52 | </para>
|
---|
| 53 |
|
---|
[e40b2f25] | 54 | &lfs110a_checked;
|
---|
[697e6ca5] | 55 |
|
---|
| 56 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
[c9b953e6] | 57 | <itemizedlist spacing="compact">
|
---|
| 58 | <listitem>
|
---|
[47274444] | 59 | <para>
|
---|
| 60 | Download (HTTP): <ulink url="&make-ca-download;"/>
|
---|
| 61 | </para>
|
---|
[c9b953e6] | 62 | </listitem>
|
---|
| 63 | <listitem>
|
---|
[47274444] | 64 | <para>
|
---|
| 65 | Download size: &make-ca-size;
|
---|
| 66 | </para>
|
---|
[30b7db74] | 67 | </listitem>
|
---|
| 68 | <listitem>
|
---|
[47274444] | 69 | <para>
|
---|
| 70 | Download MD5 Sum: &make-ca-md5sum;
|
---|
| 71 | </para>
|
---|
[c9b953e6] | 72 | </listitem>
|
---|
| 73 | <listitem>
|
---|
[47274444] | 74 | <para>
|
---|
| 75 | Estimated disk space required: &make-ca-buildsize;
|
---|
| 76 | </para>
|
---|
[c9b953e6] | 77 | </listitem>
|
---|
| 78 | <listitem>
|
---|
[47274444] | 79 | <para>
|
---|
| 80 | Estimated build time: &make-ca-time;
|
---|
| 81 | </para>
|
---|
[c9b953e6] | 82 | </listitem>
|
---|
| 83 | </itemizedlist>
|
---|
| 84 |
|
---|
[2198a32] | 85 | <bridgehead renderas="sect3">make-ca Dependencies</bridgehead>
|
---|
[c1cd435e] | 86 |
|
---|
[95378e8] | 87 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
[47274444] | 88 | <para role="required">
|
---|
| 89 | <xref linkend="p11-kit"/> (required at runtime to
|
---|
| 90 | generate certificate stores from trust anchors)
|
---|
| 91 | </para>
|
---|
[95378e8] | 92 | <!-- /usr/bin/trust is needed to extract the certs to /etc/ssl/certs -->
|
---|
[c1cd435e] | 93 |
|
---|
[4a16903] | 94 | <bridgehead renderas="sect4">Optional (runtime)</bridgehead>
|
---|
| 95 | <para role="optional">
|
---|
[21a08bf] | 96 | <xref role="runtime" linkend="nss"/> (to generate a shared NSSDB)
|
---|
[96e9478] | 97 | </para>
|
---|
[c9b953e6] | 98 |
|
---|
| 99 | <para condition="html" role="usernotes">User Notes:
|
---|
[2198a32] | 100 | <ulink url='&blfs-wiki;/make-ca'/></para>
|
---|
[c9b953e6] | 101 | </sect2>
|
---|
| 102 |
|
---|
| 103 | <sect2 role="installation">
|
---|
[2198a32] | 104 | <title>Installation of make-ca</title>
|
---|
[c9b953e6] | 105 |
|
---|
[47274444] | 106 | <para>
|
---|
| 107 | The <application>make-ca</application> script will download and process
|
---|
| 108 | the certificates included in the <filename>certdata.txt</filename> file
|
---|
| 109 | for use as trust anchors for the <xref linkend="p11-kit"/> trust module.
|
---|
| 110 | Additionally, it will generate system certificate stores used by BLFS
|
---|
| 111 | applications (if the recommended and optional applications are present
|
---|
| 112 | on the system). Any local certificates stored in
|
---|
| 113 | <filename>/etc/ssl/local</filename> will be imported to both the trust
|
---|
| 114 | anchors and the generated certificate stores (overriding Mozilla's
|
---|
| 115 | trust). Additionally, any modified trust values will be copied from the
|
---|
| 116 | trust anchors to <filename>/etc/ssl/local</filename> prior to any
|
---|
| 117 | updates, preserving custom trust values that differ from Mozilla when
|
---|
| 118 | using the <command>trust</command> utility from
|
---|
| 119 | <application>p11-kit</application> to operate on the trust store.
|
---|
| 120 | </para>
|
---|
| 121 |
|
---|
| 122 | <para>
|
---|
| 123 | To install the various certificate stores, first install the
|
---|
| 124 | <application>make-ca</application> script into the correct location.
|
---|
| 125 | As the <systemitem class="username">root</systemitem> user:
|
---|
| 126 | </para>
|
---|
[4a16903] | 127 |
|
---|
[254e3bf] | 128 | <screen role="root"><userinput>make install &&
|
---|
| 129 | install -vdm755 /etc/ssl/local</userinput></screen>
|
---|
[4a16903] | 130 |
|
---|
[47274444] | 131 | <para>
|
---|
| 132 | As the <systemitem class="username">root</systemitem> user, after
|
---|
| 133 | installing <xref linkend="p11-kit"/>, download the certificate source and
|
---|
| 134 | prepare for system use with the following command:
|
---|
| 135 | </para>
|
---|
[4a16903] | 136 |
|
---|
[a90ec5a7] | 137 | <note>
|
---|
[47274444] | 138 | <para>
|
---|
| 139 | If running the script a second time with the same version of
|
---|
| 140 | <filename>certdata.txt</filename>, for instance, to add additional
|
---|
| 141 | stores as the requisite software is installed, add the
|
---|
| 142 | <parameter>-r</parameter> switch to the command line. If packaging,
|
---|
| 143 | run <command>make-ca --help</command> to see all available command
|
---|
| 144 | line options.
|
---|
| 145 | </para>
|
---|
[a90ec5a7] | 146 | </note>
|
---|
| 147 |
|
---|
[729e458] | 148 | <screen role="root"><userinput>/usr/sbin/make-ca -g</userinput></screen>
|
---|
[4a16903] | 149 |
|
---|
[47274444] | 150 | <para>
|
---|
| 151 | You should periodically update the store with the above command,
|
---|
| 152 | either manually, or via a <phrase revision="sysv">cron job.</phrase>
|
---|
| 153 | <phrase revision="systemd">systemd timer. A timer is installed at
|
---|
| 154 | <filename>/usr/lib/systemd/system/update-pki.timer</filename> that, if
|
---|
| 155 | enabled, will check for updates weekly.</phrase><phrase
|
---|
| 156 | revision="sysv">If you've installed <xref linkend="fcron"/> and
|
---|
[914dd13] | 157 | completed the section on periodic jobs, execute</phrase> <phrase
|
---|
[47274444] | 158 | revision="systemd">Execute</phrase> the following commands, as the
|
---|
| 159 | <systemitem class="username">root</systemitem> user, to <phrase
|
---|
| 160 | revision="sysv">create a weekly cron job:</phrase><phrase
|
---|
| 161 | revision="systemd">enable the systemd timer:</phrase>
|
---|
[02e3bbc8] | 162 | </para>
|
---|
| 163 |
|
---|
[914dd13] | 164 | <screen role="nodump" revision="sysv"><userinput>cat > /etc/cron.weekly/update-pki.sh << "EOF" &&
|
---|
[02e3bbc8] | 165 | <literal>#!/bin/bash
|
---|
| 166 | /usr/sbin/make-ca -g</literal>
|
---|
| 167 | EOF
|
---|
| 168 | chmod 754 /etc/cron.weekly/update-pki.sh</userinput></screen>
|
---|
| 169 |
|
---|
| 170 | <screen role="root" revision="systemd"><userinput>systemctl enable update-pki.timer</userinput></screen>
|
---|
[4a16903] | 171 |
|
---|
[5c3f3856] | 172 | </sect2>
|
---|
[4a16903] | 173 |
|
---|
[5c3f3856] | 174 | <sect2 role="configuration" id="make-ca-config">
|
---|
| 175 | <title>Configuring make-ca</title>
|
---|
| 176 |
|
---|
[47274444] | 177 | <para>
|
---|
| 178 | For most users, no additional configuration is necessary, however,
|
---|
| 179 | the default <filename>certdata.txt</filename> file provided by make-ca
|
---|
| 180 | is obtained from the mozilla-release branch, and is modified to provide a
|
---|
| 181 | Mercurial revision. This will be the correct version for most systems.
|
---|
| 182 | There are several other variants of the file available for use that might
|
---|
| 183 | be preferred for one reason or another, including the files shipped with
|
---|
| 184 | Mozilla products in this book. RedHat and OpenSUSE, for instance, use the
|
---|
| 185 | version included in <xref linkend="nss"/>. Additional upstream downloads
|
---|
| 186 | are available at the links included in
|
---|
| 187 | <filename>/etc/make-ca.conf.dist</filename>. Simply copy the file to
|
---|
| 188 | <filename>/etc/make-ca.conf</filename> and edit as appropriate.
|
---|
| 189 | </para>
|
---|
[5c3f3856] | 190 |
|
---|
| 191 | <indexterm zone="make-ca make-ca-config">
|
---|
| 192 | <primary sortas="e-etc-make-ca-conf">/etc/make-ca.conf</primary>
|
---|
| 193 | </indexterm>
|
---|
[8b9034a] | 194 |
|
---|
[638a6a4] | 195 | <bridgehead renderas="sect3">About Trust Arguments</bridgehead>
|
---|
| 196 |
|
---|
[47274444] | 197 | <para>
|
---|
| 198 | There are three trust types that are recognized by the
|
---|
| 199 | <application>make-ca</application> script, SSL/TLS, S/Mime, and code
|
---|
| 200 | signing. For <application>OpenSSL</application>, these are
|
---|
| 201 | <parameter>serverAuth</parameter>,
|
---|
| 202 | <parameter>emailProtection</parameter>, and
|
---|
| 203 | <parameter>codeSigning</parameter> respectively. If one of the three
|
---|
| 204 | trust arguments is omitted, the certificate is neither trusted, nor
|
---|
| 205 | rejected for that role. Clients that use
|
---|
| 206 | <application>OpenSSL</application> or <application>NSS</application>
|
---|
| 207 | encountering this certificate will present a warning to the user.
|
---|
| 208 | Clients using
|
---|
| 209 | <application>GnuTLS</application> without
|
---|
| 210 | <application>p11-kit</application> support are not aware of trusted
|
---|
| 211 | certificates. To include this CA into the
|
---|
| 212 | <filename>ca-bundle.crt</filename>,
|
---|
| 213 | <filename>email-ca-bundle.crt</filename>, or
|
---|
| 214 | <filename>objsign-ca-bundle.crt</filename> files
|
---|
| 215 | (the <application>GnuTLS</application> legacy bundles), it must have the
|
---|
| 216 | appropriate trust arguments.
|
---|
| 217 | </para>
|
---|
[638a6a4] | 218 |
|
---|
| 219 | <bridgehead renderas="sect3">Adding Additional CA Certificates</bridgehead>
|
---|
| 220 |
|
---|
[47274444] | 221 | <para>
|
---|
| 222 | The <filename class="directory">/etc/ssl/local</filename> directory
|
---|
| 223 | is available to add additional CA certificates to the system. For
|
---|
| 224 | instance, you might need to add an organization or government CA
|
---|
| 225 | certificate. Files in this directory must be in the
|
---|
| 226 | <application>OpenSSL</application> trusted certificate format. To
|
---|
| 227 | create an <application>OpenSSL</application> trusted certificate from
|
---|
| 228 | a regular PEM encoded file, you need to add trust arguments to the
|
---|
| 229 | <command>openssl</command> command, and create a new certificate. For
|
---|
| 230 | example, using the <ulink url="http://www.cacert.org/">CAcert</ulink>
|
---|
| 231 | roots, if you want to trust both for all three roles, the following
|
---|
| 232 | commands will create appropriate OpenSSL trusted certificates (run as
|
---|
| 233 | the <systemitem class="username">root</systemitem> user after <xref
|
---|
| 234 | linkend="wget"/> is installed):
|
---|
| 235 | </para>
|
---|
[638a6a4] | 236 |
|
---|
[254e3bf] | 237 | <screen role="nodump"><userinput>wget http://www.cacert.org/certs/root.crt &&
|
---|
[638a6a4] | 238 | wget http://www.cacert.org/certs/class3.crt &&
|
---|
| 239 | openssl x509 -in root.crt -text -fingerprint -setalias "CAcert Class 1 root" \
|
---|
| 240 | -addtrust serverAuth -addtrust emailProtection -addtrust codeSigning \
|
---|
| 241 | > /etc/ssl/local/CAcert_Class_1_root.pem &&
|
---|
| 242 | openssl x509 -in class3.crt -text -fingerprint -setalias "CAcert Class 3 root" \
|
---|
| 243 | -addtrust serverAuth -addtrust emailProtection -addtrust codeSigning \
|
---|
[254e3bf] | 244 | > /etc/ssl/local/CAcert_Class_3_root.pem &&
|
---|
| 245 | /usr/sbin/make-ca -r -f</userinput></screen>
|
---|
[638a6a4] | 246 |
|
---|
| 247 | <bridgehead renderas="sect3">Overriding Mozilla Trust</bridgehead>
|
---|
| 248 |
|
---|
[47274444] | 249 | <para>
|
---|
| 250 | Occasionally, there may be instances where you don't agree with
|
---|
| 251 | Mozilla's inclusion of a particular certificate authority. If you'd like
|
---|
| 252 | to override the default trust of a particular CA, simply create a copy of
|
---|
| 253 | the existing certificate in <filename
|
---|
| 254 | class="directory">/etc/ssl/local</filename> with different trust
|
---|
| 255 | arguments. For example, if you'd like to distrust the
|
---|
| 256 | "Makebelieve_CA_Root" file, run the following commands:
|
---|
| 257 | </para>
|
---|
[638a6a4] | 258 |
|
---|
[254e3bf] | 259 | <screen role="nodump"><userinput>openssl x509 -in /etc/ssl/certs/Makebelieve_CA_Root.pem \
|
---|
[638a6a4] | 260 | -text \
|
---|
[92897c03] | 261 | -fingerprint \
|
---|
[638a6a4] | 262 | -setalias "Disabled Makebelieve CA Root" \
|
---|
| 263 | -addreject serverAuth \
|
---|
| 264 | -addreject emailProtection \
|
---|
| 265 | -addreject codeSigning \
|
---|
| 266 | > /etc/ssl/local/Disabled_Makebelieve_CA_Root.pem &&
|
---|
| 267 | /usr/sbin/make-ca -r -f</userinput></screen>
|
---|
| 268 |
|
---|
[c9b953e6] | 269 | </sect2>
|
---|
| 270 |
|
---|
| 271 | <sect2 role="content">
|
---|
| 272 | <title>Contents</title>
|
---|
| 273 |
|
---|
| 274 | <segmentedlist>
|
---|
| 275 | <segtitle>Installed Programs</segtitle>
|
---|
| 276 | <segtitle>Installed Directories</segtitle>
|
---|
| 277 |
|
---|
| 278 | <seglistitem>
|
---|
[120b315] | 279 | <seg>make-ca</seg>
|
---|
[28b75d3] | 280 | <seg>/etc/ssl/{certs,local} and
|
---|
| 281 | /etc/pki/{nssdb,anchors,tls/{certs,java}}</seg>
|
---|
[c9b953e6] | 282 | </seglistitem>
|
---|
| 283 | </segmentedlist>
|
---|
| 284 |
|
---|
| 285 | <variablelist>
|
---|
| 286 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 287 | <?dbfo list-presentation="list"?>
|
---|
| 288 | <?dbhtml list-presentation="table"?>
|
---|
| 289 |
|
---|
[2198a32] | 290 | <varlistentry id="make-ca-bin">
|
---|
[120b315] | 291 | <term><command>make-ca</command></term>
|
---|
[c9b953e6] | 292 | <listitem>
|
---|
[47274444] | 293 | <para>
|
---|
| 294 | is a shell script that adapts a current version of
|
---|
| 295 | <filename>certdata.txt</filename>, and prepares it for use
|
---|
[4c24eb0a] | 296 | as the system trust store
|
---|
[47274444] | 297 | </para>
|
---|
[2198a32] | 298 | <indexterm zone="make-ca make-ca">
|
---|
[c9b953e6] | 299 | <primary sortas="b-make-ca">make-ca</primary>
|
---|
| 300 | </indexterm>
|
---|
| 301 | </listitem>
|
---|
| 302 | </varlistentry>
|
---|
| 303 | </variablelist>
|
---|
| 304 |
|
---|
| 305 | </sect2>
|
---|
[4c24eb0a] | 306 |
|
---|
[c9b953e6] | 307 | </sect1>
|
---|