Modifications entre les versions 3 et 5 (s'étendant sur 2 versions)
Version 3 à la date du 2013-02-21 22:04:57
Taille: 10087
Éditeur: MoussaNombre
Commentaire: suite avec JC
Version 5 à la date du 2013-03-26 17:50:05
Taille: 10528
Éditeur: MoussaNombre
Commentaire: Mise à jour
Texte supprimé. Texte ajouté.
Ligne 51: Ligne 51:
== installation "manuelle" des paquets requis ==
 * lasso (https://dev.entrouvert.org/lasso/lasso-2.3.6.tar.gz)
  * pré-requis :
   * aptitude install zlib1g-dev
   * aptitude install pkg-config
   * `configure: error: Package requirements (glib-2.0 >= 2.4.0 gobject-2.0 >= 2.4.0 libxml-2.0 xmlsec1 >= 1.2.6 xmlsec1-openssl >= 1.2.6 openssl) were not met` :
    * aptitude install libglib2.0-dev (==> glib-2.0 >= 2.4.0 gobject-2.0)
    * aptitude install libxmlsec1-dev ==> libxml-2.0 xmlsec1 >= 1.2.6 xmlsec1-openssl >= 1.2.6 openssl
  * appliquer le patch de Inverse : `patch -p0 lasso-export.diff`
  * lire le `INSTALL` pour l'installation (./configure ; make ; make install)
== installation des paquets requis ==
 * aptitude install liblasso3 (celui de apt.auf.org)
Ligne 72: Ligne 64:

  * les librairies aux bons endroits :
   {{{
root@sogo-test-saml:/usr/lib/sasl2# cp -a /lib/sasl2/* /usr/lib/sasl2/
root@sogo-test-saml:/usr/lib/sasl2# cp -a /usr/lib/security/pam_saml.so.0.2.0 /lib/security/pam_saml.so
   }}}
  * vérification
   {{{
root@sogo-test-saml:/usr/lib/sasl2# saslpluginviewer
Plugin "saml" [loaded], API version: 4
        SASL mechanism: SAML, best SSF: 0
        security flags: NO_ANONYMOUS
        features: WANT_CLIENT_FIRST|PROXY_AUTHENTICATION
   }}}

== Configuration de SOGo ==
 * modification de la config SOGo :
  {{{
defaults -u sogo write sogod SOGoAuthenticationType "saml2"
defaults -u sogo write sogod SOGoSAML2PrivateKeyLocation "/etc/ssl/private/saml-sogo-test-saml.ca.auf.org-key.pem"
defaults -u sogo write sogod SOGoSAML2CertiticateLocation "/etc/ssl/certs/saml-sogo-test-saml.ca.auf.org-cert.pem"
defaults -u sogo write sogod SOGoSAML2IdpMetadataLocation "/etc/ssl/saml-id.auf.org-metadata.xml"
defaults -u sogo write sogod SOGoSAML2IdpPublicKeyLocation "/etc/ssl/certs/_.auf.org-cert.pem"
defaults -u sogo write sogod SOGoSAML2IdpCertificateLocation "etc/ssl/certs/GandiStandardSSLCA.pem"
defaults -u sogo write sogod SOGoSAML2LogoutEnabled yes
defaults -u sogo write sogod NGImap4AuthMechanism "SAML"
  }}}

 * restart de SOGo
 * test N°1 : récupération des métadata : https://sogo-test-saml.ca.auf.org/SOGo/saml2-metadata
  {{{
Feb 19 16:41:35 sogod [31252]: |SOGo| starting method 'GET' on uri '/SOGo/saml2-metadata'
Feb 19 16:41:35 sogod [31252]: [ERROR] [so-action 0x0xb8623808 SOGoSAML2Actions] did not find action class: SOGoSAML2Actions
Feb 19 16:41:35 sogod [31252]: [ERROR] [so-action 0x0xb8354ef8 SOGoSAML2Actions] did not find method 'SOGoSAML2Actions'
2013-02-19 16:41:35.370 sogod[31252] <MySQL4Channel[0x0xb83876f0] connection=0x0xb82430b8> SQL: SELECT * FROM auf_users WHERE (c_uid = 'saml2-metadata') OR (mail_pays = 'saml2-metadata') OR (mail = 'saml2-metadata');
2013-02-19 16:41:35.370 sogod[31252] <MySQL4Channel[0x0xb83876f0] connection=0x0xb82430b8> query has results, entering fetch-mode.
2013-02-19 16:41:35.370 sogod[31252] <MySQL4Channel[0x0xb83876f0] connection=0x0xb82430b8> SQL: SELECT c_uid FROM auf_users WHERE (c_uid = 'saml2-metadata') AND (source = 'LOCAL');
2013-02-19 16:41:35.371 sogod[31252] <MySQL4Channel[0x0xb83876f0] connection=0x0xb82430b8> query has results, entering fetch-mode.
Feb 19 16:41:35 sogod [31252]: [ERROR] [so-action 0x0xb85eb460 SOGoSAML2Actions] did not find action class: SOGoSAML2Actions
Feb 19 16:41:35 sogod [31252]: [ERROR] [so-action 0x0xb8354ef8 SOGoSAML2Actions] did not find method 'SOGoSAML2Actions'
Feb 19 16:41:35 sogod [31252]: [ERROR] [so-action 0x0xb85a2670 SOGoSAML2Actions] did not find action class: SOGoSAML2Actions
Feb 19 16:41:35 sogod [31252]: [ERROR] [so-action 0x0xb8354ef8 SOGoSAML2Actions] did not find method 'SOGoSAML2Actions'
Feb 19 16:41:35 sogod [31252]: |SOGo| request took 0.002779 seconds to execute
10.36.1.4 - - [19/Feb/2013:16:41:35 GMT] "GET /SOGo/saml2-metadata HTTP/1.1" 404 43/0 0.004 - - 0
  }}}

== Travaux/Déboggage avec Inverse ==

 * fichier de métadata
  {{{
> Pourrais-tu m'en générer un pour que je puisse tester?

Voici un exemple ci-joint.

Je l'ai construit à partir d'un exemple réel, que tu peux aussi consulter ici : https://informatique.auf.org/mellon/metadata
  }}}
  {{{
... mais j'ai dû d'abord finaliser les méta-données en y ajoutant la clé pub
  }}}
  {{{
Pour des raisons _de tests_, le fichier xml est dans /usr/sbin/Resources/sogod/Resources/
  }}}



----
 * Pour mémoire
  * lasso (https://dev.entrouvert.org/lasso/lasso-2.3.6.tar.gz)
   * pré-requis :
    * aptitude install zlib1g-dev
    * aptitude install pkg-config
    * `configure: error: Package requirements (glib-2.0 >= 2.4.0 gobject-2.0 >= 2.4.0 libxml-2.0 xmlsec1 >= 1.2.6 xmlsec1-openssl >= 1.2.6 openssl) were not met` :
     * aptitude install libglib2.0-dev (==> glib-2.0 >= 2.4.0 gobject-2.0)
     * aptitude install libxmlsec1-dev ==> libxml-2.0 xmlsec1 >= 1.2.6 xmlsec1-openssl >= 1.2.6 openssl
   * appliquer le patch de Inverse : `patch -p0 lasso-export.diff`
   * lire le `INSTALL` pour l'installation (./configure ; make ; make install)
  * make install de crudesaml
Ligne 141: Ligne 210:
  * les librairies aux bons endroits :
   {{{
root@sogo-test-saml:/usr/lib/sasl2# cp -a /lib/sasl2/* /usr/lib/sasl2/
root@sogo-test-saml:/usr/lib/sasl2# cp -a /usr/lib/security/pam_saml.so.0.2.0 /lib/security/
   }}}
  * vérification
   {{{
root@sogo-test-saml:/usr/lib/sasl2# saslpluginviewer
Plugin "saml" [loaded], API version: 4
        SASL mechanism: SAML, best SSF: 0
        security flags: NO_ANONYMOUS
        features: WANT_CLIENT_FIRST|PROXY_AUTHENTICATION
   }}}

== Configuration de SOGo ==
 * modification de la config SOGo :
  {{{
defaults -u sogo write sogod SOGoAuthenticationType "saml2"
defaults -u sogo write sogod SOGoSAML2PrivateKeyLocation "/etc/ssl/certs/saml-sogo-test-saml.ca.auf.org-cert.pem"
defaults -u sogo write sogod SOGoSAML2CertiticateLocation "/etc/ssl/private/saml-sogo-test-saml.ca.auf.org-key.pem"
defaults -u sogo write sogod SOGoSAML2IdpMetadataLocation "/etc/ssl/saml-id.auf.org-metadata.xml"
defaults -u sogo write sogod SOGoSAML2IdpPublicKeyLocation "/etc/ssl/certs/_.auf.org-cert.pem"
defaults -u sogo write sogod SOGoSAML2IdpCertificateLocation "etc/ssl/certs/GandiStandardSSLCA.pem"
defaults -u sogo write sogod SOGoSAML2LogoutEnabled yes
defaults -u sogo write sogod NGImap4AuthMechanism "SAML"
  }}}

A VOIR : SOGoSAML2IdpPublicKeyLocation et SOGoSAML2IdpCertificateLocation ont été positionnés sur les certificats utilisés par id.auf.org.
 . est-ce bien ça qu'il faut mettre ici ?

 * restart de SOGo
 * test N°1 : récupération des métadata : https://sogo-test-saml.ca.auf.org/SOGo/saml2-metadata
  {{{
Feb 19 16:41:35 sogod [31252]: |SOGo| starting method 'GET' on uri '/SOGo/saml2-metadata'
Feb 19 16:41:35 sogod [31252]: [ERROR] [so-action 0x0xb8623808 SOGoSAML2Actions] did not find action class: SOGoSAML2Actions
Feb 19 16:41:35 sogod [31252]: [ERROR] [so-action 0x0xb8354ef8 SOGoSAML2Actions] did not find method 'SOGoSAML2Actions'
2013-02-19 16:41:35.370 sogod[31252] <MySQL4Channel[0x0xb83876f0] connection=0x0xb82430b8> SQL: SELECT * FROM auf_users WHERE (c_uid = 'saml2-metadata') OR (mail_pays = 'saml2-metadata') OR (mail = 'saml2-metadata');
2013-02-19 16:41:35.370 sogod[31252] <MySQL4Channel[0x0xb83876f0] connection=0x0xb82430b8> query has results, entering fetch-mode.
2013-02-19 16:41:35.370 sogod[31252] <MySQL4Channel[0x0xb83876f0] connection=0x0xb82430b8> SQL: SELECT c_uid FROM auf_users WHERE (c_uid = 'saml2-metadata') AND (source = 'LOCAL');
2013-02-19 16:41:35.371 sogod[31252] <MySQL4Channel[0x0xb83876f0] connection=0x0xb82430b8> query has results, entering fetch-mode.
Feb 19 16:41:35 sogod [31252]: [ERROR] [so-action 0x0xb85eb460 SOGoSAML2Actions] did not find action class: SOGoSAML2Actions
Feb 19 16:41:35 sogod [31252]: [ERROR] [so-action 0x0xb8354ef8 SOGoSAML2Actions] did not find method 'SOGoSAML2Actions'
Feb 19 16:41:35 sogod [31252]: [ERROR] [so-action 0x0xb85a2670 SOGoSAML2Actions] did not find action class: SOGoSAML2Actions
Feb 19 16:41:35 sogod [31252]: [ERROR] [so-action 0x0xb8354ef8 SOGoSAML2Actions] did not find method 'SOGoSAML2Actions'
Feb 19 16:41:35 sogod [31252]: |SOGo| request took 0.002779 seconds to execute
10.36.1.4 - - [19/Feb/2013:16:41:35 GMT] "GET /SOGo/saml2-metadata HTTP/1.1" 404 43/0 0.004 - - 0
  }}}

Tests d'intégration SOGo et SAML

Échanges avec Inverse

Le mainteneur de CrudeSAML a publié une nouvelle version avec mes correctifs:

http://ftp.espci.fr/pub/crudesaml/crudesaml-1.4.tar.gz

********

J'ai terminé l'implémentation du support SAML dans SOGo en vue de se 
connecter à Dovecot via le module PAM/SASL crudesaml.

À l'aide de l'auteur de crudesaml, j'ai dû adapter le code de trois 
composants (en plus de SOGo):
- Dovecot pour accepter des "mots de passe" de plus de 1000 caractères
- liblasso pour qu'il exporte la fonction utilisée par crudesaml
- crudesaml pour réduire le nombre de warnings et de prototypes mal 
configurés lors de la compilation.

Je joins ces patches à ce message, même si j'ai déja envoyé l'un d'eux à 
Jean-Christophe.

Au niveau de SOGo, la fonctionnalité sera présente dans la version 2.0.3 
de SOGo. Et le guide d'installation a été mis à jour concernant les 
nouvelles directives de configuration.

Notez que j'ai utilisé simplesamlphp comme idp. Je vous suggèrerais de 
tester les nightly builds de demain pour corriger tout éventuel problème 
le plus vite possible.

*********

>> Peux-tu me dire quelle patch ne s'applique pas correctement? 
> Celui pour Dovecot, qui est super simple (1 seule ligne) avec Dovecot 2.x (Debian testing) mais pour lequel nous n'avons pas trouvé d'équivalent dans le code source de Dovecot 1.x (Debian stable). 
Avec v1.2, ca devrait fonctionner, car on a dans le code:

./src/login-common/client-common.h:#define LOGIN_MAX_INBUF_SIZE 8192 

Serveur de test

  • copie du CT sogo-test.ca.auf.org ==> sogo-test-saml.ca.auf.org

  • installation en local de : dovecot-imapd (1:1.2.15-7) + postfix
  • sogo (nightly) : 2.0.0.20130218-1

installation des paquets requis

  • aptitude install liblasso3 (celui de apt.auf.org)
  • crudesaml (http://ftp.espci.fr/pub/crudesaml/crudesaml-1.4.tar.gz)

    • pré-requis :
      • aptitude install libsasl2-dev
      • aptitude install libpam0g-dev
      • modif du fichier plugin_common.h
        • #include <saslplug.h> :
          +typedef int (*sasl_callback_ft)(void);
      • ./configure && make && make install

    • les librairies aux bons endroits :
      • root@sogo-test-saml:/usr/lib/sasl2# cp -a /lib/sasl2/* /usr/lib/sasl2/
        root@sogo-test-saml:/usr/lib/sasl2# cp -a /usr/lib/security/pam_saml.so.0.2.0 /lib/security/pam_saml.so
    • vérification
      • root@sogo-test-saml:/usr/lib/sasl2# saslpluginviewer
        Plugin "saml" [loaded],         API version: 4
                SASL mechanism: SAML, best SSF: 0
                security flags: NO_ANONYMOUS
                features: WANT_CLIENT_FIRST|PROXY_AUTHENTICATION

Configuration de SOGo

  • modification de la config SOGo :
    • defaults -u sogo write sogod SOGoAuthenticationType "saml2"
      defaults -u sogo write sogod SOGoSAML2PrivateKeyLocation "/etc/ssl/private/saml-sogo-test-saml.ca.auf.org-key.pem"
      defaults -u sogo write sogod SOGoSAML2CertiticateLocation "/etc/ssl/certs/saml-sogo-test-saml.ca.auf.org-cert.pem"
      defaults -u sogo write sogod SOGoSAML2IdpMetadataLocation "/etc/ssl/saml-id.auf.org-metadata.xml"
      defaults -u sogo write sogod SOGoSAML2IdpPublicKeyLocation "/etc/ssl/certs/_.auf.org-cert.pem"
      defaults -u sogo write sogod SOGoSAML2IdpCertificateLocation "etc/ssl/certs/GandiStandardSSLCA.pem"
      defaults -u sogo write sogod SOGoSAML2LogoutEnabled yes
      defaults -u sogo write sogod NGImap4AuthMechanism "SAML"
  • restart de SOGo
  • test N°1 : récupération des métadata : https://sogo-test-saml.ca.auf.org/SOGo/saml2-metadata

    • Feb 19 16:41:35 sogod [31252]: |SOGo| starting method 'GET' on uri '/SOGo/saml2-metadata'
      Feb 19 16:41:35 sogod [31252]: [ERROR] [so-action 0x0xb8623808 SOGoSAML2Actions] did not find action class: SOGoSAML2Actions
      Feb 19 16:41:35 sogod [31252]: [ERROR] [so-action 0x0xb8354ef8 SOGoSAML2Actions] did not find method 'SOGoSAML2Actions'
      2013-02-19 16:41:35.370 sogod[31252] <MySQL4Channel[0x0xb83876f0] connection=0x0xb82430b8> SQL: SELECT * FROM auf_users WHERE (c_uid = 'saml2-metadata') OR (mail_pays = 'saml2-metadata') OR (mail = 'saml2-metadata');
      2013-02-19 16:41:35.370 sogod[31252] <MySQL4Channel[0x0xb83876f0] connection=0x0xb82430b8>   query has results, entering fetch-mode.
      2013-02-19 16:41:35.370 sogod[31252] <MySQL4Channel[0x0xb83876f0] connection=0x0xb82430b8> SQL: SELECT c_uid FROM auf_users WHERE (c_uid = 'saml2-metadata') AND (source = 'LOCAL');
      2013-02-19 16:41:35.371 sogod[31252] <MySQL4Channel[0x0xb83876f0] connection=0x0xb82430b8>   query has results, entering fetch-mode.
      Feb 19 16:41:35 sogod [31252]: [ERROR] [so-action 0x0xb85eb460 SOGoSAML2Actions] did not find action class: SOGoSAML2Actions
      Feb 19 16:41:35 sogod [31252]: [ERROR] [so-action 0x0xb8354ef8 SOGoSAML2Actions] did not find method 'SOGoSAML2Actions'
      Feb 19 16:41:35 sogod [31252]: [ERROR] [so-action 0x0xb85a2670 SOGoSAML2Actions] did not find action class: SOGoSAML2Actions
      Feb 19 16:41:35 sogod [31252]: [ERROR] [so-action 0x0xb8354ef8 SOGoSAML2Actions] did not find method 'SOGoSAML2Actions'
      Feb 19 16:41:35 sogod [31252]: |SOGo| request took 0.002779 seconds to execute
      10.36.1.4 - - [19/Feb/2013:16:41:35 GMT] "GET /SOGo/saml2-metadata HTTP/1.1" 404 43/0 0.004 - - 0

Travaux/Déboggage avec Inverse

  • fichier de métadata
    • > Pourrais-tu m'en générer un pour que je puisse tester?
      
      Voici un exemple ci-joint.
      
      Je l'ai construit à partir d'un exemple réel, que tu peux aussi consulter ici : https://informatique.auf.org/mellon/metadata 
      ... mais j'ai dû d'abord finaliser les méta-données en y ajoutant la clé pub
      Pour des raisons _de tests_, le fichier xml est dans /usr/sbin/Resources/sogod/Resources/ 


  • Pour mémoire
    • lasso (https://dev.entrouvert.org/lasso/lasso-2.3.6.tar.gz)

      • pré-requis :
        • aptitude install zlib1g-dev
        • aptitude install pkg-config
        • configure: error: Package requirements (glib-2.0 >= 2.4.0 gobject-2.0 >= 2.4.0 libxml-2.0 xmlsec1 >= 1.2.6 xmlsec1-openssl >= 1.2.6 openssl) were not met :

          • aptitude install libglib2.0-dev (==> glib-2.0 >= 2.4.0 gobject-2.0)

          • aptitude install libxmlsec1-dev ==> libxml-2.0 xmlsec1 >= 1.2.6 xmlsec1-openssl >= 1.2.6 openssl

      • appliquer le patch de Inverse : patch -p0 lasso-export.diff

      • lire le INSTALL pour l'installation (./configure ; make ; make install)

    • make install de crudesaml
      • root@sogo-test-saml:/usr/local/src/crudesaml-1.4# make install
        make[1]: entrant dans le répertoire « /usr/local/src/crudesaml-1.4 »
        make[1]: Rien à faire pour « install-exec-am ».
         /bin/mkdir -p '/usr/local/share/man/man5'
         /usr/bin/install -c -m 644 pam_saml.5 cy2_saml.5 '/usr/local/share/man/man5'
         /bin/mkdir -p '/lib/sasl2'
         /bin/bash ./libtool   --mode=install /usr/bin/install -c   libsaml.la '/lib/sasl2'   
        libtool: install: /usr/bin/install -c .libs/libsaml.so.0.2.0 /lib/sasl2/libsaml.so.0.2.0
        libtool: install: (cd /lib/sasl2 && { ln -s -f libsaml.so.0.2.0 libsaml.so.0 || { rm -f libsaml.so.0 && ln -s li
        })
        libtool: install: (cd /lib/sasl2 && { ln -s -f libsaml.so.0.2.0 libsaml.so || { rm -f libsaml.so && ln -s libsam
        libtool: install: /usr/bin/install -c .libs/libsaml.lai /lib/sasl2/libsaml.la
        libtool: install: /usr/bin/install -c .libs/libsaml.a /lib/sasl2/libsaml.a
        libtool: install: chmod 644 /lib/sasl2/libsaml.a
        libtool: install: ranlib /lib/sasl2/libsaml.a
        libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin" ldconfig -n /lib/sasl
        ----------------------------------------------------------------------
        Libraries have been installed in:
           /lib/sasl2
        
        If you ever happen to want to link against installed libraries
        in a given directory, LIBDIR, you must either use libtool, and
        specify the full pathname of the library, or use the `-LLIBDIR'
        flag during linking and do at least one of the following:
           - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
             during execution
           - add LIBDIR to the `LD_RUN_PATH' environment variable
             during linking
           - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
           - have your system administrator add LIBDIR to `/etc/ld.so.conf'
        
        
        See any operating system documentation about shared libraries for
        more information, such as the ld(1) and ld.so(8) manual pages.
        ----------------------------------------------------------------------
         /bin/mkdir -p '/usr/local/lib/security'
         /bin/bash ./libtool   --mode=install /usr/bin/install -c   pam_saml.la '/usr/local/lib/security'
        libtool: install: /usr/bin/install -c .libs/pam_saml.so.0.2.0 /usr/local/lib/security/pam_saml.so.0.2.0
        libtool: install: (cd /usr/local/lib/security && { ln -s -f pam_saml.so.0.2.0 pam_saml.so.0 || { rm -f pam_saml.
        pam_saml.so.0; }; })
        libtool: install: (cd /usr/local/lib/security && { ln -s -f pam_saml.so.0.2.0 pam_saml.so || { rm -f pam_saml.so
        saml.so; }; })
        libtool: install: /usr/bin/install -c .libs/pam_saml.lai /usr/local/lib/security/pam_saml.la
        libtool: install: /usr/bin/install -c .libs/pam_saml.a /usr/local/lib/security/pam_saml.a
        libtool: install: chmod 644 /usr/local/lib/security/pam_saml.a
        libtool: install: ranlib /usr/local/lib/security/pam_saml.a
        libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin" ldconfig -n /usr/loca
        ----------------------------------------------------------------------
        Libraries have been installed in:
           /usr/local/lib/security
        
        If you ever happen to want to link against installed libraries
        in a given directory, LIBDIR, you must either use libtool, and
        specify the full pathname of the library, or use the `-LLIBDIR'
        flag during linking and do at least one of the following:
           - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
             during execution
           - add LIBDIR to the `LD_RUN_PATH' environment variable
             during linking
           - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
           - have your system administrator add LIBDIR to `/etc/ld.so.conf'
        
        See any operating system documentation about shared libraries for
        more information, such as the ld(1) and ld.so(8) manual pages.
        ----------------------------------------------------------------------
        make[1]: quittant le répertoire « /usr/local/src/crudesaml-1.4 »
        root@sogo-test-saml:/usr/local/src/crudesaml-1.4#

Projet/SOGo/TestsSAML (dernière édition le 2016-02-03 15:49:47 par MoussaNombre)