ssl-certificates

JSON

rev 9  |  foxhop  |  1409773223000  |  JSON

rev 8
rev 9
206You can also use this command to get information about the SSL chain:206You can also use this command to get information about the SSL chain:
207207
n208 ..  code-block:: bashn208..  code-block:: bash
209209
t210  openssl s_client -connnect <put-domain-name-here>:443t210 openssl s_client -connnect <put-domain-name-here>:443
211211
212212
rev 8  |  foxhop  |  1409773189000  |  JSON

rev 7
rev 8
206You can also use this command to get information about the SSL chain:206You can also use this command to get information about the SSL chain:
207207
t208 ..code-block:: basht208 ..  code-block:: bash
209209
210  openssl s_client -connnect <put-domain-name-here>:443210  openssl s_client -connnect <put-domain-name-here>:443
rev 7  |  foxhop  |  1409773172000  |  JSON

rev 6
rev 7
203203
204  openssl x509 -noout -hash204  openssl x509 -noout -hash
tt205 
206You can also use this command to get information about the SSL chain:
207 
208 ..code-block:: bash
209 
210  openssl s_client -connnect <put-domain-name-here>:443
211 
205212
206213
rev 6  |  foxhop  |  1409772910000  |  JSON

rev 5
rev 6
187187
188188
n189Certificate expiration trackingn189Verify SSL chain
190========================================================190========================================================
191191
n192Email Netadmins a certificate and ask them to add it ton192Run this command and paste in your signed certificate for your host.
193the BigIP for expiration tracking.
194193
t195This happens automatically when using `SSL Offloading <#ssl-offloading>`_.t194.. code-block:: bash
195 
196 openssl x509 -noout -issuer_hash
197 
198Document the resulting hash.
199 
200Then make sure that hash exist somewhere in the certificate chain, by running th
 >is command on each cert in the chain until you find a match.  If you don't find 
 >a match you are using the wrong chain!
201 
202.. code-block:: bash
203 
204  openssl x509 -noout -hash
205 
206 
196207
197Definitions208Definitions
rev 5  |  foxhop  |  1396965155000  |  JSON

rev 4
rev 5
36==================================36==================================
3737
n38#. `Generate a private key and CSR <#generate-a-private-key-and-csr>`n38#. `Generate a private key and CSR`_
39#. send an email to Netadmins:39#. send an email to Netadmins:
4040
49==================================49==================================
5050
t51#. `Generate a private key and CSR <#generate-a-private-key-and-csr>`_t51#. `Generate a private key and CSR`_
52#. send an email to Netadmins:52#. send an email to Netadmins:
5353
rev 4  |  foxhop  |  1396964986000  |  JSON

rev 3
rev 4
36==================================36==================================
3737
n38#. :ref:`Generate a private key and CSR <generate-a-private-key-and-csr>`n38#. `Generate a private key and CSR <#generate-a-private-key-and-csr>`
39#. send an email to Netadmins:39#. send an email to Netadmins:
4040
49==================================49==================================
5050
t51#. `Generate a private key and CSR <generate-a-private-key-and-csr>`_t51#. `Generate a private key and CSR <#generate-a-private-key-and-csr>`_
52#. send an email to Netadmins:52#. send an email to Netadmins:
5353
rev 3  |  foxhop  |  1396964911000  |  JSON

rev 2
rev 3
49==================================49==================================
5050
n51#. :ref:`Generate a private key and CSR <generate-a-private-key-and-csr>`n51#. `Generate a private key and CSR <generate-a-private-key-and-csr>`_
52#. send an email to Netadmins:52#. send an email to Netadmins:
5353
5959
6060
t61.. _generate-a-private-key-and-csr:t61 
6262
63Generate a private key and CSR63Generate a private key and CSR
rev 2  |  foxhop  |  1396964845000  |  JSON

rev 1
rev 2
14The sole ownership of a private key prevents both man-in-the-middle attacks14The sole ownership of a private key prevents both man-in-the-middle attacks
15and domain-name identity spoofing in regards to SSL.15and domain-name identity spoofing in regards to SSL.
tt16 
17.. contents::
1618
17Create a snakeoil cert for testing19Create a snakeoil cert for testing
rev 1  |  foxhop  |  1396964811000  |  JSON

empty
rev 1
tt1SSL Certificates
2################
3 
4We use certificates to certify some of our domain names.
5The certificate is used to build trust and prove an identity.
6 
7A certificate builds trust because of the "background check"
8involved during procurement.  
9 
10The integrity of our identity is proven because only we have the private key.
11The private key may be used to generate a CSR (Certificate Signing Request).
12The CSR may be provided to a 3rd party to generate and sign us a certificate.
13 
14The sole ownership of a private key prevents both man-in-the-middle attacks
15and domain-name identity spoofing in regards to SSL.
16 
17Create a snakeoil cert for testing
18===================================
19 
20Even the 'minimal' flavour of Ubuntu has *ssl-cert* package pre-installed.
21 
22The files are auto-generated and installed here:
23 
24* /etc/ssl/certs/ssl-cert-snakeoil.pem
25* /etc/ssl/private/ssl-cert-snakeoil.key
26 
27Regenerate snakeoil certs, if needed, with the following command:
28 
29.. code-block:: bash
30 
31 sudo make-ssl-cert generate-default-snakeoil --force-overwrite
32 
33Request an internally signed cert
34==================================
35 
36#. :ref:`Generate a private key and CSR <generate-a-private-key-and-csr>`
37#. send an email to Netadmins:
38 
39   * attach the CSR (NOT THE PRIVATE KEY)
40   * provide the domain name desired for certification
41   * ask for an *internally* signed CV CA certificate
42   
43Netadmins will respond back with the certificate.
44 
45   
46Request an externally signed cert
47==================================
48 
49#. :ref:`Generate a private key and CSR <generate-a-private-key-and-csr>`
50#. send an email to Netadmins:
51 
52   * attach the CSR (NOT THE PRIVATE KEY)
53   * provide the domain name desired for certification
54   * ask for an *externally* signed GoDaddy CA certificate
55   
56Netadmins will respond back after procurement with the certificate.
57 
58 
59.. _generate-a-private-key-and-csr:
60 
61Generate a private key and CSR
62==================================
63 
64#. Verify or install openssl package on host
65 
66    Is openssl in your path?
67 
68    .. code-block:: bash
69   
70      which openssl
71    
72    Install openssl if missing:
73 
74    .. code-block:: bash
75    
76      sudo apt-get install openssl
77      
78#. Create a file using the following template.
79 
80   Only the first line in the file (siteName = ) should be altered to match
81   the domain name intended for certification.  The filename should be the
82   domain.to.be.certified.tmpl, for example: secure.foxhop.net.tmpl
83 
84    .. code-block:: ini
85 
86       siteName = secure.foxhop.net
87       r = .
88       
89       [ req ]
90       default_bits = 2048
91       default_keyfile = ${siteName}.key
92       distinguished_name = req_distinguished_name
93       prompt = no
94       
95       [ req_distinguished_name ]
96       C = US
97       ST = CT
98       L = New London
99       O = Foxhop.net
100       OU = Foxhop.net, New London
101       CN = ${siteName}
102 
103#. Generate a private key and a CSR for the host to be certified by using the
104   template that we generated above; For example (secure.foxhop.net):
105 
106    .. code-block:: bash
107 
108     openssl req -new -config secure.foxhop.net.tmpl -out secure.foxhop.net.csr
109 
110  This process will prompt for a passphrase to protect the private key.
111 
112#. Verify that the following files were created:
113  
114   * <domain>.csr
115   * <domain>.key
116 
117#. Store these details in a pass or keepass entry:
118 
119   * document the private key's passphrase in the password field
120   * on the "Advanced" attach the tmpl, csr, key, and crt files
121 
122View the CSR data
123==================================
124 
125We may want to validate the data in a CSR before submission for certification.
126To display a CSR's data to standard out, run the following command:
127 
128.. code-block:: bash
129 
130    openssl req -in secure.foxhop.net.csr -noout -text
131 
132 
133Remove passphrase from a private key
134====================================
135 
136We need to remove the passphrase from the openSSL private key for use in
137deployment; Otherwise everytime the webserver is restarted it will prompt
138for the keys password.
139 
140Example command:
141 
142.. code-block:: bash
143 
144    # make a copy
145    cp secure.foxhop.net.key secure.foxhop.net.key.orig
146    # strip passphrase
147    openssl rsa -in secure.foxhop.net.key.orig -out secure.foxhop.net.key
148    # clean up orig after testing
149    rm secure.foxhop.net.key.orig
150 
151 
152SSL Offloading
153==================================
154 
155SSL Offloading is the practice of using a proxy or load balancer to manage
156the SSL certificates, keys, and sessions for none or many upstream nodes.
157 
158The BigIP is capable of SSL Offloading.  For SSL Offloading to occur we must 
159load our domain's SSL certificate *AND* private key into the BigIP certificate
160store.  
161 
162BigIP would then gain responsibility of creating an SSL tunnel or session betwee
 >n
