Changes between Version 6 and Version 7 of SystemAdministration/Security/TLS


Ignore:
Timestamp:
12/02/15 12:09:50 (8 years ago)
Author:
Sander Maijers
Comment:
  • ENHANCE: Add instructions for handling private keys and other relevant files.

Legend:

Unmodified
Added
Removed
Modified
  • SystemAdministration/Security/TLS

    v6 v7  
    1 = Creating a TLS certificate
    2 == Bundle for `nginx`'s `ssl_certificate` (site, intermediate, root)
     1= Handling TLS related configuration
     2...
     3== Creating a TLS certificate
     4...
     5
     6== Organization of TLS certificate-related files
     7There are two categories of files that need to be kept.
     81. Files not directly relevant to production (`'/root/certstore/'` on a secure admin workstation):
     9* The certificate signing request (CSR);
     10* CSR creation config files for e.g. OpenSSL;
     11* CA and site certificates in various formats ;
     12* (This same file set for past, expired certificates.).
     132. Files directly relevant to production (`'/etc/CLARIN_TLS/'`):
     14* The private key;
     15* Certificate bundles;
     16* Diffie-Hellman parameters.
     17{{{
     18/etc/CLARIN_TLS/
     19├── [dr-xr-xr-x root     root     1.0K]  _.clarin.eu
     20│   ├── [-r--r--r-- root     root     2.6K]  OCSP_bundle.pem
     21│   ├── [-r--r--r-- root     root     4.3K]  bundle.pem
     22│   └── [-r-------- root     root     1.6K]  private_nopass.key
     23└── [-r--r--r-- root     root      424]  dhparam.pem
     24}}}
     25For practical reasons, our serverices use a passphrase-less (unencrypted) private key.
     26Before private key files are generated (on a secure admin workstation):
     271. a root shell must be started, preferable a limited, secure shell such as `dash`,
     282. unnecessary processes must be closed (e.g. graphical environment, browser),
     293. the `umask` must be set so that no file created is every readable by someone other than the superuser,
     304. file permissions must be double checked.
     31
     32The private key should not be stored outside server hosts that critically need it, except for a minimal number of backups on secure admin workstations, always in encrypted form.
     33
     34== Bundling TLS certificates
     35=== Bundle for `nginx`'s `ssl_certificate` (site, intermediate, root)
    336{{{
    437#!sh
    538## as root:
    6 cd '/root/certstore/wildcard-clarin-eu-new/' &&
     39cd '/root/certstore/' &&
    740printf '\n' > 'newline' &&
    841## Concatenate certificates in this order for Nginx
    9 cat 'clarin.eu/cert/wildcard-clarin-eu.cer' 'newline' 'clarin.eu/cert/RapidSSLSHA256CA-G3.cer' 'newline' 'clarin.eu/cert/GeoTrustGlobalCA.cer' 'newline' > 'bundle.cer'
    10 dos2unix 'bundle.cer'
     42cat 'clarin.eu/cert/wildcard-clarin-eu.cer' 'newline' 'clarin.eu/cert/RapidSSLSHA256CA-G3.cer' 'newline' 'clarin.eu/cert/GeoTrustGlobalCA.cer' 'newline' > '/etc/CLARIN_TLS/_clarin.eu/bundle.cer'
     43dos2unix '/etc/CLARIN_TLS/_clarin.eu/bundle.cer'
     44chmod a=r '/etc/CLARIN_TLS/_clarin.eu/bundle.cer'
    1145}}}
    1246
    13 == Bundle for `nginx`'s `ssl_trusted_certificate` (root, intermediate)
     47=== Bundle for `nginx`'s `ssl_trusted_certificate` (root, intermediate)
    1448
    1549{{{
    1650#!sh
    1751## as root:
    18 cd '/root/certstore/wildcard-clarin-eu-new/' &&
     52cd '/root/certstore/' &&
    1953printf '\n' > 'newline' &&
    2054## Concatenate certificates in this order for Nginx
    21 cat 'clarin.eu/cert/GeoTrustGlobalCA.cer' 'newline' 'clarin.eu/cert/RapidSSLSHA256CA-G3.cer' 'newline' > 'trusted_bundle.cer'
    22 dos2unix 'trusted_bundle.cer'
     55cat 'clarin.eu/cert/GeoTrustGlobalCA.cer' 'newline' 'clarin.eu/cert/RapidSSLSHA256CA-G3.cer' 'newline' > '/etc/CLARIN_TLS/_clarin.eu/trusted_bundle.cer'
     56dos2unix '/etc/CLARIN_TLS/_clarin.eu/trusted_bundle.cer'
     57chmod a=r '/etc/CLARIN_TLS/_clarin.eu/trusted_bundle.cer'
    2358}}}
    2459