Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
de:shibidp:config-sealer [2021/05/03 12:57] – [Secret Key Management] Silke Meyerde:shibidp:config-sealer [2024/07/26 10:02] (aktuell) – [Secret Key Management] Link aktualisiert Doreen Liebenau
Zeile 7: Zeile 7:
 </callout> </callout>
  
-In der Standardeinstellung speichert der Shibboleth IdP Informationen zu Sitzungen und User Consent clientseitig im Browser, in Cookies und ggf. HTML Local Storage ([[https://wiki.shibboleth.net/confluence/display/IDP4/SecretKeyManagement|siehe Shibboleth Wiki]]). Diese Daten werden durch Verschlüsselung geschützt. Die Keys, die dabei zum Einsatz kommen, sollten regelmäßig getauscht werden, wenn Sie die oben genannten Informationen //nicht// serverseitig speichern.+In der Standardeinstellung speichert der Shibboleth IdP Informationen zu Sitzungen und User Consent clientseitig im Browser, in Cookies und ggf. HTML Local Storage ([[https://shibboleth.atlassian.net/wiki/spaces/IDP5/pages/3199501624/SecretKeyManagement|siehe Shibboleth Wiki]]). Diese Daten werden durch Verschlüsselung geschützt. Die Keys, die dabei zum Einsatz kommen, sollten regelmäßig getauscht werden, wenn Sie die oben genannten Informationen //nicht// serverseitig speichern.
  
 ===== Key-Rollover automatisieren ===== ===== Key-Rollover automatisieren =====
Zeile 15: Zeile 15:
 </callout> </callout>
  
-Legen Sie Beispiel-Skript herunter und legen es nach ''/opt/shibboleth-idp/bin/update-sealer.sh'' (Quelle: [[https://wiki.shibboleth.net/confluence/display/IDP4/SecretKeyManagement|Shibboleth Wiki]]).+Laden Sie das Beispiel-Skript herunter und legen es nach ''/opt/shibboleth-idp/bin/update-sealer.sh'' (Quelle: [[https://shibboleth.atlassian.net/wiki/spaces/IDP5/pages/3199501624/SecretKeyManagement|Shibboleth Wiki]]).
  
 <code bash> <code bash>
 #!/bin/bash #!/bin/bash
-  + 
-set -e+set -e 
 set -u set -u
-  +
 # Default IDP_HOME if not already set # Default IDP_HOME if not already set
 if [ ! -d "${IDP_HOME:=/opt/shibboleth-idp}" ] if [ ! -d "${IDP_HOME:=/opt/shibboleth-idp}" ]
Zeile 29: Zeile 29:
     exit 1     exit 1
 fi fi
- +
 function get_config { function get_config {
- # Key to lookup (escape . for regex lookup) +    # Key to lookup (escape . for regex lookup) 
- local KEY=${1:?"No key provided to look up value"+    local KEY=${1:?"No key provided to look up value"
- # Passed default value +    # Passed default value 
- local DEFAULT="${2:-}" +    local DEFAULT="${2:-}" 
- # Lookup key, strip spaces, replace idp.home with IDP_HOME value +    # Lookup key, strip spaces, replace idp.home with IDP_HOME value 
- local RESULT +    local RESULT=$(sed -rn '/^'"${KEY//./\\.}"'\s*=/ { s|^[^=]*=(.*)\s*$|\1|; s|%\{idp\.home\}|'"${IDP_HOME}"'|g; p}' ${IDP_HOME}/conf/idp.properties) 
- if [[ ${KEY} == "idp.sealer.storePassword" ]]; then +    if [ -z "$RESULT" ] 
- RESULT=$(sed -rn '/^'"${KEY//./\\.}"'\s*=/ { s|^[^=]*=(.*)\s*$|\1|; s|%\{idp\.home\}|'"${IDP_HOME}"'|g; p}' ${IDP_HOME}/credentials/secrets.properties | sed 's/^\ //'+    then 
- else +       local RESULT=$(sed -rn '/^'"${KEY//./\\.}"'\s*=/ { s|^[^=]*=(.*)\s*$|\1|; s|%\{idp\.home\}|'"${IDP_HOME}"'|g; p}' ${IDP_HOME}/credentials/secrets.properties) 
- RESULT=$(sed -rn '/^'"${KEY//./\\.}"'\s*=/ { s|^[^=]*=(.*)\s*$|\1|; s|%\{idp\.home\}|'"${IDP_HOME}"'|g; p}' ${IDP_HOME}/conf/idp.properties | sed 's/^\ //'+    fi   
- fi +    # Set if no result with default - exit if no default 
- # Set if no result with default - exit if no default +    echo "${RESULT:-${DEFAULT:?"No value in config and no default defined for: '${KEY}'"}}"
- echo "${RESULT:-${DEFAULT:?"No value in config and no default defined for: '${KEY}'"}}"+
 } }
- +
 # Get config values # Get config values
 ## Official config items ## ## Official config items ##
 +
 storefile=$(get_config idp.sealer.storeResource) storefile=$(get_config idp.sealer.storeResource)
 versionfile=$(get_config idp.sealer.versionResource) versionfile=$(get_config idp.sealer.versionResource)
Zeile 56: Zeile 56:
 # default cannot be empty - so "self" is the default (self is skipped for syncing) # default cannot be empty - so "self" is the default (self is skipped for syncing)
 sync_hosts=$(get_config idp.sealer._sync_hosts ${HOSTNAME}) sync_hosts=$(get_config idp.sealer._sync_hosts ${HOSTNAME})
-  +# Run the keygen utility  
-# Run the keygen utility +${0%/*}/seckeygen.sh \
-${0%/*}/runclass.sh net.shibboleth.utilities.java.support.security.BasicKeystoreKeyStrategyTool \+
     --storefile "${storefile}" \     --storefile "${storefile}" \
     --storepass "${storepass}" \     --storepass "${storepass}" \
Zeile 64: Zeile 63:
     --alias "${alias}" \     --alias "${alias}" \
     --count "${count}"     --count "${count}"
-  
 # Display current version # Display current version
 echo "INFO: $(tac "${versionfile}" | tr "\n" " ")" >&2 echo "INFO: $(tac "${versionfile}" | tr "\n" " ")" >&2
-  
 for EACH in ${sync_hosts} for EACH in ${sync_hosts}
 do do
Zeile 77: Zeile 74:
         echo "ERROR: Host '${EACH}' not reachable - skipping" >&2         echo "ERROR: Host '${EACH}' not reachable - skipping" >&2
     else     else
-        # run scp in the background+ # run scp in the background 
         scp "${storefile}" "${versionfile}" "${EACH}:${IDP_HOME}/credentials/" &         scp "${storefile}" "${versionfile}" "${EACH}:${IDP_HOME}/credentials/" &
     fi     fi
  • Zuletzt geändert: vor 5 Jahren