<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>article Advanced SAML Security: One App per certificate in Workforce Identity Articles</title>
    <link>https://live.paloaltonetworks.com/t5/workforce-identity-articles/advanced-saml-security-one-app-per-certificate/ta-p/1428653</link>
    <description>Security in SAML is ultimately a trust relationship that is built around the use of a Certificate or multiple Certificates. This article will instruct the Identity Administrator on how to generate a unique certificate so that each application has its own certificate instead of using a single certificate for the tenant.&lt;BR /&gt;&lt;BR /&gt;The private key of your default issued signing certificate is not visible to you as the administrator through the GUI or through API access. The expiration of this default certificate is also 10 years from account creation and so you have a very large window before you are forced to update service providers.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Author: Kevin Creason

&lt;H3&gt;Steps&lt;/H3&gt;
&lt;H2&gt;Why?&amp;nbsp;&lt;/H2&gt;
&lt;P&gt;So why would you want to go through these steps of creating and using multiple signing certificates? There are many reasons, and they can be summarized along these lines –&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;&lt;LI&gt;
&lt;P&gt;Unique certs can provide Trust and Assurance to both parties. By generating a unique certificate per application, we can provide the security conscious Identity administrator and the Service Provider administrator with a higher level of assurance at trusting the SAML relationship. The certificate used is for one relationship, one service provider.&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;&lt;LI&gt;
&lt;P&gt;Revalidation of Trust relationships – using unique certificates and unique expirations can be used as a means of revalidating a service provider relationship by involving administrative actions to change the certificate. Do you plan to retire this application next year and replace it with app Xyz? Set the expiration to 12 months, you will guarantee admins need to review and reconfigure.&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;&lt;LI&gt;
&lt;P&gt;Timing of Expirations – SSL certificates used for websites are now mandated to expire at 13 months so that we have greater trust that the site we are visiting is maintained and is who they were. These same controls do not necessarily apply to the signing certificates for SAML trust (hence the 10-year initial certificate), but it is possible that these controls may be important to an organization.&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;&lt;LI&gt;
&lt;P&gt;Balancing Replacement cycle – when a certificate is expiring, whether it is 10 years or 1 year after being generated, the replacement must be coordinated between IDP and SP at the same time or the assertion will not be valid. If you are generating a new certificate for each application as you start that application, you will be spacing out the replacement window using the same gap of time as you have added applications. This is often a good deal more convenient than attempting to complete hundreds of apps in a brief period because they were using a single certificate that is expiring.&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Before we jump into the How, let us cover a little background information first.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The certificate is used to sign the SAML Assertion so that the Service Provider can validate the data and trust that it came from your Identity Provider (Idira Identity). The Service Provider may not require their own certificate to validate the signature, but if encryption has been enabled, they will need their own unique certificate.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are two fundamental truths about certificates and keys that must always be kept forefront of your mind when dealing with certificates--&amp;nbsp;&lt;/P&gt;
&lt;OL start="1"&gt;&lt;LI&gt;
&lt;P&gt;The certificate can be visible or shared publicly. For this reason, it is sometimes referred to as the Public Certificate.&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;&lt;/OL&gt;
&lt;OL start="2"&gt;&lt;LI&gt;
&lt;P&gt;A key is another half of the certificate and should always be private, never shared. For this reason, it is sometimes referred to as a private key. If someone were to get access to the private key, they would be able to use the public certificate as if they were the original holder of the certificate, there would be nothing to indicate anything to the contrary.&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;A third item which is up for debate among some circles is the Certificate Authority. The prevailing consensus is that since SAML signing (and encryption) is not required to be trusted by the client browser that we can use self-signed certificates for signing, and not be required to use a trusted Certificate Authority. This can avoid a monetary and time cost in dealing with trusted CAs and allow the administrator to create unique certificates per application—unique private key, unique signing authority, and unique certificate. This article will focus on using self-signing, but some steps will be valid for those parties using a trusted CA.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When something is being digitally signed, the signing entity is using their private key and public certificate and generating a hash of the object being signed. Anyone can then obtain the public certificate and validate this signature was completed by someone with the private and non-public key.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively, if we want to restrict the contents so that only the intended audience can see the data, we must enable encryption. To do this we not only need our own private key and public certificate, but we also require a public certificate from the intended or target consumer (service provider). This means that the target consumer must have their private key, public certificate, and a copy of our public certificate. No one's private key is ever exchanged, the private key should remain protected and never shared, only public certificates are exchanged.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The encryption level is rarely utilized in SAML relationships. The SAML conversation traverses through the client browser and should be restricted to TLS 1.2 or better HTTPS connections. This controls and limits prying eyes, but at times the additional level of protection provided by encryption may be desired.&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;How&amp;nbsp;&lt;/H2&gt;
&lt;P&gt;The Idira Identity administrator UI does not yet provide you with the means to generate a new signing certificate in the browser. This feature is planned, but until this feature is released you must generate a certificate and key pair using external means and upload to Identity.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This external generation and uploading are the moment where you are most vulnerable! Protect the private key you generated with the highest security you can, and securely destroy it after you have uploaded it.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"Destroy it?", I can hear you say.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes! What better security than to completely delete the record of the private key once it has been loaded into your secure Idira tenant. You will not need this private key ever again. Only Idira needs the key to sign or encrypt the data for the SAML Assertion.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We will provide two mechanisms that can be used to generate the cert pair suitable for uploading. You need only do one of these sections that is easiest for you to use.&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;OpenSSL (Any OS)&amp;nbsp;&lt;/H2&gt;
&lt;P&gt;You can use OpenSSL on any platform and simply copy these commands to a suitable command line interface. A MacOS device and Linux system will likely already have this utility installed and they should execute and provide the output file needed for uploading to Idira Identity.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The following commands will generate a new self-signed certificate, key, and then a PFX file containing both. The PFX will have no password running this command. Destroy the key file and the unprotected PFX immediately after uploading.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, note, the name used in the "SAMLNAME" is used for the certificate name and the output file without requiring any CLI conversion utilities which may be OS dependent, so avoid unsafe filename characters. This keeps the example short and sweet and extremely generic, but this could be easily scripted for your platform to give you more versatility, similar to the PowerShell example in this doc.&amp;nbsp;&lt;/P&gt;
&lt;PRE class="ckeditor_codeblock"&gt;
SAMLNAME="SAML-App-XYZ_20240130"&amp;nbsp;
openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes -keyout $SAMLNAME.key -out $SAMLNAME.crt -subj "/CN=$SAMLNAME"&amp;nbsp;
openssl pkcs12 -export -inkey $SAMLNAME.key -in $SAMLNAME.crt -out $SAMLNAME.pfx -name "$SAMLNAME " -password pass:&amp;nbsp;
&lt;/PRE&gt;
&lt;P&gt;The key and certificate options you may interested in tweaking with each run, besides the SAMLNAME variable are as follows:&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;&lt;LI&gt;
&lt;P&gt;"rsa:4096" – this is both the key type and the key length. You may have some service providers that cannot handle 4096, so the highest you could go would be only 2048.&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;&lt;LI&gt;
&lt;P&gt;"-sha256" – this is the certificate algorithm; you may have some Service Providers that may only support SHA1&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;&lt;LI&gt;
&lt;P&gt;"-days 3650" – this is the number of days until expiration.&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Do not forget to destroy your unprotected private key and PFX file after you have uploaded it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;PowerShell (Windows)&amp;nbsp;&lt;/H2&gt;
&lt;P&gt;Your Windows device should have PowerShell available. The commands do not require elevated privilege, but it is possible that unique controls may block either PowerShell or some modules from you. Consult with the relevant team at your organization if this is the case.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The PowerShell script below will generate a self-signed certificate into your local personal cert store on the Windows system. It will then export the key and certificate into a PKCS12 PFX file that is password protected and can be uploaded into Idira Identity.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Both the cert-key pair in the keystore and the PFX file have some security built in but are still considered weak security. You should consider deleting both objects after the PFX file has been uploaded to Identity. The PFX file will be located in the directory where you run the script.&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;Script&amp;nbsp;&lt;/H2&gt;
&lt;PRE class="ckeditor_codeblock"&gt;
&amp;lt;#
.SYNOPSIS
Self&amp;nbsp;Signed&amp;nbsp;Certificate&amp;nbsp;Automator

