===== SP v3 =====
Déploiement d'un Service Provider v3 sous centos 7
===== Réference =====
* https://wiki.shibboleth.net/confluence/display/SP3/Home
===== Repo shibboleth =====
* https://wiki.shibboleth.net/confluence/display/SP3/RPMInstall
le site de shibboleth fournit maintenant des packahe RPM (opensuse avant)
depuis le site https://shibboleth.net/downloads/service-provider/RPMS/ on genere un fichier de repository pur notre distribution (ici centos 7)
[root@sp3 yum.repos.d]# cat ShibbolethSP3.repo
[shibboleth]
name=Shibboleth (CentOS_7)
# Please report any problems to https://issues.shibboleth.net
type=rpm-md
mirrorlist=https://shibboleth.net/cgi-bin/mirrorlist.cgi/CentOS_7
gpgcheck=1
gpgkey=https://shibboleth.net/downloads/service-provider/RPMS/repomd.xml.key
enabled=1
===== yum install =====
[root@sp3 yum.repos.d]# yum install shibboleth.x86_64
Dépendances résolues
====================================================================================================================================================================
Package Architecture Version Dépôt Taille
====================================================================================================================================================================
Installation :
shibboleth x86_64 3.0.2-1.1 shibboleth 1.2 M
Installation pour dépendances :
libcurl-openssl x86_64 7.61.0-1.1 shibboleth 235 k
libevent x86_64 2.0.21-4.el7 base 214 k
liblog4shib2 x86_64 2.0.0-3.1 shibboleth 69 k
libmemcached x86_64 1.0.16-5.el7 base 237 k
libsaml10 x86_64 3.0.0-1.1 shibboleth 949 k
libtool-ltdl x86_64 2.4.2-22.el7_3 base 49 k
libxerces-c-3_2 x86_64 3.2.1-1.1 shibboleth 894 k
libxml-security-c20 x86_64 2.0.1-3.1 shibboleth 187 k
libxmltooling8 x86_64 3.0.2-3.1 shibboleth 709 k
opensaml-schemas x86_64 3.0.0-1.1 shibboleth 30 k
unixODBC x86_64 2.3.1-11.el7 base 413 k
xmltooling-schemas x86_64 3.0.2-3.1 shibboleth 12 k
Résumé de la transaction
====================================================================================================================================================================
Installation 1 Paquet (+12 Paquets en dépendance)
Taille totale des téléchargements : 5.1 M
Taille d'installation : 28 M
Installé :
shibboleth.x86_64 0:3.0.2-1.1
===== Post install =====
==== demarrage automatique ====
je conseil d'installer le package bash-completion.noarch pour profiter de la completion des commandes systemctl
[root@sp3 yum.repos.d]# systemctl enable shibd.service
Created symlink from /etc/systemd/system/multi-user.target.wants/shibd.service to /usr/lib/systemd/system/shibd.service.
[root@wikis shibboleth]# systemctl start shibd.service
[root@wikis shibboleth]# systemctl status shibd.service
shibd.service - Shibboleth Service Provider Daemon
Loaded: loaded (/usr/lib/systemd/system/shibd.service; enabled)
Active: active (running) since Fri 2015-08-07 17:31:14 CEST; 4s ago
Main PID: 668 (shibd)
CGroup: /system.slice/shibd.service
`-668 /usr/sbin/shibd -f -F
Aug 07 17:31:14 wikis systemd[1]: Started Shibboleth Service Provider Daemon.
Ainsi que httpd restart / reload pour charger le mod_shib contenu dans /etc/httpd/conf.d/shib.conf
[root@wood ~]# systemctl restart httpd.service
==== emplacement des fichiers de log ====
definis dans les fichier .logger :
[root@wood shibboleth]# grep fileName *.logger
native.logger:log4j.appender.native_log.fileName=/var/log/shibboleth-www/native.log
native.logger:log4j.appender.warn_log.fileName=/var/log/shibboleth-www/native_warn.log
shibd.logger:log4j.appender.shibd_log.fileName=/var/log/shibboleth/shibd.log
shibd.logger:log4j.appender.warn_log.fileName=/var/log/shibboleth/shibd_warn.log
shibd.logger:log4j.appender.tran_log.fileName=/var/log/shibboleth/transaction.log
shibd.logger:log4j.appender.sig_log.fileName=/var/log/shibboleth/signature.log
==== httpd.conf ====
$ diff httpd.conf httpd.conf.orig
275c275
< UseCanonicalName On
---
> UseCanonicalName Off
==== test Status ====
Parametrer l'ACL dans /etc/shibboleth/shibboleth2.xml qui permet d'acceder a cet URL
Acces:
* http://wood.tem-tsp.eu/Shibboleth.sso/Status
les metadata directement:
* http://wood.tem-tsp.eu/Shibboleth.sso/Metadata
==== test config ====
attention à la libCurl et openssl :
from https://wiki.infn.it/progetti/cloud-areapd/aai_integration_with_keystone/aai_integrations_with_openstack_keystone_icehouse#aai_integrations_in_openstack_keystone_icehouse
even if the message is marked as critical, those errors can be ignored. On many RedHat/Fedora installation a different version of libcurl is required, the library is located in /opt/shibboleth/lib64. The shibboleth daemon calls the configuration script /etc/sysconfig/shibd in order to overwrite the system library. In case it is possible to remove the error running the command
LD_LIBRARY_PATH=/opt/shibboleth/lib64 shibd -t
===== Parametrage shibboleth2.xml =====
le fichier /etc/shibboleth/shibboleth2.xml contient l'essentiel du paramétrage du service Prodider shibboleth. Sont représentés ici uniquement les parties modifiéed par rapport au fichier original, à savoir le service SSO, les messages d'erreur, et les Metadata.
==== SSO ====
Attention, depuis le version 2.4 l'élément SessionInitiator a été remplacé par l'élément SSO !
https://wiki.shibboleth.net/confluence/display/SHIB2/NativeSPServiceSSO
..
SAML2 SAML1
==== error messages ====
...
==== Metadata ====
autoriser l'ecriture au user shibd (user sous lequel tourne le daemon shibd) au repertoire de config / telecharement des metadata par defaut /etc/shibboeth
[root@wood shibboleth]# chgrp shibd .
[root@wood shibboleth]# chmod 775 .
==== Certificats de signature des metadata ====
cf https://services.renater.fr/federation/technique/metadata
certificat Renater
[root@wood shibboleth]# wget https://federation.renater.fr/renater/metadata-federation-renater.crt
===== Multiples vhost sur un meme SP =====
==== references ====
* https://wiki.cam.ac.uk/raven/Virtual_hosting_issues_with_Shibboleth
* https://wiki.cam.ac.uk/raven/SP_Metadata
* https://services.renater.fr/federation/documentation/fiches-techniques/sp/config-sp-virtualhosting
avant de generer une nouvelle paire de clée, il est preferable de sauvegarder la paire initiale (car le -f / force les ecrasera )
[root@wood shibboleth]# cp sp-key.pem sp-key-wood.pem
[root@wood shibboleth]# cp sp-cert.pem sp-cert-wood.pem
générer la paire de clé pour l'application/vhost, on don eun nom de fichier permettant d'identifier le certificat à l'application (utile si hebergement de plusieurs ApllicationOverride/vhost) , et on donne acces à l'utilisateur shibd a ces fichiers :
[root@wood shibboleth]# ./keygen.sh -h mood.paris-saclay.fr -f
Generating a 2048 bit RSA private key
............................................................................................+++
....................+++
writing new private key to './sp-key.pem'
-----
[root@wood shibboleth]# mv sp-key.pem sp-key-mood.paris-saclay.fr.pem
[root@wood shibboleth]# mv sp-cert.pem sp-cert-mood.paris-saclay.fr.pem
[root@wood shibboleth]# chown shibd sp-cert-mood.paris-saclay.fr.pem sp-key-mood.paris-saclay.fr.pem
déclaration de l'Application Override (dans la section ApplicationDdefaults de shibboleth2.xml) avec chargement des certificats auto-signés ci-dessus
...
==== metadata Application Override / vhost ====
pour que ce SP hebergé sur cette instance mutualisée de shibd soit identifiable de maniere independante dans la fédération d'identité, il faut y declaré ses metadata disponible sur le service shibd : Shibboleth.sso/Metadata , exemple ici https://mood.paris-saclay.fr/Shibboleth.sso/Metadata
[root@shib-ds-wayf ~]# wget https://mood.paris-saclay.fr/Shibboleth.sso/Metadata