„WebmailShibboleth” változatai közötti eltérés

Innen: KIFÜ Wiki
(IdP plugin)
(IdP plugin)
63. sor: 63. sor:
 
   <resolver:DataConnector xsi:type="otp:OTP"
 
   <resolver:DataConnector xsi:type="otp:OTP"
 
     id="otpConnector"
 
     id="otpConnector"
     sourceAttributeID="uid"
+
     sourceAttributeID="uid"       <!-- principalname attributum -->
     generatedAttributeID="otp"
+
     generatedAttributeID="otp"     <!-- generalt jelszo attributum -->
     tableName="otp"
+
     tableName="otp"               <!-- adatbazis tabla neve -->
     principalColumn="uid"
+
     principalColumn="uid"         <!-- felhasznalonev mezo -->
     passwordColumn="password"
+
     passwordColumn="password"     <!-- jelszo mezo -->
     expirationColumn="expiration"
+
     expirationColumn="expiration" <!-- jelszo lejarati idopont mezo -->
     passwordLifetime="400"
+
     passwordLifetime="400"         <!-- jelszo lejarati ideje masodpercben -->
     spEntityID="https://papigw.aai.niif.hu/shibboleth" >
+
     spEntityID="https://papigw.aai.niif.hu/shibboleth" >  <!-- melyik SP-re generalodjon jelszo -->
     <resolver:Dependency ref="myLDAP" />
+
 
      <dc:ApplicationManagedConnection
+
     <resolver:Dependency ref="myLDAP" /> <!-- LDAP dataconnector fuggoseg kell az uid mezo miatt -->
 +
 
 +
    <dc:ApplicationManagedConnection     <!-- adatbazis eleresi parameterek -->
 
         jdbcDriver="com.mysql.jdbc.Driver"
 
         jdbcDriver="com.mysql.jdbc.Driver"
 
         jdbcURL="jdbc:mysql://localhost:3306/shib_idp"
 
         jdbcURL="jdbc:mysql://localhost:3306/shib_idp"
78. sor: 80. sor:
 
         jdbcPassword="*****" />
 
         jdbcPassword="*****" />
 
   </resolver:DataConnector>
 
   </resolver:DataConnector>
 +
</source>
 +
 +
Az attribute-filter.xml -ben pedig ki kell engedni az uid és otp attribútumokat a webmail sp-nek:
 +
<source lang="xml">
 +
<AttributeRule attributeID="otp">
 +
  <PermitValueRule xsi:type="basic:AttributeRequesterString"
 +
      value="https://webmail.example.org/shibboleth" />
 +
</AttributeRule>
 +
<AttributeRule attributeID="uid">
 +
  <PermitValueRule xsi:type="basic:AttributeRequesterString"
 +
      value="https://webmail.example.org/shibboleth" />
 +
</AttributeRule>
 
</source>
 
</source>
  

A lap 2009. április 2., 14:21-kori változata

Webmail szoftverek illesztése Shibboleth-hez

Koncepció

A webmail és a levelezőszerver (IMAP/POP3) együttes működését szeretnénk Shibbolizálni. A fő probléma abból áll, hogy a webmail az IMAP szerver felé felhasználónévvel és jelszóval autentikál. Az címtárban tárolt jelszót azonban nem adhatjuk ki az alkalmazásoknak, ráadásul legtöbb esetben ez egy hashelt jelszó.

A következő kritériumoknak kell teljesülniük:

  • a webmail nem fér hozzá a felhasználó SSO jelszavához (még hashelt formátumban sem)
  • az IMAP szerver jelszavas autentikációt használ, minden felhasználónak egyedi jelszava van
  • a webmail feltörése esetén nem férhetnek hozzá az összes felhasználó levelezéséhez

A fenti kritériumokat az 'egyszer használatos', rövid lejárató jelszó használata kielégíti. Ebben az esetben az IdP minden egyes webmail bejelentkezéshez generál egy véletlen jelszót, és ezt elmenti egy adatbázisban, (beállítva a jelszóhoz egy rövid lejárati időt) valamint elküldi a webmail SP-nek. A webmail ezen rövid lejáratú jelszó használatával autentikál az IMAP szerver felé.