.DESCRIPTION
use&amp;nbsp;CLI&amp;nbsp;options&amp;nbsp;to&amp;nbsp;specify&amp;nbsp;options&amp;nbsp;or&amp;nbsp;it&amp;nbsp;will&amp;nbsp;take&amp;nbsp;defaults

.PARAMETER&amp;nbsp;debug
Set&amp;nbsp;debug&amp;nbsp;level&amp;nbsp;for&amp;nbsp;extra&amp;nbsp;info

.PARAMETER&amp;nbsp;months
How&amp;nbsp;many&amp;nbsp;months&amp;nbsp;cert&amp;nbsp;will&amp;nbsp;be&amp;nbsp;good&amp;nbsp;for,&amp;nbsp;default&amp;nbsp;24

.PARAMETER&amp;nbsp;name
The&amp;nbsp;name&amp;nbsp;and&amp;nbsp;subject&amp;nbsp;of&amp;nbsp;the&amp;nbsp;cert

.PARAMETER&amp;nbsp;keylength
The&amp;nbsp;private&amp;nbsp;key&amp;nbsp;length,&amp;nbsp;4096&amp;nbsp;is&amp;nbsp;better,&amp;nbsp;2048&amp;nbsp;common

.PARAMETER&amp;nbsp;keyalg
The&amp;nbsp;private&amp;nbsp;key&amp;nbsp;algorhithm,&amp;nbsp;RSA&amp;nbsp;default

.PARAMETER&amp;nbsp;hashalg
The&amp;nbsp;hashing&amp;nbsp;algorithm,&amp;nbsp;SHA256&amp;nbsp;recommended,&amp;nbsp;sha1&amp;nbsp;is&amp;nbsp;sometimes&amp;nbsp;needed&amp;nbsp;but&amp;nbsp;less&amp;nbsp;secure.

.PARAMETER&amp;nbsp;exppass
The&amp;nbsp;exported&amp;nbsp;file&amp;nbsp;password


.EXAMPLE
PS&amp;gt;&amp;nbsp;cert-automator.ps1&amp;nbsp;-debug&amp;nbsp;2&amp;nbsp;-name&amp;nbsp;"SAML&amp;nbsp;App&amp;nbsp;Xyz"&amp;nbsp;-months&amp;nbsp;36&amp;nbsp;-keylength&amp;nbsp;4096&amp;nbsp;-exppass&amp;nbsp;"3xp000rtP@ssw0rd"

PS&amp;gt;&amp;nbsp;cert-automator.ps1&amp;nbsp;-debug&amp;nbsp;2&amp;nbsp;-name&amp;nbsp;"SAML&amp;nbsp;App&amp;nbsp;Pdq"

PS&amp;gt;&amp;nbsp;cert-automator.ps1&amp;nbsp;-debug&amp;nbsp;2&amp;nbsp;

#&amp;gt;

#&amp;nbsp;This&amp;nbsp;is&amp;nbsp;where&amp;nbsp;we&amp;nbsp;define&amp;nbsp;the&amp;nbsp;command&amp;nbsp;line&amp;nbsp;defaults.&amp;nbsp;These&amp;nbsp;can&amp;nbsp;be&amp;nbsp;updated&amp;nbsp;if&amp;nbsp;you&amp;nbsp;do&amp;nbsp;not&amp;nbsp;want&amp;nbsp;to&amp;nbsp;specify&amp;nbsp;them&amp;nbsp;at&amp;nbsp;run&amp;nbsp;time
param&amp;nbsp;(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[int]$months&amp;nbsp;=&amp;nbsp;24,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[int]$keylength&amp;nbsp;=&amp;nbsp;4096,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[string]$name&amp;nbsp;=&amp;nbsp;"saml-cert",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[string]$exppass&amp;nbsp;=&amp;nbsp;"export-password",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[string]$keyalg&amp;nbsp;="RSA",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[string]$hashalg&amp;nbsp;=&amp;nbsp;"SHA256",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[int]$debug&amp;nbsp;=&amp;nbsp;"3"
&amp;nbsp;)

&amp;nbsp;#&amp;nbsp;Function&amp;nbsp;to&amp;nbsp;clean&amp;nbsp;up&amp;nbsp;the&amp;nbsp;saml&amp;nbsp;cert&amp;nbsp;name&amp;nbsp;to&amp;nbsp;use&amp;nbsp;for&amp;nbsp;the&amp;nbsp;output&amp;nbsp;file
&amp;nbsp;Function&amp;nbsp;NameToFileName&amp;nbsp;{
&amp;nbsp;&amp;nbsp;param(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[Parameter(Mandatory=$true,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Position=0,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ValueFromPipeline=$true,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ValueFromPipelineByPropertyName=$true)]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[String]$Name
&amp;nbsp;&amp;nbsp;)
&amp;nbsp;&amp;nbsp;$invalidChars&amp;nbsp;=&amp;nbsp;[IO.Path]::GetInvalidFileNameChars()&amp;nbsp;-join&amp;nbsp;''
&amp;nbsp;&amp;nbsp;$invalidChars&amp;nbsp;=&amp;nbsp;$invalidChars+"&amp;nbsp;"+'%'+'$'+'@'+','+'.'+"'"
&amp;nbsp;&amp;nbsp;$re&amp;nbsp;=&amp;nbsp;"[{0}]"&amp;nbsp;-f&amp;nbsp;[RegEx]::Escape($invalidChars)
&amp;nbsp;&amp;nbsp;return&amp;nbsp;($Name&amp;nbsp;-replace&amp;nbsp;$re)
}

#&amp;nbsp;Default&amp;nbsp;Values&amp;nbsp;for&amp;nbsp;the&amp;nbsp;actual&amp;nbsp;certificate
&amp;nbsp;$params&amp;nbsp;=&amp;nbsp;@{&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;Type&amp;nbsp;=&amp;nbsp;'Custom'
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Subject&amp;nbsp;=&amp;nbsp;$name&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;KeyAlgorithm&amp;nbsp;=&amp;nbsp;$keyalg
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;KeyLength&amp;nbsp;=&amp;nbsp;$keylength
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;HashAlgorithm&amp;nbsp;=&amp;nbsp;$hashalg
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SmimeCapabilities&amp;nbsp;=&amp;nbsp;$true
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CertStoreLocation&amp;nbsp;=&amp;nbsp;'Cert:\CurrentUser\My'
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;NotAfter&amp;nbsp;=&amp;nbsp;(Get-Date).AddMonths($months)
}