163the Internet user and the edge of our corporate network. 
164the VIP.
165 
166Optionally the traffic between the VIP and it's upstream nodes
167(internal network) may also be wrapped by SSL.  
168 
169**when should it be used?**
170 
171If we want a central place to configure SSL for a pool of many nodes.
172Netadmins create a BigIP irule to manage SSL communications. The upstream
173nodes could run just plain HTTP (port 80).  Less complicated configuration 
174on each of the webserver nodes.
175 
176**example**
177 
178An example closer to home deploying Pyramid behind nginx proxy.
179Nginx in this case does the SSL Offloading for upstream waitress/paster nodes.
180The communication between users and Nginx could be SSL wrapped while the
181communication between nginx and the upstream waitress/paster nodes could
182remain plain http.  Many times we can get away with this because the paster
183nodes are bound and listening only to localhost, thus "firewalled" from the 
184rest of the network.
185 
186 
187Certificate expiration tracking
188========================================================
189 
190Email Netadmins a certificate and ask them to add it to
191the BigIP for expiration tracking.
192 
193This happens automatically when using `SSL Offloading <#ssl-offloading>`_.
194 
195Definitions
196============
197 
198Transitive Trust
199  A trusts B, B trusts C, therefore A may trust C
200 
201Self-signed Certificate
202  This certificate was signed by the organization who created it.
203 
204Snakeoil Certificate
205 A "snakeoil" self-signed cert is a great example of a singular identity
206 certifying itself.  Outsiders may not trust a snakeoil cert because it lacks
207 is not attached to a domain name. Snakeoil certs are excellent for testing!
208 """I Trust myself"""
209 
210Internally Signed Certificate
211 An "internal" certificate signed by the Classified Ventures (CV)
212 Certificate Authority (CA) provides trust within the company. Employees of
213 CV may trust an internal cert because it has meta-data and is attached to a
214 domain name.  The Internet will not trust an internal cert because the CV CA
215 itself was not certified by a trusted outside identity.  From inside the
216 organization, this is a signed cert.  From outside the organization this 
217 is a self-signed cert. Internal certs are excellent for internal only
218 servers and services!
219 """Employees trust the CV CA, CV CA trusts my-server,
220 therefore employees may trust my-server."""
221 
222externally signed certificate
223 An "external" certificate is signed by a trusted identity outside of the
224 requesting organization.  There are many trusted identities who perform
225 this service.  This is a popular choice among Internet websites because
226 many of the trusted external Certificate Authorities have their keys
227 pre-loaded into web browsers. The pre-loaded key relieves friction on the
228 end-users, they do not need to manually review or install anything.  
229 """You trust XYZ org, XYZ org trusts my-server, therefore you may trust 
230 my-server."""
231 
232private key
233 This is the very sensitive and private portion of the certificate that
234 must remain a secret in order for the SSL wrapped service to remain 
235 secure.