A leírt gondolatmenet megvalósításához három komponens együttműködése szükséges:

  • az IdP jelszót kell generáljon egy adatbázisba
  • a webmailnek el kell érnie ezt a jelszót
  • az IMAP szervernek a jelszóadatbázist kell használnia az autentikációra

Adatbázis struktúra

MySQL használata esetén a következő adatbázisstruktúra használható:

CREATE TABLE `otp` (
  `uid` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  `expiration` datetime NOT NULL,
  PRIMARY KEY  (`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1

IdP plugin

Az attribute-resolver.xml -ben a következő változtatásokat kell megtenni:

 <!--xml semak megfelelo beallitasa -->
 <AttributeResolver
   ....
   xmlns:otp="urn:geant:niif.hu:dataconnector"
   xsi:schemaLocation="
       ....
       urn:geant:niif.hu:dataconnector classpath:/schema/otpdataconnector.xsd">

  <!-- onetimepassword definicio -->
  <resolver:AttributeDefinition id="otp" xsi:type="Simple" 
    xmlns="urn:mace:shibboleth:2.0:resolver:ad"
    sourceAttributeID="otp">
    
    <resolver:Dependency ref="otpConnector" />

    <resolver:AttributeEncoder xsi:type="SAML2String" 
        xmlns="urn:mace:shibboleth:2.0:attribute:encoder"
        name="urn:geant:niif.hu:otp" friendlyName="otp" />
  </resolver:AttributeDefinition>

  <!-- uid definicio -->
  <resolver:AttributeDefinition id="uid" xsi:type="Simple" xmlns="urn:mace:shibboleth:2.0:resolver:ad"
     sourceAttributeID="uid">
    <resolver:Dependency ref="myLDAP" />
    <resolver:AttributeEncoder xsi:type="SAML1String" xmlns="urn:mace:shibboleth:2.0:attribute:encoder"
        name="urn:mace:dir:attribute-def:uid" />
    <resolver:AttributeEncoder xsi:type="SAML2String" xmlns="urn:mace:shibboleth:2.0:attribute:encoder"
        name="urn:oid:0.9.2342.19200300.100.1.1" friendlyName="uid" />
  </resolver:AttributeDefinition>

  <!-- one time password generalasa -->
  <resolver:DataConnector xsi:type="otp:OTP"
    id="otpConnector"
    sourceAttributeID="uid"        <!-- principalname attributum -->
    generatedAttributeID="otp"     <!-- generalt jelszo attributum -->
    tableName="otp"                <!-- adatbazis tabla neve -->
    principalColumn="uid"          <!-- felhasznalonev mezo -->
    passwordColumn="password"      <!-- jelszo mezo -->
    expirationColumn="expiration"  <!-- jelszo lejarati idopont mezo -->
    passwordLifetime="400"         <!-- jelszo lejarati ideje masodpercben -->
    spEntityID="https://papigw.aai.niif.hu/shibboleth" >  <!-- melyik SP-re generalodjon jelszo -->

    <resolver:Dependency ref="myLDAP" /> <!-- LDAP dataconnector fuggoseg kell az uid mezo miatt -->

    <dc:ApplicationManagedConnection     <!-- adatbazis eleresi parameterek -->
        jdbcDriver="com.mysql.jdbc.Driver"
        jdbcURL="jdbc:mysql://localhost:3306/shib_idp"
        jdbcUserName="*****"
        jdbcPassword="*****" />
  </resolver:DataConnector>

Az attribute-filter.xml -ben pedig ki kell engedni az uid és otp attribútumokat a webmail sp-nek:

 <AttributeRule attributeID="otp">
   <PermitValueRule xsi:type="basic:AttributeRequesterString"
       value="https://webmail.example.org/shibboleth" />
 </AttributeRule>
 <AttributeRule attributeID="uid">
   <PermitValueRule xsi:type="basic:AttributeRequesterString" 
       value="https://webmail.example.org/shibboleth" />
 </AttributeRule>

IMAP konfiguráció (Cyrus imapd)

SP konfiguráció

Webmail szoftverek konfigurációja

Squirrelmail