$NewCert&amp;nbsp;=&amp;nbsp;New-SelfsignedCertificate&amp;nbsp;@params
$output&amp;nbsp;=&amp;nbsp;NameToFileName($name)
$PFXpass&amp;nbsp;=&amp;nbsp;ConvertTo-SecureString&amp;nbsp;-String&amp;nbsp;$exppass&amp;nbsp;-Force&amp;nbsp;-AsPlainText
Export-PfxCertificate&amp;nbsp;-Cert&amp;nbsp;$NewCert&amp;nbsp;-Filepath&amp;nbsp;".\$output.pfx"&amp;nbsp;-Password&amp;nbsp;$PFXpass
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;Running the Script&amp;nbsp;&lt;/H2&gt;
&lt;P&gt;The script is designed so that you can run it from the command line and specify unique options each time but otherwise use some pre-defined options. You can also use the PowerShell "get-help" option to see execution tips:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="ka3Ht0000009XMnIAM__eid=ka3Ht0000009XMn&amp;amp;feoid=00N2J000009R3kv&amp;amp;refid=0EMHt000006jvHq.png"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/98596iD1856B373EAD03C9/image-size/large?v=v2&amp;amp;px=999" role="button" title="ka3Ht0000009XMnIAM__eid=ka3Ht0000009XMn&amp;amp;feoid=00N2J000009R3kv&amp;amp;refid=0EMHt000006jvHq.png" alt="ka3Ht0000009XMnIAM__eid=ka3Ht0000009XMn&amp;amp;feoid=00N2J000009R3kv&amp;amp;refid=0EMHt000006jvHq.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively, you can load the script into the ISE, edit param lines for each run, and click the Play icon to generate a unique certificate content.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="ka3Ht0000009XMnIAM__eid=ka3Ht0000009XMn&amp;amp;feoid=00N2J000009R3kv&amp;amp;refid=0EMHt000006jvHv.png"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/98597i3F0EA664292B762B/image-size/large?v=v2&amp;amp;px=999" role="button" title="ka3Ht0000009XMnIAM__eid=ka3Ht0000009XMn&amp;amp;feoid=00N2J000009R3kv&amp;amp;refid=0EMHt000006jvHv.png" alt="ka3Ht0000009XMnIAM__eid=ka3Ht0000009XMn&amp;amp;feoid=00N2J000009R3kv&amp;amp;refid=0EMHt000006jvHv.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After… and Beyond&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After you have completed the steps of generating a new private key, using it for a self-signed certificate, and combined it into a PKCS12/PFX file for uploading… now what?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At this point you are ready to use the Idira Identity standard Administrator interface fully documented &lt;A href="https://mcas-proxyweb.mcas.ms/certificate-checker?login=false&amp;amp;originalUrl=https%3A%2F%2Fdocs.cyberark.com.mcas.ms%2FIdaptive%2FLatest%2Fen%2FContent%2FCoreServices%2FAuthenticate%2FSignCertsManage.htm%3Ftocpath%3DAdministrator%257CConfigure%2520MFA%257CManage%2520tenant%2520signing%2520certificates%257C_____0%26McasTsid%3D15600&amp;amp;McasCSRF=538a65e0a31c04569905836bf772ded4e15015f160bd00e48c8cd150f3c38ea7" target="_blank"&gt;here&lt;/A&gt;. You will use the "Add a signing certificate" option, in addition to the other management steps. This upload step may be skipped if you prefer to upload it during the web app configuration in the Manual Configuration.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A suggested order of operations could be, but is not strictly necessary to follow this order:&amp;nbsp;&lt;/P&gt;
&lt;OL start="1"&gt;&lt;LI&gt;
&lt;P&gt;Add new Web App in Identity&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;&lt;/OL&gt;
&lt;OL start="2"&gt;&lt;LI&gt;
&lt;P&gt;Configure Web App in Identity and on the Trust "Identity Provider Configuration" page you can select the desired previously uploaded certificate, or use option "Upload New Signing Certificate" (and then delete the PFX)&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;&lt;/OL&gt;
&lt;OL start="3"&gt;&lt;LI&gt;
&lt;P&gt;Exchange the public certificate and SAML metadata with Service Provider&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;&lt;/OL&gt;
&lt;OL start="4"&gt;&lt;LI&gt;
&lt;P&gt;Relax, sip your coffee or other beverage of choice, and continue to monitor the security of your organization&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;&lt;/OL&gt;</description>
    <pubDate>Thu, 05 Nov 2026 19:59:23 GMT</pubDate>
    <dc:creator>CyberArkAlumni</dc:creator>
    <dc:date>2026-11-05T19:59:23Z</dc:date>
    <item>
      <title>Advanced SAML Security: One App per certificate</title>
      <link>https://live.paloaltonetworks.com/t5/workforce-identity-articles/advanced-saml-security-one-app-per-certificate/ta-p/1428653</link>
      <description>Security in SAML is ultimately a trust relationship that is built around the use of a Certificate or multiple Certificates. This article will instruct the Identity Administrator on how to generate a unique certificate so that each application has its own certificate instead of using a single certificate for the tenant.&lt;BR /&gt;&lt;BR /&gt;The private key of your default issued signing certificate is not visible to you as the administrator through the GUI or through API access. The expiration of this default certificate is also 10 years from account creation and so you have a very large window before you are forced to update service providers.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Author: Kevin Creason

