The default configuration of the IdP relies on a component called a "DataSealer" which in turn uses an AES secret key to secure cookies and certain other data for the IdPs own use. This key must never be shared with anybody else, and must be copied to every server node making up a cluster.
An initial key is generated by the installer in a special kind of Java keystore file called a "JCEKS" keystore, which stores secret keys instead of public/private keys and certificates. A parallel file also tracks the key version number. A tool is provided to regularly update this secret key (and increase the version), which can be pushed to cluster nodes and continually maintain the secrecy of this key. This should be done at least daily to limit the chance for, and damage from, exposure. You can list the keys with the Java keytool utility (change the <secret> accordingly):
Each time the seckeygen utility runs, it generates a new iteration of the key and updates the key version number (and a date/time in a comment). It also maintains a limited number of earlier keys (defaulting to 30, set with the --count option), which should be set based on how often you run the script and how long earlier data used by clients needs to be readable. Any data written with the DataSealer is always encrypted with the latest version of the key, but any data encrypted with an older key can still be read as long as the key remains accessible.
To roll the key, a script similar to the following can be used in a scheduled task on one of the cluster nodes or a staging server:
The below bash version uses the idp.properties file so configurable items don't need to be changed in multiple locations. It can be run manually or via cron (the script can replace the existing seckeygen.sh script entirely as long as it is then run without command line parameters)
It adds some new properties - so that all features are completely configurable from the idp.properties (prefixed with _ as they are unofficial)
- Number of earlier keys to keep (default 30)
- Space separated list of hosts to scp the sealer files to (default generate locally)