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