&lt;H3&gt;Steps&lt;/H3&gt;
&lt;H2&gt;Why?&amp;nbsp;&lt;/H2&gt;
&lt;P&gt;So why would you want to go through these steps of creating and using multiple signing certificates? There are many reasons, and they can be summarized along these lines –&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;&lt;LI&gt;
&lt;P&gt;Unique certs can provide Trust and Assurance to both parties. By generating a unique certificate per application, we can provide the security conscious Identity administrator and the Service Provider administrator with a higher level of assurance at trusting the SAML relationship. The certificate used is for one relationship, one service provider.&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;&lt;LI&gt;
&lt;P&gt;Revalidation of Trust relationships – using unique certificates and unique expirations can be used as a means of revalidating a service provider relationship by involving administrative actions to change the certificate. Do you plan to retire this application next year and replace it with app Xyz? Set the expiration to 12 months, you will guarantee admins need to review and reconfigure.&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;&lt;LI&gt;
&lt;P&gt;Timing of Expirations – SSL certificates used for websites are now mandated to expire at 13 months so that we have greater trust that the site we are visiting is maintained and is who they were. These same controls do not necessarily apply to the signing certificates for SAML trust (hence the 10-year initial certificate), but it is possible that these controls may be important to an organization.&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;&lt;LI&gt;
&lt;P&gt;Balancing Replacement cycle – when a certificate is expiring, whether it is 10 years or 1 year after being generated, the replacement must be coordinated between IDP and SP at the same time or the assertion will not be valid. If you are generating a new certificate for each application as you start that application, you will be spacing out the replacement window using the same gap of time as you have added applications. This is often a good deal more convenient than attempting to complete hundreds of apps in a brief period because they were using a single certificate that is expiring.&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Before we jump into the How, let us cover a little background information first.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The certificate is used to sign the SAML Assertion so that the Service Provider can validate the data and trust that it came from your Identity Provider (Idira Identity). The Service Provider may not require their own certificate to validate the signature, but if encryption has been enabled, they will need their own unique certificate.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are two fundamental truths about certificates and keys that must always be kept forefront of your mind when dealing with certificates--&amp;nbsp;&lt;/P&gt;
&lt;OL start="1"&gt;&lt;LI&gt;
&lt;P&gt;The certificate can be visible or shared publicly. For this reason, it is sometimes referred to as the Public Certificate.&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;&lt;/OL&gt;
&lt;OL start="2"&gt;&lt;LI&gt;
&lt;P&gt;A key is another half of the certificate and should always be private, never shared. For this reason, it is sometimes referred to as a private key. If someone were to get access to the private key, they would be able to use the public certificate as if they were the original holder of the certificate, there would be nothing to indicate anything to the contrary.&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;A third item which is up for debate among some circles is the Certificate Authority. The prevailing consensus is that since SAML signing (and encryption) is not required to be trusted by the client browser that we can use self-signed certificates for signing, and not be required to use a trusted Certificate Authority. This can avoid a monetary and time cost in dealing with trusted CAs and allow the administrator to create unique certificates per application—unique private key, unique signing authority, and unique certificate. This article will focus on using self-signing, but some steps will be valid for those parties using a trusted CA.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When something is being digitally signed, the signing entity is using their private key and public certificate and generating a hash of the object being signed. Anyone can then obtain the public certificate and validate this signature was completed by someone with the private and non-public key.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively, if we want to restrict the contents so that only the intended audience can see the data, we must enable encryption. To do this we not only need our own private key and public certificate, but we also require a public certificate from the intended or target consumer (service provider). This means that the target consumer must have their private key, public certificate, and a copy of our public certificate. No one's private key is ever exchanged, the private key should remain protected and never shared, only public certificates are exchanged.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The encryption level is rarely utilized in SAML relationships. The SAML conversation traverses through the client browser and should be restricted to TLS 1.2 or better HTTPS connections. This controls and limits prying eyes, but at times the additional level of protection provided by encryption may be desired.&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;How&amp;nbsp;&lt;/H2&gt;
&lt;P&gt;The Idira Identity administrator UI does not yet provide you with the means to generate a new signing certificate in the browser. This feature is planned, but until this feature is released you must generate a certificate and key pair using external means and upload to Identity.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This external generation and uploading are the moment where you are most vulnerable! Protect the private key you generated with the highest security you can, and securely destroy it after you have uploaded it.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"Destroy it?", I can hear you say.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes! What better security than to completely delete the record of the private key once it has been loaded into your secure Idira tenant. You will not need this private key ever again. Only Idira needs the key to sign or encrypt the data for the SAML Assertion.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We will provide two mechanisms that can be used to generate the cert pair suitable for uploading. You need only do one of these sections that is easiest for you to use.&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;OpenSSL (Any OS)&amp;nbsp;&lt;/H2&gt;
&lt;P&gt;You can use OpenSSL on any platform and simply copy these commands to a suitable command line interface. A MacOS device and Linux system will likely already have this utility installed and they should execute and provide the output file needed for uploading to Idira Identity.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The following commands will generate a new self-signed certificate, key, and then a PFX file containing both. The PFX will have no password running this command. Destroy the key file and the unprotected PFX immediately after uploading.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, note, the name used in the "SAMLNAME" is used for the certificate name and the output file without requiring any CLI conversion utilities which may be OS dependent, so avoid unsafe filename characters. This keeps the example short and sweet and extremely generic, but this could be easily scripted for your platform to give you more versatility, similar to the PowerShell example in this doc.&amp;nbsp;&lt;/P&gt;
&lt;PRE class="ckeditor_codeblock"&gt;
SAMLNAME="SAML-App-XYZ_20240130"&amp;nbsp;
openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes -keyout $SAMLNAME.key -out $SAMLNAME.crt -subj "/CN=$SAMLNAME"&amp;nbsp;
openssl pkcs12 -export -inkey $SAMLNAME.key -in $SAMLNAME.crt -out $SAMLNAME.pfx -name "$SAMLNAME " -password pass:&amp;nbsp;
&lt;/PRE&gt;
&lt;P&gt;The key and certificate options you may interested in tweaking with each run, besides the SAMLNAME variable are as follows:&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;&lt;LI&gt;
&lt;P&gt;"rsa:4096" – this is both the key type and the key length. You may have some service providers that cannot handle 4096, so the highest you could go would be only 2048.&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;&lt;LI&gt;
&lt;P&gt;"-sha256" – this is the certificate algorithm; you may have some Service Providers that may only support SHA1&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;&lt;LI&gt;
&lt;P&gt;"-days 3650" – this is the number of days until expiration.&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Do not forget to destroy your unprotected private key and PFX file after you have uploaded it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;PowerShell (Windows)&amp;nbsp;&lt;/H2&gt;
&lt;P&gt;Your Windows device should have PowerShell available. The commands do not require elevated privilege, but it is possible that unique controls may block either PowerShell or some modules from you. Consult with the relevant team at your organization if this is the case.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The PowerShell script below will generate a self-signed certificate into your local personal cert store on the Windows system. It will then export the key and certificate into a PKCS12 PFX file that is password protected and can be uploaded into Idira Identity.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Both the cert-key pair in the keystore and the PFX file have some security built in but are still considered weak security. You should consider deleting both objects after the PFX file has been uploaded to Identity. The PFX file will be located in the directory where you run the script.&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;Script&amp;nbsp;&lt;/H2&gt;
&lt;PRE class="ckeditor_codeblock"&gt;
&amp;lt;#
.SYNOPSIS
Self&amp;nbsp;Signed&amp;nbsp;Certificate&amp;nbsp;Automator

