Certificate Management 1.0

How we manage SSL certificates

Rationale

There are a number of steps involved in creation of SSL certificates and it is important that we employ a maintainable and consistent and secure process.

Prerequisites

  • FQDN for host
  • Shell access to host server
  • Any Server Alternate Names (SAN) These will be needed when creating the cert
  • The private key to be used with this cert (created with CSR)
  • A certificate creation entity. In our case incommon at https://cert-manager.com/customer/InCommon

Process

  1. Create a Certificate Signing Request (CSR) for the server. This also creates a local private key

    openssl req -new -newkey rsa:2048 -nodes -keyout servername.key -out servername.csr

This can be created anywhere the SSL tools are installed. Archive the private key and CSR.

  1. Log into InCommon. Use the CSR to request a certificate, applying any alternate names to the request. This will likely involve cutting and pasting the CSR into a web form

  2. Have the certificate approved

  3. Download the certificate (.cer file) from incommon, choosing the appropriate option for the cert

    • Certificate (w/chain), PEM encoded
    • Certificate only, PEM encoded
    • PKCS#7, PEM encoded
    • PKCS#7
    • Root/intermediate(s) only, PEM encoded
    • Intermediate(s), Root only, PEM encoded

The certificate must be encrypted into an eyaml file using the private key of the Pupper server. USE WHATEVER PROCESS THAT WE DEVELOP FOR MANAGING KEYS THAT S&C APPROVES

  1. Upload the cert and private key to the Puppet server. Encrypt the ..key and with eyaml

    eyaml encrypt -f servername.csr -o block ????????

  2. Download the encrypted cert and key from the Puppet server and store the encrypted cert and private key in the node files for the server in Puppet (see syntax below)

  3. Install certificate and private key on server and confirm functionality. Be sure to delete any other copies of the private key. The key can be regenerated from the CSR. This leaves us with the only other copy of the certificate and private key stored in eyaml format in GitHub

  4. Add certificate information to SSL Key Minder once the certificate has been deployed. SSL Key Minder actively checks the certs on their active ports using the Systools servers. Tool is at https://systools.oit.ncsu.edu/tools-bin/sslkey-status

  • Select “Add record”. As the system actively checks the certs, the TEST HOST and TEST PORT must be valid and reachable through any firewalls from the test servers so that the certificate can be accessed. Fields
  • ID - usually common name, unique identifier (42 character limit)
  • TEST HOST - FQDN of hostname where cert is installed* TEST PORT - service port used by certificate (i.e 443)
  • SNI HOSTNAME - usually left blank, unless you have one or most certificates where the CN is different from the name of the server. Occasionally needed on shared servers.
  • KEY CONTACT - email of group responsible for key/cert

Searching : The Search field uses ID, TEST HOST and SNI HOSTNAME content when searching for a key

Summary of commands

  • Creating the key and certificate signing request (csr) openssl req -new -nodes -keyout ./proxy-dev-vip.oit.ncsu.edu.key -out ./proxy-dev-vip.oit.ncsu.edu.csr -config proxydev100.openssl.cnf

Convert certs to eyaml format

  1. Upload files to pm00.oit.ncsu.edu:/tmp
  2. Run /opt/puppetlabs/puppet/bin/eyaml
  3. Download encrypted eyaml files to local host
  4. Add these encrypted stanzas to the node file for the host

Syntax of encrypted cert and key to be included in node description file

(located in oit_linux/data/nodes/.eyaml)

---
# signing cert and key 
#example.oit.ncsu.edu
#example2.oit.ncsu.edu
#
# certificate
oit_linux::profile::<profilename.pp>::certificate: >
    ENC[PKCS7,MIIhPQYJKoZIhvcNAQcDoIIhLjCCISoCAQAxggEhMIIBHQIBADAFMAACAQEw
    DQYJKoZIhvcNAQEBBQAEggEAVBsZSs1tt+Cjzx4cbonOEGW9hoRLfsXcJ0Ul
    o0LTLNXz/bqKfbCo57TeYyDTNese/wFtKfxDzhxmdmgvKWpmL16Z0MxyrRYX
    OXAep+fMZZPm2863PFPcQLVp62RsFgLIHQIeo5oqKhGWP4r78I/0Db1/sggp
    … (remainder of cert)
    bx3ncv00FIVvzWZ4cTbsdcPkWElIZ/mNLElH+tt0W/XQGlRQqFfide0Xc1UK
    Q+dJ3WT/NMGRRO+XXkxrOKbdWPxXCDjJWgq1AQitSp5V3G8OwJEzXkc8evBr
    WDpIYSKlyyiHZrkqcRq1mhbNiqDkDazVzJ1YfCSl3dAuiXzX7HmA8kZSFk/J
    P3KB5Zwn4as=]

# private SSL key for server
oit_linux::profile::<profilename.pp>::private_key: >
    ENC[PKCS7,MIIH/QYJKoZIhvcNAQcDoIIH7jCCB+oCAQAxggEhMIIBHQIBADAFMAACAQEw
    DQYJKoZIhvcNAQEBBQAEggEAEUGJjHHwN3b+dua/jw95wgSrGGokxzcyCkYd
    7cWWlIyyjkpO8GZWq8SBmGZzcUPNyJyTgHALub1qLxubIfoNPIzPlqKFN6S7
    Cfg5NMc2d8c3FZEeFtM+avntLnaUM7nVrrpKnaEfMRFa1/+ObFCysyJvhpPq
    … (remainder of key)
    3S1CDfFrgZKo5Ef72vekYyslIdl+nl9Lhb8dNfFnu1g29qByUhkFjBvAsIYP
    MMApaAPBAQdNMRnXd4ylTXnlengYIaYqUfsKiwsmq3J4ldN42MaHk+TNlE5T
    r2KC8NQFjZ1VDD8mZiNApd5M3GBY98aa]

stunnel certificate specifics

The certificate as it received from inCommon must be modified before being installed

The certificate file is made up of multiple certificates The contents looks like this :

  • root certificate
  • AddTrust certificate
  • xxxxTrust certificate
  • InCommon certificate
  • server certificate

The production certificate must have the server certificate as the first certificate in the file (the bottom cert must be moved to the top)

  • server certificate
  • root certificate
  • AddTrust certificate
  • xxxxTrust certificate
  • InCommon certificate
Tags:
Edit me