====== shibboleth ====== * fédération renater : installation d'un SP * https://services.renater.fr/federation/docs/installation#installer_un_sp_shibboleth * https://wiki.shibboleth.net/confluence/display/SHIB2/NativeSPApplication * https://wiki.shibboleth.net/confluence/display/SHIB2/NativeSPApplicationOverride ===== Installation de shibboleth sur le serveur SP ===== ==== Pour redhat ==== Récupérer le fichier security_shibboleth.repo à déposer dans /etc/yum.repos.d ^ Groupe | shibd:x:492: | ^ Compte | shibd:x:495:492:Shibboleth SP daemon:/var/run/shibboleth:/sbin/nologin | === Sur redhat 5 === # cd /etc/yum.repos.d\\ # wget http://download.opensuse.org/repositories/security://shibboleth/RHEL_5/security:shibboleth.repo # cat shibboleth.repo [security_shibboleth] name=Shibboleth (RHEL_5) type=rpm-md baseurl=http://download.opensuse.org/repositories/security:/shibboleth/RHEL_5/ gpgcheck=1 gpgkey=http://download.opensuse.org/repositories/security:/shibboleth/RHEL_5/repodata/repomd.xml.key enabled=1 # yum install shibboleth.x86_64 Installing for dependencies: libsaml8 libxerces-c-3_1 libxml-security-c17 libxmltooling6 log4shib opensaml-schemas xmltooling-schemas === Sur redhat 6 === # cd /etc/yum.repos.d\\ # wget http://download.opensuse.org/repositories/security://shibboleth/RHEL_6/security:shibboleth.repo # yum install shibboleth.x86_64 Installing for dependencies: libcurl-openssl liblog4shib1 libsaml8 libxerces-c-3_1 libxml-security-c17 libxmltooling6 opensaml-schemas xmltooling-schemas Il faut que la variable d’environnement **LD_LIBRARY_PATH** contienne **/opt/shibboleth/lib64** sinon au lancement du démon shibd il y aura le message d’erreur ERROR XMLTooling.libcurl.InputStream : on Red Hat 6+, make sure libcurl used is built with OpenSSL Paramétrer la variable LD_LIBRARY_PATH dans **/etc/environment** LD_LIBRARY_PATH=/opt/shibboleth/lib64 Rebooter le serveur Pour vérifier # echo $LD_LIBRARY_PATH ==== Pour debian ==== # aptitude search shibboleth p shibboleth-sp2-common - Federated web single sign-on system (common files) p shibboleth-sp2-schemas - Federated web single sign-on system (transitional package) p shibboleth-sp2-utils - Federated web single sign-on system (daemon and utilities) p wordpress-shibboleth - Shibboleth plugin for WordPress # aptitude install **shibboleth-sp2-common** # aptitude install **shibboleth-sp2-utils** # aptitude install **libapache2-mod-shib2** .... Setting up libapache2-mod-shib2 (2.5.3+dfsg-2) ... apache2_invoke: Enable module shib2 ^ Groupe | _shibd:x:127: | ^ Compte | _shibd:x:120:127::/var/log/shibboleth:/bin/false | ===== Configuration Apache ===== === /etc/httpd/conf/httpd.conf === AuthType shibboleth ShibRequireSession On ShibApplicationID default require shibboleth # require mail ~ @ ===== Configuration shibboleth ===== ==== Fichiers de configuration personnalisés par la fédération Renater (en français) ==== # cd .../shibboleth/ # wget https://test.federation.renater.fr/exemples/conf_sp2_renater.tar.gz # tar xvfz conf_sp2_renater.tar.gz # chown -R _shibd:_shibd conf_sp2 # cd /etc/shibboleth/ # mv accessError.html accessError.html.orig # mv attribute-policy.xml attribute-policy.xml.orig # mv globalLogout.html globalLogout.html.orig # mv localLogout.html localLogout.html.orig # mv metadataError.html metadataError.html.orig # mv sessionError.html sessionError.html.orig # mv sslError.html sslError.html.orig # mv .../shibboleth/conf_sp2/* . ==== Dossiers et fichiers créés ==== **/etc/shibboleth** : configuration contenant **shibboleth2.xml** # chown -R shibd:shibd /etc/shibboleth # redhat # chown -R _shibd:_shibd /etc/shibboleth # debian === Fichiers === * accessError.html * attrChecker.html * attribute-map.xml * attribute-policy.xml * bindingTemplate.html * console.logger * discoveryTemplate.html * example-metadata.xml * example-shibboleth2.xml * globalLogout.html * localLogout.html * metadataError.html * native.logger * partialLogout.html * postTemplate.html * protocols.xml * security-policy.xml * sessionError.html * shibboleth2.xml * shibd.logger * sslError.html * syslog.logger * upgrade.xsl === Dossiers === * **/var/log/shibboleth** : logs contenant **shibd.log** * **/var/run/shibboleth** : runtime contenant fichier de "process ID" et "socket" * **/var/cache/shibboleth** : cache contenant fichier de "metadata backup" and "CRL" * **/etc/init.d** : contenant le script de démarrage pour le daemon **shibd** ===== Certificat auto-signé ===== Le processus shibd a besoin d'un certificat pour signer les requêtes SAML transmises aux fournisseurs d'identités (IdP). # cd /etc/shibboleth === 1. génération de la clé privée : === # openssl genrsa 1024 > [nom serveur].grenoble-inp.fr.key Generating RSA private key, 1024 bit long modulus ..........++++++ ................++++++ e is 65537 (0x10001) === 2. génération du certificat auto signé : === # openssl req -new -x509 -nodes -sha1 -days 7300 -subj "/C=FR/O=Institut Polytechnique de Grenoble/CN=[nom serveur].grenoble-inp.fr" -key ./[nom serveur].grenoble-inp.fr.key > ./[nom serveur].grenoble-inp.fr.crt === 3. on met dans le fichier le descriptif humainement lisible du certificat === # openssl x509 -noout -fingerprint -text < ./[nom serveur].grenoble-inp.fr.crt >> ./[nom serveur].grenoble-inp.fr.crt === 4. certficat pour shibboleth === # shib-keygen -f -u _shibd -h [nom serveur].grenoble-inp.fr -y 3 -e https://[nom serveur].grenoble-inp.fr/shibboleth -o /etc/shibboleth/ ==== Vérification ==== # shibd -t 2017-03-27 09:04:57 WARN Shibboleth.Application : insecure cookieProps setting, set to "https" for SSL/TLS-only usage 2017-03-27 09:04:57 WARN Shibboleth.Application : handlerSSL should be enabled for SSL/TLS-enabled web sites 2017-03-27 09:04:57 WARN Shibboleth.Application : no MetadataProvider available, configure at least one for standard SSO usage overall configuration is loadable, check console for non-fatal problems ===== Configuration brique SP ===== ==== Télécharger le certificat avec lequel les opérateurs de la fédération signent les méta-données ==== # wget https://metadata.federation.renater.fr/certs/renater-metadata-signing-cert-2016.pem Vérifier # /usr/bin/openssl x509 -sha256 -noout -fingerprint -in renater-metadata-signing-cert-2016.pem Doit afficher SHA256 Fingerprint=6B:D3:5F:7A:B1:64:EC:79:03:0D:36:97:BA:40:BD:23:5D:AA:DA:C0:43:47:C6:E5:3E:B7:72:A7:74:2C:16:5F ==== Télécharger le fichier xml des metadonnées de Renater ==== il faut que ce fichier existe sous /etc/shibboleth == Pour fédération de test == # wget https://federation.renater.fr/renater/renater-test-metadata.xml == Pour fédération de prod == # wget https://federation.renater.fr/renater/renater-metadata.xml ==== Fichiers de configuration à modifier ==== * /etc/shibboleth/**shibboleth2.xml** --> [[fichiersconf#shibboleth2xml|Modifications]] * /etc/shibboleth/**attribute-map.xml** --> [[fichiersconf#attribute-mapxml|Modifications]] ==== Publication des méta-données ==== Le SP Shibboleth 2.x publie automatiquement ses méta-données à l'adresse : * https://[NOM].grenoble-inp.fr/Shibboleth.sso/Metadata ===== Configuration sur le serveur hébergeant IDP de shibboleth ===== à faire sur les 2 serveurs # cd /home/AAA/install/shibboleth-idp/conf ==== service.xml ==== Utiliser attribute-filter-test.xml : pour les tests. Ne plus utiliser attribute-filter.xml en local mais celui de Renater Mettre en commentaire : Ajouter : ===== Enregistrement dans la fédération Renater===== https://services-federation.renater.fr/gestion?federation {{:documentation:shibboleth:shib-decl2.jpg?600|}} {{:documentation:shibboleth:shib-decl1.jpg?800|}} ^ Description technique du service : Serveur de test | ^ URL du service | https://[NOM].grenoble-inp.fr/sso_login/federation_renater/ | ^ Public(s) concerné(s) par le service | communauté nationale (type UNT) ou internationale | ^ Catégorie du service | outils collaboratifs | ^ Attributs | email authentification | ^ URL méta données | https://[NOM].grenoble-inp.fr/sso_login/federation_renater/Shibboleth.sso/Metadata | ^ Rattachement à une fédération | Fédération Education-Recherche | ^ Adresse directe | /registry?action=get&file_id=9a9d2a0c00f5b8936d2e. | Dans le cas où l'URL des méta données ne marche pas renseigner : ^ entityID | https://[NOM].grenoble-inp.fr| ^ Point d'accès (AssertionConsumer service)\\ pour le protocole SAML 1.0, profil browser-post | https://[NOM].grenoble-inp.fr/sso_login/federation_renater/Shibboleth.sso/SAML/POST | ^ index | 0 | ^ Point d'accès (AssertionConsumer service)\\ pour le protocole SAML 2.0, profil http-post | https://[NOM].grenoble-inp.fr/sso_login/federation_renater/Shibboleth.sso/SAML2/POST | ^ index | 0 | ^ Certificat X.509 | copie de /etc/shibboleth/sp-cert.pem\\ sans ces deux lignes BEGIN CERTIFICATE et END CERTIFICATE | ===== Logs ===== ==== Fichier de logs ==== /var/log/shibboleth * shibd.log * shibd_warn.log * signature.log * transaction.log ==== Rotation des logs ==== /etc/logrotate.d * shibd /var/log/shibboleth/*.log { daily missingok rotate 14 compress delaycompress notifempty create 640 _shibd _shibd sharedscripts } ===== Autres fichiers ===== * /etc/sysconfig/shibd ===== Lancement ===== # /etc/init.d/httpd restart # redhat \\ # /etc/init.d/apache2 restart # debian Vérifiez que la syntaxe de votre configuration shibboleth2.xml est correcte : # /usr/sbin/shibd -tc /etc/shibboleth/shibboleth2.xml 2010-10-22 10:10:23 WARN Shibboleth.AttributeExtractor.XML : skipping duplicate Attribute mapping (same name and nameFormat) 2010-10-22 10:10:23 WARN Shibboleth.PropertySet : deprecation - remapping property (defaultACSIndex) to (acsIndex) overall configuration is loadable, check console for non-fatal problems # /etc/init.d/shibd start # ps auwx | grep shibd root 29410 0.0 0.1 99680 13528 ? Ssl 15:25 0:00 /usr/sbin/shibd -p /var/run/shibboleth/shibd.pid -f -w 30 root 29418 0.0 0.0 65280 784 pts/2 S+ 15:26 0:00 grep shibd # tail -f /var/log/shibboleth/shibd.log 2010-10-21 15:25:13 INFO Shibboleth.Listener : registered remoted message endpoint (app-sympa/Logout::run::LocalLI) 2010-10-21 15:25:13 INFO Shibboleth.Listener : registered remoted message endpoint (app-sympa/NIM/SOAP) 2010-10-21 15:25:13 INFO Shibboleth.Listener : registered remoted message endpoint (app-sympa/NIM/Redirect) 2010-10-21 15:25:13 INFO Shibboleth.Listener : registered remoted message endpoint (app-sympa/NIM/POST) 2010-10-21 15:25:13 INFO Shibboleth.Listener : registered remoted message endpoint (app-sympa/NIM/Artifact) 2010-10-21 15:25:13 INFO Shibboleth.Listener : registered remoted message endpoint (app-sympa/Artifact/SOAP::run::SAML2Artifact) 2010-10-21 15:25:13 INFO Shibboleth.Listener : registered remoted message endpoint (app-sympa/Metadata) 2010-10-21 15:25:13 INFO Shibboleth.Listener : registered remoted message endpoint (app-sympa/Status) 2010-10-21 15:25:13 INFO Shibboleth.Listener : registered remoted message endpoint (app-sympa::getHeaders::Application) 2010-10-21 15:25:13 INFO Shibboleth.Listener : listener service starting