.DESCRIPTION
use&amp;nbsp;CLI&amp;nbsp;options&amp;nbsp;to&amp;nbsp;specify&amp;nbsp;options&amp;nbsp;or&amp;nbsp;it&amp;nbsp;will&amp;nbsp;take&amp;nbsp;defaults

.PARAMETER&amp;nbsp;debug
Set&amp;nbsp;debug&amp;nbsp;level&amp;nbsp;for&amp;nbsp;extra&amp;nbsp;info

.PARAMETER&amp;nbsp;months
How&amp;nbsp;many&amp;nbsp;months&amp;nbsp;cert&amp;nbsp;will&amp;nbsp;be&amp;nbsp;good&amp;nbsp;for,&amp;nbsp;default&amp;nbsp;24

.PARAMETER&amp;nbsp;name
The&amp;nbsp;name&amp;nbsp;and&amp;nbsp;subject&amp;nbsp;of&amp;nbsp;the&amp;nbsp;cert

.PARAMETER&amp;nbsp;keylength
The&amp;nbsp;private&amp;nbsp;key&amp;nbsp;length,&amp;nbsp;4096&amp;nbsp;is&amp;nbsp;better,&amp;nbsp;2048&amp;nbsp;common

.PARAMETER&amp;nbsp;keyalg
The&amp;nbsp;private&amp;nbsp;key&amp;nbsp;algorhithm,&amp;nbsp;RSA&amp;nbsp;default

.PARAMETER&amp;nbsp;hashalg
The&amp;nbsp;hashing&amp;nbsp;algorithm,&amp;nbsp;SHA256&amp;nbsp;recommended,&amp;nbsp;sha1&amp;nbsp;is&amp;nbsp;sometimes&amp;nbsp;needed&amp;nbsp;but&amp;nbsp;less&amp;nbsp;secure.

.PARAMETER&amp;nbsp;exppass
The&amp;nbsp;exported&amp;nbsp;file&amp;nbsp;password


.EXAMPLE
PS&amp;gt;&amp;nbsp;cert-automator.ps1&amp;nbsp;-debug&amp;nbsp;2&amp;nbsp;-name&amp;nbsp;"SAML&amp;nbsp;App&amp;nbsp;Xyz"&amp;nbsp;-months&amp;nbsp;36&amp;nbsp;-keylength&amp;nbsp;4096&amp;nbsp;-exppass&amp;nbsp;"3xp000rtP@ssw0rd"

PS&amp;gt;&amp;nbsp;cert-automator.ps1&amp;nbsp;-debug&amp;nbsp;2&amp;nbsp;-name&amp;nbsp;"SAML&amp;nbsp;App&amp;nbsp;Pdq"

PS&amp;gt;&amp;nbsp;cert-automator.ps1&amp;nbsp;-debug&amp;nbsp;2&amp;nbsp;

#&amp;gt;

#&amp;nbsp;This&amp;nbsp;is&amp;nbsp;where&amp;nbsp;we&amp;nbsp;define&amp;nbsp;the&amp;nbsp;command&amp;nbsp;line&amp;nbsp;defaults.&amp;nbsp;These&amp;nbsp;can&amp;nbsp;be&amp;nbsp;updated&amp;nbsp;if&amp;nbsp;you&amp;nbsp;do&amp;nbsp;not&amp;nbsp;want&amp;nbsp;to&amp;nbsp;specify&amp;nbsp;them&amp;nbsp;at&amp;nbsp;run&amp;nbsp;time
param&amp;nbsp;(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[int]$months&amp;nbsp;=&amp;nbsp;24,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[int]$keylength&amp;nbsp;=&amp;nbsp;4096,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[string]$name&amp;nbsp;=&amp;nbsp;"saml-cert",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[string]$exppass&amp;nbsp;=&amp;nbsp;"export-password",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[string]$keyalg&amp;nbsp;="RSA",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[string]$hashalg&amp;nbsp;=&amp;nbsp;"SHA256",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[int]$debug&amp;nbsp;=&amp;nbsp;"3"
&amp;nbsp;)

&amp;nbsp;#&amp;nbsp;Function&amp;nbsp;to&amp;nbsp;clean&amp;nbsp;up&amp;nbsp;the&amp;nbsp;saml&amp;nbsp;cert&amp;nbsp;name&amp;nbsp;to&amp;nbsp;use&amp;nbsp;for&amp;nbsp;the&amp;nbsp;output&amp;nbsp;file
&amp;nbsp;Function&amp;nbsp;NameToFileName&amp;nbsp;{
&amp;nbsp;&amp;nbsp;param(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[Parameter(Mandatory=$true,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Position=0,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ValueFromPipeline=$true,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ValueFromPipelineByPropertyName=$true)]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[String]$Name
&amp;nbsp;&amp;nbsp;)
&amp;nbsp;&amp;nbsp;$invalidChars&amp;nbsp;=&amp;nbsp;[IO.Path]::GetInvalidFileNameChars()&amp;nbsp;-join&amp;nbsp;''
&amp;nbsp;&amp;nbsp;$invalidChars&amp;nbsp;=&amp;nbsp;$invalidChars+"&amp;nbsp;"+'%'+'$'+'@'+','+'.'+"'"
&amp;nbsp;&amp;nbsp;$re&amp;nbsp;=&amp;nbsp;"[{0}]"&amp;nbsp;-f&amp;nbsp;[RegEx]::Escape($invalidChars)
&amp;nbsp;&amp;nbsp;return&amp;nbsp;($Name&amp;nbsp;-replace&amp;nbsp;$re)
}

#&amp;nbsp;Default&amp;nbsp;Values&amp;nbsp;for&amp;nbsp;the&amp;nbsp;actual&amp;nbsp;certificate
&amp;nbsp;$params&amp;nbsp;=&amp;nbsp;@{&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;Type&amp;nbsp;=&amp;nbsp;'Custom'
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Subject&amp;nbsp;=&amp;nbsp;$name&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;KeyAlgorithm&amp;nbsp;=&amp;nbsp;$keyalg
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;KeyLength&amp;nbsp;=&amp;nbsp;$keylength
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;HashAlgorithm&amp;nbsp;=&amp;nbsp;$hashalg
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SmimeCapabilities&amp;nbsp;=&amp;nbsp;$true
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CertStoreLocation&amp;nbsp;=&amp;nbsp;'Cert:\CurrentUser\My'
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;NotAfter&amp;nbsp;=&amp;nbsp;(Get-Date).AddMonths($months)
}

