Difference between revisions of "Creating Certificates"

From
Jump to: navigation, search
(Created page with " = <span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:" times="" new="" roman",serif"="">Creating Certificates</span></span></span> = &n...")
 
Line 1: Line 1:
  
= <span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:" times="" new="" roman",serif"="">Creating Certificates</span></span></span> =
+
= <span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:">Creating Certificates</span></span></span> =
  
 
&nbsp;
 
&nbsp;
  
<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:" times="" new="" roman",serif"="">There are several ways to create the certificates needed by the STS. The biggest distinction in the certificates for the purposes of deployment is '''self-signed''' and issued by '''Certificate Authority''' (CA).</span></span></span>
+
<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:">There are several ways to create the certificates needed by the STS. The biggest distinction in the certificates for the purposes of deployment is '''self-signed''' and issued by '''Certificate Authority''' (CA).</span></span></span>
  
 
&nbsp;
 
&nbsp;
  
== <span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:" times="" new="" roman",serif"="">Certificate Authority</span></span></span> ==
+
== <span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:">Certificate Authority</span></span></span> ==
  
 
&nbsp;
 
&nbsp;
  
<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:" times="" new="" roman",serif"="">This is a trusted entity between two or more parties.&nbsp; Organizations may have an internal CA (e.g. Microsoft Certificate Services) for which all internal workstations and servers will accept certificates from.&nbsp; In some cases, external CAs may be used due to the application being public and used by systems that cannot be remotely configured.</span></span></span>
+
<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:">This is a trusted entity between two or more parties.&nbsp; Organizations may have an internal CA (e.g. Microsoft Certificate Services) for which all internal workstations and servers will accept certificates from.&nbsp; In some cases, external CAs may be used due to the application being public and used by systems that cannot be remotely configured.</span></span></span>
  
 
&nbsp;
 
&nbsp;
Line 18: Line 18:
 
&nbsp;
 
&nbsp;
  
&nbsp;
+
== <span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:">Self-Signed</span></span></span> ==
 
 
== <span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:" times="" new="" roman",serif"="">Self-Signed</span></span></span> ==
 
  
 
&nbsp;
 
&nbsp;
  
<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:" times="" new="" roman",serif"="">Self-signed certificates are more appropriate for non-production environments. These can be generated by the administrator locally on the server or using tools (e.g. OpenSSL).</span></span></span>
+
<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:">Self-signed certificates are more appropriate for non-production environments. These can be generated by the administrator locally on the server or using tools (e.g. OpenSSL).</span></span></span>
  
 
&nbsp;
 
&nbsp;
  
<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:" times="" new="" roman",serif"="">The main issue with self-signed certificates is that may not be trusted by the systems using them.&nbsp; For example, in a development environment a self-signed web server certificate may generate warning on the workstations testing the service.&nbsp; Or a service provider may have their login process report errors.&nbsp;</span></span></span>
+
<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:">The main issue with self-signed certificates is that may not be trusted by the systems using them.&nbsp; For example, in a development environment a self-signed web server certificate may generate warning on the workstations testing the service.&nbsp; Or a service provider may have their login process report errors.&nbsp;</span></span></span>
  
 
&nbsp;
 
&nbsp;
  
<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:" times="" new="" roman",serif"="">For the intents of encryption or digital signatures a self-signed certificate is technically valid; i.e. it will protect the data in the expected manner.&nbsp; The primary thing missing is assurance provided by a trusted entity (i.e. the Certificate Authority).</span></span></span>
+
<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:">For the intents of encryption or digital signatures a self-signed certificate is technically valid; i.e. it will protect the data in the expected manner.&nbsp; The primary thing missing is assurance provided by a trusted entity (i.e. the Certificate Authority).</span></span></span>
 
 
&nbsp;
 
  
 
&nbsp;
 
&nbsp;
  
== <span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:" times="" new="" roman",serif"="">Basic Requirements for Certificates</span></span></span> ==
+
== <span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:">Basic Requirements for Certificates</span></span></span> ==
  
 
&nbsp;
 
&nbsp;
  
*<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:" times="" new="" roman",serif"="">The private key should be at least 2048 bits in length; ideally 4096 bits or higher should be used.&nbsp; The longer the key, the more likely it is able to withstand cryptographic attacks.</span></span></span>  
+
*<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:">The private key should be at least 2048 bits in length; ideally 4096 bits or higher should be used.&nbsp; The longer the key, the more likely it is able to withstand cryptographic attacks.</span></span></span>  
*<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:" times="" new="" roman",serif"="">A current hash such as SHA256 or SHA512 should be used.&nbsp; MD5/SHA1 have been deprecated in most implementations.</span></span></span>  
+
*<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:">A current hash such as SHA256 or SHA512 should be used.&nbsp; MD5/SHA1 have been deprecated in most implementations.</span></span></span>  
*<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:" times="" new="" roman",serif"="">The common name for the certificate should be something valid and representative of the service being used.&nbsp; E.g. if the STS development is located at [https://stsdev.hospital.org https://stsdev.hospital.org], then the common name should be “stsdev.hospital.org”.&nbsp; This ensures alignment in the overall configuration of the environment and prevents potential browser errors with mismatched names.</span></span></span>  
+
*<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:">The common name for the certificate should be something valid and representative of the service being used.&nbsp; E.g. if the STS development is located at [https://stsdev.hospital.org https://stsdev.hospital.org], then the common name should be “stsdev.hospital.org”.&nbsp; This ensures alignment in the overall configuration of the environment and prevents potential browser errors with mismatched names.</span></span></span>  
  
 
&nbsp;
 
&nbsp;
  
== <span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:" times="" new="" roman",serif"="">Corporate Encryption Polices</span></span></span> ==
+
== <span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:">Corporate Encryption Polices</span></span></span> ==
  
 
&nbsp;
 
&nbsp;
  
<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:" times="" new="" roman",serif"="">Administrators will typically adhere to certificate management practices as set by internal policies or procedures.&nbsp; These may indicate how certificates can be deployed</span></span></span>
+
<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:">Administrators will typically adhere to certificate management practices as set by internal policies or procedures.&nbsp; These may indicate how certificates can be deployed</span></span></span>
  
 
&nbsp;
 
&nbsp;
  
== <span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:" times="" new="" roman",serif"="">Private Keys</span></span></span> ==
+
== <span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:">Private Keys</span></span></span> ==
  
<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:" times="" new="" roman",serif"="">A private key should never be shared outside of the internal system.&nbsp; Your service provided should never require for you to send them their private key and vice-versa.&nbsp; Once that private key is in the hands of an untrusted party, the security (self-repudiation) of that encryption or signing key is void.</span></span></span>
+
<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:">A private key should never be shared outside of the internal system.&nbsp; Your service provided should never require for you to send them their private key and vice-versa.&nbsp; Once that private key is in the hands of an untrusted party, the security (self-repudiation) of that encryption or signing key is void.</span></span></span>
  
 
&nbsp;
 
&nbsp;
  
<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:" times="" new="" roman",serif"="">Click here what to provide your Service Provider.</span></span></span>
+
<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:">Click here what to provide your Service Provider.</span></span></span>
 
 
&nbsp;
 
  
 
&nbsp;
 
&nbsp;
  
== <span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:" times="" new="" roman",serif"="">Generating a Self-Signed Certificate for SAML Signatures</span></span></span> ==
+
<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:">Generating a Self-Signed Certificate for SAML Signatures</span></span></span>
  
 
&nbsp;
 
&nbsp;
  
<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:" times="" new="" roman",serif"="">For the STS installation, a certificate must be used to digitally sign the SAML assertions.&nbsp; The STS requires access to the private key in order to perform that action.&nbsp;</span></span></span>
+
<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:">For the STS installation, a certificate must be used to digitally sign the SAML assertions.&nbsp; The STS requires access to the private key in order to perform that action.&nbsp;</span></span></span>
  
 
&nbsp;
 
&nbsp;
  
<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:" times="" new="" roman",serif"="">OpenSSL is a great tool to generate certificates, but a quicker way to generate a test or development certificate is to use Onelogin’s SAML Tool: [https://www.samltool.com/self_signed_certs.php https://www.samltool.com/self_signed_certs.php] .</span></span></span>
+
<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:">OpenSSL is a great tool to generate certificates, but a quicker way to generate a test or development certificate is to use [https://www.samltool.com/self_signed_certs.php Onelogin’s SAML Tool]&nbsp;.</span></span></span>
  
 
&nbsp;
 
&nbsp;
  
=== <span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:" times="" new="" roman",serif"="">Steps</span></span></span> ===
+
=== <span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:">Steps</span></span></span> ===
  
 
&nbsp;
 
&nbsp;
  
#<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:" times="" new="" roman",serif"="">Use tool making sure you fill out the common name to match your STS instance, the bit key length of 2048 bits and a SHA256/SHA512 digest.&nbsp; Enter a good password (8-12 characters) and make note of it as it will be required again.</span></span></span>  
+
#<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:">Use tool making sure you fill out the common name to match your STS instance, the bit key length of 2048 bits and a SHA256/SHA512 digest.&nbsp; Enter a good password (8-12 characters) and make note of it as it will be required again.</span></span></span>  
#<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:" times="" new="" roman",serif"="">Copy the generated contents of the “X.509 cert” textbox in a text editor (e.g. Notepad).&nbsp; Save the file with a name of your choice but with a CER extension; e.g. “hospital.cer”.</span></span></span>  
+
#<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:">Copy the generated contents of the “X.509 cert” textbox in a text editor (e.g. Notepad).&nbsp; Save the file with a name of your choice but with a CER extension; e.g. “hospital.cer”.</span></span></span>  
#<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:" times="" new="" roman",serif"="">Copy the generated contents of the “Private Key” textbox in a text editor (e.g. Notepad).&nbsp; Save the file with a name of your choice but with a KEY extension; e.g. “hospital.key” in the same location as the CER file in the previous step.</span></span></span>  
+
#<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:">Copy the generated contents of the “Private Key” textbox in a text editor (e.g. Notepad).&nbsp; Save the file with a name of your choice but with a KEY extension; e.g. “hospital.key” in the same location as the CER file in the previous step.</span></span></span>  
#<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:" times="" new="" roman",serif"="">You now need to generate a PFX (PKCS #12) that Windows server and the STS can process.&nbsp; Download and install OpenSSL (https://slproweb.com/products/Win32OpenSSL.html)&nbsp; .</span></span></span>  
+
#<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:">You now need to generate a PFX (PKCS #12) that Windows server and the STS can process.&nbsp; Download and install.</span></span></span>  
#<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:" times="" new="" roman",serif"="">From the OpenSSL command prompt navigate to the folder where you stored your CER and KEY files.</span></span></span>  
+
#<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:">From the OpenSSL command prompt navigate to the folder where you stored your CER and KEY files.</span></span></span>  
#<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:" times="" new="" roman",serif"="">Enter the following command: “openssl pkcs12 -export -out hospital.pfx -inkey hospital.key -in hospital.cer”.</span></span></span>  
+
#<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:">Enter the following command: “openssl pkcs12 -export -out hospital.pfx -inkey hospital.key -in hospital.cer”.</span></span></span>  
#<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:" times="" new="" roman",serif"="">You will be prompted for the password from step 1 as well requested to enter a new password to protect the PFX file.</span></span></span>
+
#<span style="line-height:normal"><span style="font-size:12.0pt"><span style="font-family:">You will be prompted for the password from step 1 as well requested to enter a new password to protect the PFX file.</span></span></span>

Revision as of 08:44, 28 August 2020

Creating Certificates

 

There are several ways to create the certificates needed by the STS. The biggest distinction in the certificates for the purposes of deployment is self-signed and issued by Certificate Authority (CA).

 

Certificate Authority

 

This is a trusted entity between two or more parties.  Organizations may have an internal CA (e.g. Microsoft Certificate Services) for which all internal workstations and servers will accept certificates from.  In some cases, external CAs may be used due to the application being public and used by systems that cannot be remotely configured.

 

 

Self-Signed

 

Self-signed certificates are more appropriate for non-production environments. These can be generated by the administrator locally on the server or using tools (e.g. OpenSSL).

 

The main issue with self-signed certificates is that may not be trusted by the systems using them.  For example, in a development environment a self-signed web server certificate may generate warning on the workstations testing the service.  Or a service provider may have their login process report errors. 

 

For the intents of encryption or digital signatures a self-signed certificate is technically valid; i.e. it will protect the data in the expected manner.  The primary thing missing is assurance provided by a trusted entity (i.e. the Certificate Authority).

 

Basic Requirements for Certificates

 

  • The private key should be at least 2048 bits in length; ideally 4096 bits or higher should be used.  The longer the key, the more likely it is able to withstand cryptographic attacks.
  • A current hash such as SHA256 or SHA512 should be used.  MD5/SHA1 have been deprecated in most implementations.
  • The common name for the certificate should be something valid and representative of the service being used.  E.g. if the STS development is located at https://stsdev.hospital.org, then the common name should be “stsdev.hospital.org”.  This ensures alignment in the overall configuration of the environment and prevents potential browser errors with mismatched names.

 

Corporate Encryption Polices

 

Administrators will typically adhere to certificate management practices as set by internal policies or procedures.  These may indicate how certificates can be deployed

 

Private Keys

A private key should never be shared outside of the internal system.  Your service provided should never require for you to send them their private key and vice-versa.  Once that private key is in the hands of an untrusted party, the security (self-repudiation) of that encryption or signing key is void.

 

Click here what to provide your Service Provider.

 

Generating a Self-Signed Certificate for SAML Signatures

 

For the STS installation, a certificate must be used to digitally sign the SAML assertions.  The STS requires access to the private key in order to perform that action. 

 

OpenSSL is a great tool to generate certificates, but a quicker way to generate a test or development certificate is to use Onelogin’s SAML Tool .

 

Steps

 

  1. Use tool making sure you fill out the common name to match your STS instance, the bit key length of 2048 bits and a SHA256/SHA512 digest.  Enter a good password (8-12 characters) and make note of it as it will be required again.
  2. Copy the generated contents of the “X.509 cert” textbox in a text editor (e.g. Notepad).  Save the file with a name of your choice but with a CER extension; e.g. “hospital.cer”.
  3. Copy the generated contents of the “Private Key” textbox in a text editor (e.g. Notepad).  Save the file with a name of your choice but with a KEY extension; e.g. “hospital.key” in the same location as the CER file in the previous step.
  4. You now need to generate a PFX (PKCS #12) that Windows server and the STS can process.  Download and install.
  5. From the OpenSSL command prompt navigate to the folder where you stored your CER and KEY files.
  6. Enter the following command: “openssl pkcs12 -export -out hospital.pfx -inkey hospital.key -in hospital.cer”.
  7. You will be prompted for the password from step 1 as well requested to enter a new password to protect the PFX file.