Installation Shibboleth IdP 5.x

Laden Sie den Shibboleth IdP herunter, prüfen Sie die Signatur und entpacken Sie das Archiv. Die aktuelle IdP-Version findet sich stets unter https://shibboleth.net/downloads/identity-provider/latest/. Es empfiehlt sich, die Release Notes zu studieren.

Herunterladen des Shibboleth IdP, der Signatur, der Prüfsumme und der PGP-Keys:

root@idp:~# mkdir /opt/install
root@idp:~# wget -P /opt/install https://shibboleth.net/downloads/identity-provider/latest/shibboleth-identity-provider-5.x.x.tar.gz
root@idp:~# wget -P /opt/install https://shibboleth.net/downloads/identity-provider/latest/shibboleth-identity-provider-5.x.x.tar.gz.asc
root@idp:~# wget -P /opt/install https://shibboleth.net/downloads/identity-provider/archive/5.1.2/shibboleth-identity-provider-5.x.x.tar.gz.sha256
root@idp:~# wget -P /opt/install https://shibboleth.net/downloads/PGP_KEYS

Die Korrektheit des Downloads lässt sich mit Hilfe einer Prüfsumme überprüfen. Über die Prüfsumme wird festgestellt, ob. z.B. Übertragungsfehler aufgetreten sind.

Prüfsumme checken:

root@idp:~# cd /opt/install && sha256sum -c shibboleth-identity-provider-5.x.x.tar.gz.sha256
shibboleth-identity-provider-5.x.x.tar.gz: OK

Importieren der öffentlichen Schlüssel und verifizieren der Signatur:

root@idp:~# gpg --import /opt/install/PGP_KEYS
root@idp:~# gpg --verify /opt/install/shibboleth-identity-provider-5.x.x.tar.gz.asc /opt/install/shibboleth-identity-provider-5.x.x.tar.gz
gpg: Signature made Mon 15 Apr 2024 06:03:42 PM CEST
gpg:                using RSA key 7D27E610B8A3DC52
gpg: Good signature from "Philip David Smart <philip.smart@jisc.ac.uk>" [unknown]
gpg:                 aka "[jpeg image of size 9378]" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: B5B5 DD33 2142 AD65 7E8D  87AC 7D27 E610 B8A3 DC52

Entscheiden ist hier „Good signature“. Die Warnung „This key is not certified with a trusted signature!“ können Sie ignorieren.

Entpacken des Archivs

root@idp:~# tar -xzf /opt/install/shibboleth-identity-provider-5.x.x.tar.gz -C /opt/install

Die Entity ID ist der global eindeutige Identifier Ihres IdP. Sie sollte sich später möglichst nie wieder ändern. Bei der Installation generiert der Installer sie automatisch anhand des Hostnames nach dem Schema https://example.org/idp/shibboleth. Die Entity ID muss von Typ URI sein und ihre Heimateinrichtung muss die Rechte an der verwendeten Domain besitzen. Sie muss jedoch nicht mit dem aktuellen virtuellen Host übereinstimmen. Sie können sie vor Inbetriebnahme des IdP in der Datei conf/idp.properties auch noch anpassen. Wählen Sie eine Entity ID, die möglichst langlebig und versionsunabängig ist. Oft verwendet werden:

Nicht zu empfehlen sind Werte, die die IdP-Version enthalten, z.B. https://idp4.example.org/idp/shibboleth, da die Entity ID dann erfahrungsgemäß oft nach ein paar Jahren doch geändert werden soll (obwohl Nutzer*innen Ihres IdP sie nicht zu sehen bekommen). Sie können auch bei der Entity ID https://idp.example.org/idp/shibboleth einen VHost namens idp4.example.org verwenden. Dies wird über die Webserver-Konfiguration bzw. die IdP-Metadaten bekannt gemacht.

Das Installationsskript findet sich unter /opt/install/shibboleth-identity-provider-5.x.x/bin/install.sh. Beim Ausführen werden die wichtigsten Angaben zum IdP abgefragt, wie der FQDN und das Zielverzeichnis, in das der IdP installiert werden soll. Der Default hierfür ist /opt/shibboleth-idp.

root@idp:~# JAVA_HOME=/usr /opt/install/shibboleth-identity-provider-5.x.x/bin/install.sh 
Installation Directory: [/opt/shibboleth-idp] ? 
INFO  - New Install.  Version: 5.x.x
Host Name: [192.168.0.5] ? 
idp-dev.hochschule-XY.de
INFO  - Creating idp-signing, CN = idp-dev.hochschule-XY.de URI = https://idp-dev.hochschule-XY.de/idp/shibboleth, keySize=3072
INFO  - Creating idp-encryption, CN = idp-dev.hochschule-XY.de URI = https://idp-dev.hochschule-XY.de/idp/shibboleth, keySize=3072
INFO  - Creating backchannel keystore, CN = idp-dev.hochschule-XY.de URI = https://idp-dev.hochschule-XY.de/idp/shibboleth, keySize=3072
INFO  - Creating Sealer KeyStore
INFO  - No existing versioning property, initializing...
SAML EntityID: [https://idp-dev.hochschule-XY.de/idp/shibboleth] ? 
 
Attribute Scope: [idp-dev.hochschule-XY.de] ? 
 
INFO  - Initializing OpenSAML using the Java Services API
INFO  - Algorithm failed runtime support check, will not be usable: http://www.w3.org/2001/04/xmlenc#ripemd160
INFO  - Algorithm failed runtime support check, will not be usable: http://www.w3.org/2001/04/xmldsig-more#hmac-ripemd160
INFO  - Algorithm failed runtime support check, will not be usable: http://www.w3.org/2001/04/xmldsig-more#rsa-ripemd160
INFO  - Including auto-located properties in /opt/shibboleth-idp/conf/ldap.properties
INFO  - Including auto-located properties in /opt/shibboleth-idp/conf/services.properties
INFO  - Including auto-located properties in /opt/shibboleth-idp/conf/admin/admin.properties
INFO  - Including auto-located properties in /opt/shibboleth-idp/conf/saml-nameid.properties
INFO  - Including auto-located properties in /opt/shibboleth-idp/conf/authn/authn.properties
INFO  - Including auto-located properties in /opt/shibboleth-idp/conf/c14n/subject-c14n.properties
INFO  - Creating Metadata to /opt/shibboleth-idp/metadata/idp-metadata.xml
INFO  - Rebuilding /opt/test/war/idp.war, Version 5.x.x
INFO  - Initial populate from /opt/shibboleth-idp/dist/webapp to /opt/test/webpapp.tmp
INFO  - Overlay from /opt/shibboleth-idp/edit-webapp to /opt/test/webpapp.tmp
INFO  - Creating war file /opt/shibboleth-idp/war/idp.war

Nachdem die IdP-Files installiert sind, versucht der Tomcat, das Servlet automatisch zu starten (siehe Tomcat-Log). Das scheitert üblicherweise zunächst, da einige Dateien für den Tomcat-User nicht lesbar abgelegt wurden. Korrigieren Sie dies mit:

root@idp:~# chgrp -R $( getent group | grep ^tomcat | cut -d ":" -f1 ) /opt/shibboleth-idp/conf /opt/shibboleth-idp/credentials
root@idp:~# chmod -R g+r /opt/shibboleth-idp/conf /opt/shibboleth-idp/credentials

Außerdem müssen Log-Verzeichnis und Metadata-Verzeichnis für den Tomcat-User schreibbar gemacht werden:

root@idp:~# chown $( getent passwd | grep ^tomcat | cut -d ":" -f1 ):$( getent group | grep ^tomcat | cut -d ":" -f1 ) /opt/shibboleth-idp/logs /opt/shibboleth-idp/metadata

DFN-Monitoring

Das Monitoring-System des DFN-Vereins prüft standardmäßig die Status-Seite Ihres IdP und die Gültigkeitsdauer der SSL-Zertifikate im Webserver. Bitte geben Sie dafür die IdP-Status-Seite frei, wie hier beschrieben.

Zur Darstellung der Status-Seite muss

  • die Java Standard Tag Library (JSTL) im Tomcat bereit stehen (siehe Vorarbeiten).
  • eine aktuelle Version der Jakarta JSTL eingebunden werden:
# Download
root@idp:~# wget -P /opt/shibboleth-idp/edit-webapp/WEB-INF/lib/ https://repo.maven.apache.org/maven2/org/glassfish/web/jakarta.servlet.jsp.jstl/3.0.1/jakarta.servlet.jsp.jstl-3.0.1.jar
root@idp:~# wget -P /opt/shibboleth-idp/edit-webapp/WEB-INF/lib/ https://repo.maven.apache.org/maven2/jakarta/servlet/jsp/jstl/jakarta.servlet.jsp.jstl-api/3.0.0/jakarta.servlet.jsp.jstl-api-3.0.0.jar
# build erneut ausführen
root@idp:~# sudo /opt/shibboleth-idp/bin/build.sh -Didp.target.dir=/opt/shibboleth-idp  
# Neustart Tomcat
root@idp:~# sudo systemctl restart tomcat10.service 
  • die IdP Status URL für Ihr eigenes Netz und das Monitoring-Netz des DFN freigegeben werden. Damit das DFN-AAI-Monitoring nur auf die Status-Seite zugreifen kann, erstellen Sie eine separates <entry> Element mit der id StatusAccessByIPAddress:
/opt/shibboleth-idp/conf/access-control.xml
<beans ...>
   <!-- ... -->
    <util:map id="shibboleth.AccessControlPolicies">
        <entry key="AccessByIPAddress">
            <bean parent="shibboleth.IPRangeAccessControl"
                p:allowedRanges="#{ {'127.0.0.1/32', '::1/128', 'IHR-NETZ/IHRE-NETZMASKE'} }" />
        </entry>
        <entry key="StatusAccessByIPAddress">
            <bean parent="shibboleth.IPRangeAccessControl"
                p:allowedRanges="#{ {'127.0.0.1/32', '::1/128', 'IHR-NETZ/IHRE-NETZMASKE', '193.174.247.0/24', '194.95.243.0/24', '194.95.244.0/24', '194.95.242.0/24', '2001:638:206:1::/64'} }" />
        </entry>
    </util:map>
   <!-- ... -->
</beans>

Das default-<entry> Element mit der id AccessByIPAddress (ohne „Status“) bleibt bestehen. Mit diesem regeln Sie den Zugriff auf die Authentifizierungsdienste des IdP. Welche Properties dies betrifft, wird in conf/admin/admin.properties festgelegt.

Der Eintrag des separaten <entry> Elements muss dann noch in conf/admin/admin.properties der Status-Seite zugewiesen werden:

./conf/admin/admin.properties
idp.status.accessPolicy=StatusAccessByIPAddress

Jetzt kann Tomcat neu gestartet werden:

root@idp:# systemctl restart tomcat10

Dabei lassen Sie am besten in drei Terminalfenstern den Tomcat- und die beiden relevanten IdP-Logs mitlaufen:

root@idp:# tail -f /var/log/tomcat10/catalina.DATUM.log /var/log/tomcat9/localhost.DATUM.log
root@idp:# tail -f /opt/shibboleth-idp/logs/idp-process.log
root@idp:# tail -f /opt/shibboleth-idp/logs/idp-warn.log

Finden sich dort keine Fehler, ist der IdP erfolgreich gestartet. Überprüfen Sie, ob Sie die Status-Seite sehen können:

root@idp:# curl https://idp.hochschule-XY.de/idp/status

Vorbereitung der IdP-Metadaten

Die Metadatenverwaltung der DFN-AAI kann die Metadaten Ihres IdP einlesen. Das verringert den Aufwand beim Eintragen der IdP-Metadaten. Ein Nachtragen, z.B. des Logos ist jedoch auch im Nachhinein in der Metadatenverwaltung möglich. Weitere Hilfe zum Ausfüllen der Metadaten finden Sie in unserer Checkliste. Wir empfehlen, vor dem initialen Registrieren des IdPs in ./metadata/idp-metadata.xml die fehlenden Einträge zu aktivieren, damit die Felder in der Metadatenverwaltung ausgefüllt werden können. Im Folgenden sind nur die relevanten Ausschnitte angegeben:

./metadata/idp-metadata.xml
<?xml version="1.0" encoding="UTF-8"?>
<EntityDescriptor  xmlns="urn:oasis:names:tc:SAML:2.0:metadata" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:shibmd="urn:mace:shibboleth:metadata:1.0" xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:mdui="urn:oasis:names:tc:SAML:metadata:ui" xmlns:req-attr="urn:oasis:names:tc:SAML:protocol:ext:req-attr" entityID="https://idp.hochschule-XY.de/idp/shibboleth">
 
...
 
    <!-- Beschreibung und Logo aktivieren -->
        <Extensions>
            <shibmd:Scope regexp="false">hochschule-XY.de</shibmd:Scope>
            <mdui:UIInfo>
                <mdui:DisplayName xml:lang="en">XY University (Development)</mdui:DisplayName>
                <mdui:DisplayName xml:lang="de">Hochschule XY (Development)</mdui:DisplayName>
                <mdui:Description xml:lang="en">Identity Provider of XY University</mdui:Description>
                <mdui:Description xml:lang="de">Identity Provider der Hochschule XY</mdui:Description>
                <mdui:Logo height="16" width="16">https://idp-dev.hochschule-XY.de/idp/images/favicon.ico</mdui:Logo>
                <mdui:Logo height="80" width="80">https://idp-dev.hochschule-XY.de/idp/images/logo.png</mdui:Logo>
            </mdui:UIInfo>
        </Extensions>
 
        ...
 
        <ArtifactResolutionService Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP" Location="..."/>
 
        <!-- vier Single-Logout-Services aktiveren -->
        <SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="..."/>
        <SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="..."/>
        <SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST-SimpleSign" Location="..."/>
        <SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP" Location="..."/>
 
        <SingleSignOnService Binding="urn:mace:...
        <SingleSignOnService Binding="urn:oasis:...
        <SingleSignOnService Binding="urn:oasis:...
        <SingleSignOnService Binding="urn:oasis:...
 
        <!-- den fehlenden ECP-Endpoint hinzufügen -->
        <SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP" Location="https://idp.hochschule-XY.de/idp/profile/SAML2/SOAP/ECP"/>
 
...
    </IDPSSODescriptor>
 
    <!-- Protocol-Support für SAML2-Queries im Attribute Authority-Descriptor aktivieren -->
    <AttributeAuthorityDescriptor protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
 
        ...
 
        <!-- SAML2-Attribute-Service einkommentieren -->
        <AttributeService Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP" Location="..."/>
 
    </AttributeAuthorityDescriptor>
 
</EntityDescriptor>

Einmalige Verwendung der idp-metadata.xml

Die Datei ./metadata/idp-metadata.xml wird in der DFN-AAI nicht verwendet. Sie wird später weder vom IdP aktualisiert, noch von anderen Teilnehmern benötigt. Sie wird hier ausschließlich für das initiale Einlesen in die Metadatenverwaltung editiert und verwendet!

Der Inhalt dieser Datei wird per default unter der URL https://idp.example.org/idp/shibboleth ausgeliefert. Manche Dienstbetreiber gehen fälschlicherweise davon aus, dass die Daten darin ständig aktuell sind (wie es beim Shibboleth-Service-Provider ist). Deshalb sollte man diese URL abstellen, indem man in idp.properties den zugehörigen Eintrag leert:

./conf/idp.properties
#idp.entityID.metadataFile=%{idp.home}/metadata/idp-metadata.xml
idp.entityID.metadataFile=

Die Änderung wird nach dem nächsten Tomcat-Neustart wirksam.

  • Zuletzt geändert: vor 38 Stunden