$NewCert&amp;nbsp;=&amp;nbsp;New-SelfsignedCertificate&amp;nbsp;@params
$output&amp;nbsp;=&amp;nbsp;NameToFileName($name)
$PFXpass&amp;nbsp;=&amp;nbsp;ConvertTo-SecureString&amp;nbsp;-String&amp;nbsp;$exppass&amp;nbsp;-Force&amp;nbsp;-AsPlainText
Export-PfxCertificate&amp;nbsp;-Cert&amp;nbsp;$NewCert&amp;nbsp;-Filepath&amp;nbsp;".\$output.pfx"&amp;nbsp;-Password&amp;nbsp;$PFXpass
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2&gt;Running the Script&amp;nbsp;&lt;/H2&gt;
&lt;P&gt;The script is designed so that you can run it from the command line and specify unique options each time but otherwise use some pre-defined options. You can also use the PowerShell "get-help" option to see execution tips:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="ka3Ht0000009XMnIAM__eid=ka3Ht0000009XMn&amp;amp;feoid=00N2J000009R3kv&amp;amp;refid=0EMHt000006jvHq.png"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/98596iD1856B373EAD03C9/image-size/large?v=v2&amp;amp;px=999" role="button" title="ka3Ht0000009XMnIAM__eid=ka3Ht0000009XMn&amp;amp;feoid=00N2J000009R3kv&amp;amp;refid=0EMHt000006jvHq.png" alt="ka3Ht0000009XMnIAM__eid=ka3Ht0000009XMn&amp;amp;feoid=00N2J000009R3kv&amp;amp;refid=0EMHt000006jvHq.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively, you can load the script into the ISE, edit param lines for each run, and click the Play icon to generate a unique certificate content.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="ka3Ht0000009XMnIAM__eid=ka3Ht0000009XMn&amp;amp;feoid=00N2J000009R3kv&amp;amp;refid=0EMHt000006jvHv.png"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/98597i3F0EA664292B762B/image-size/large?v=v2&amp;amp;px=999" role="button" title="ka3Ht0000009XMnIAM__eid=ka3Ht0000009XMn&amp;amp;feoid=00N2J000009R3kv&amp;amp;refid=0EMHt000006jvHv.png" alt="ka3Ht0000009XMnIAM__eid=ka3Ht0000009XMn&amp;amp;feoid=00N2J000009R3kv&amp;amp;refid=0EMHt000006jvHv.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After… and Beyond&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After you have completed the steps of generating a new private key, using it for a self-signed certificate, and combined it into a PKCS12/PFX file for uploading… now what?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At this point you are ready to use the Idira Identity standard Administrator interface fully documented &lt;A href="https://mcas-proxyweb.mcas.ms/certificate-checker?login=false&amp;amp;originalUrl=https%3A%2F%2Fdocs.cyberark.com.mcas.ms%2FIdaptive%2FLatest%2Fen%2FContent%2FCoreServices%2FAuthenticate%2FSignCertsManage.htm%3Ftocpath%3DAdministrator%257CConfigure%2520MFA%257CManage%2520tenant%2520signing%2520certificates%257C_____0%26McasTsid%3D15600&amp;amp;McasCSRF=538a65e0a31c04569905836bf772ded4e15015f160bd00e48c8cd150f3c38ea7" target="_blank"&gt;here&lt;/A&gt;. You will use the "Add a signing certificate" option, in addition to the other management steps. This upload step may be skipped if you prefer to upload it during the web app configuration in the Manual Configuration.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A suggested order of operations could be, but is not strictly necessary to follow this order:&amp;nbsp;&lt;/P&gt;
&lt;OL start="1"&gt;&lt;LI&gt;
&lt;P&gt;Add new Web App in Identity&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;&lt;/OL&gt;
&lt;OL start="2"&gt;&lt;LI&gt;
&lt;P&gt;Configure Web App in Identity and on the Trust "Identity Provider Configuration" page you can select the desired previously uploaded certificate, or use option "Upload New Signing Certificate" (and then delete the PFX)&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;&lt;/OL&gt;
&lt;OL start="3"&gt;&lt;LI&gt;
&lt;P&gt;Exchange the public certificate and SAML metadata with Service Provider&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;&lt;/OL&gt;
&lt;OL start="4"&gt;&lt;LI&gt;
&lt;P&gt;Relax, sip your coffee or other beverage of choice, and continue to monitor the security of your organization&amp;nbsp;&lt;/P&gt;
&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Thu, 05 Nov 2026 19:59:23 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/workforce-identity-articles/advanced-saml-security-one-app-per-certificate/ta-p/1428653</guid>
      <dc:creator>CyberArkAlumni</dc:creator>
      <dc:date>2026-11-05T19:59:23Z</dc:date>
    </item>
  </channel>
</rss>

