Hi Andrew,
The functonality you are refering to was used by SURFconext to switch to a new signing key in response to the heartbleed vulnerability. We were using a different LB method and were not using php-fpm at the time and we determined that the SAML signing key could have been exposed, so we wanted to do a key rollover.
There are two methods to switch to a new signing key using OpenConext:
1. The "classic rollover" method
- You generate a new key and SAML signing certificate
- You add the new certificate as a second certificate to the metadata of EB, you do this by adding the new certificate in SR to the metadata of the IdP with the EntityID (connection ID) of EB. You can use the medata field "certData2" file for this. You should see the 2nd certificate appearing in the metadata's published by eb (i.e. .../idp/metadata )
- You wait until all your SPs have refreshed their metadata, you will want to communicate this change to them beforehand. Your SPs now trust both your new and your old certificate
- You update the configuration of "encryption.keys.default" so EB will now sign using your new key
- You update the EB IdP Metadata in serviceregistry so that it contains your new certificate only, in certData
- After all your SPs have refreshed their metadata again, they now only trust your new key
- You are done
I call this the "classic rollover" method because this is what a rollover of a key of a typical SAML IdP or SP looks like.
Of you can be reasonably certain that all you SP will update your metadata, and you can wait for them to do so, this method will be fine. It should also be readily understood by SPs, because this is the common approach.
Note that "encryption.keys.KEYID.publicFile" and "encryption.keys.KEYID.privateFile" options are not used a all.
2. Using multiple keys at the same time - using the "KEYID" option
The "KEYID" in "encryption.keys.KEYID.publicFile" and "encryption.keys.KEYID.privateFile" are just placeholders. You are to replace these with the name of your new key. E.g. "encryption.keys.20170217.publicFile" and "encryption.keys.20170217.privateFile" for a key generated at this date, but you can use any name. This explains why you could not find this option mentioned in the EB code.
Using this method EB can sign using multiple keys at the same time. When you add a key like this an additional endpoints are added for the metadata of the IdP side of EB:
The following metadata that uses the default key:
authentication/idp/certificate
authentication/idp/certificate/key:default
authentication/idp/metadata
authentication/idp/metadata/key:default
authentication/proxy/idps-metadata
authentication/proxy/idps-metadata/key:default
But you will now also have metadata that uses the new "20170217" key you defined:
authentication/idp/certificate/key:20170217
authentication/idp/metadata/key:20170217
authentication/proxy/idps-metadata/key:20170217
When you look into the metadata you will notice that the SSO location hase the "key:KEYID" part added. I.e. "authentication/idp/single-sign-on/key:20170217". This part selects the key that EB will use to sign the assertion back to the SP and allows multiple keys to be active at the same time.
A keyrollover works like this:
- You generate a new key and SAML signing certificate
- You add the second key to EB config
- (optional) You add the new certificate as a second certificate to the metadata of EB, you do this by adding the new certificate in SR to the metadata of the IdP with the EntityID (connection ID) of EB. You can use the medata field "certData2" file for this. You should see the 2nd certificate appearing in the metadata's published by eb (i.e. .../idp/metadata ). So, yes, you can combine this method with the "classic rollover" method above
- You notify your SPs of the changed metadata location by pointing them to the key:20170217 versions of the metadata
- You can monitor uptake of the new key
- At some point you decide to update the configuration of "encryption.keys.default" so EB will now always sign using your new key
- You update the EB IdP Metadata in serviceregistry so that it contains your new certificate only, in certData.
- You are done
So with this method, after adding a new key, as soon as an SP has switched to the new metadata, they use the new key, and do no longer trust the old key. Note that the SP MUST update the metadata location to get this benefit. SPs that are slow to update will continue to work using the old key. By monitoring the SSO location that SPs use to login you can see wether an SP has switch or not, so you can focus your communication efforts on those SPs.
Maybe we should call this method of key rollover "Dutch Keyrollover" because it uses the same trick as "Dutch Scoping" - it makes the SP to send some extra info in the SSO location URL to EB.
Op donderdag 16 februari 2017 23:55:11 UTC+1 schreef
andrew...@cybera.ca: