diff --git a/build/lemonldap-ng/Makefile b/build/lemonldap-ng/Makefile index 2d7cecad0..445914e33 100644 --- a/build/lemonldap-ng/Makefile +++ b/build/lemonldap-ng/Makefile @@ -154,3 +154,6 @@ static_example: example cd ${EXAMPLEDIRBUILD}/static/;ln -s ../manager/imgs;cd - scripts/make_static_example.pl ${EXAMPLEDIRBUILD}/manager/index.pl ${EXAMPLEDIRBUILD}/static/index.html $(EXAMPLELANG) +documentation: + cd doc && ../scripts/doc.pl + diff --git a/build/lemonldap-ng/TODO b/build/lemonldap-ng/TODO index acc95bd27..623138e1e 100644 --- a/build/lemonldap-ng/TODO +++ b/build/lemonldap-ng/TODO @@ -24,3 +24,5 @@ Order rules : Documentation : * Translate FAQ in English (http://lemonldap.objectweb.org/) * Security document + * AD Howto + * apply.conf Howto diff --git a/build/lemonldap-ng/debian/changelog b/build/lemonldap-ng/debian/changelog index 34d4f3a20..6be4de2ef 100644 --- a/build/lemonldap-ng/debian/changelog +++ b/build/lemonldap-ng/debian/changelog @@ -1,3 +1,10 @@ +lemonldap-ng (0.8.2.1) unstable; urgency=low + + * More documentation + * Virtual host names control + + -- Xavier Guimard Fri, 11 May 2007 09:49:20 +0200 + lemonldap-ng (0.8.2) unstable; urgency=low * Little bug fix if whatToTrace parameter is not defined and display it in diff --git a/build/lemonldap-ng/debian/configStorage.pm b/build/lemonldap-ng/debian/configStorage.pm index 136e461a6..04cb0e22a 100644 --- a/build/lemonldap-ng/debian/configStorage.pm +++ b/build/lemonldap-ng/debian/configStorage.pm @@ -7,14 +7,14 @@ our $configStorage; BEGIN { open F, '/etc/lemonldap-ng/storage.conf' or die "/etc/lemonldap-ng/storage.conf: $!"; while() { - next if(/^\s*$/ or /^\s*#/); - chomp; - /^\s*([\w]+)[\s=:]+(["']?)([\S].*[\S])\2.*$/ or next; - $configStorage->{$1} = $3; - my $k = $1; - if($configStorage->{$k} =~ /^([{\[]).*[}\]]$/) { - eval "\$configStorage->{$k} = $configStorage->{$k}"; - } + next if(/^\s*$/ or /^\s*#/); + chomp; + /^\s*([\w]+)\s*[=:]\s*(["']?)([\S].*[\S])\2.*$/ or next; + $configStorage->{$1} = $3; + my $k = $1; + if($configStorage->{$k} =~ /^([{\[]).*[}\]]$/) { + eval "\$configStorage->{$k} = $configStorage->{$k}"; + } } close F; } diff --git a/build/lemonldap-ng/debian/storage.conf b/build/lemonldap-ng/debian/storage.conf index 1bea664a5..0054896ac 100644 --- a/build/lemonldap-ng/debian/storage.conf +++ b/build/lemonldap-ng/debian/storage.conf @@ -23,6 +23,8 @@ # type = SOAP # proxy = https://manager.example.com/soapmanager.pl # proxyOptions = { timeout => 5 } +# User = lemonldap +# Password = mypassword type = File dirName = /var/lib/lemonldap-ng/conf diff --git a/build/lemonldap-ng/doc/advanced-install.html b/build/lemonldap-ng/doc/advanced-install.html new file mode 100644 index 000000000..77b80161a --- /dev/null +++ b/build/lemonldap-ng/doc/advanced-install.html @@ -0,0 +1,377 @@ + + + + + + + + FAQ LEMONLDAP::NG + + + + +
+

ADVANCED + INSTALLATION

+ +

Warning: This + document is written for people who know Lemonldap::NG. For other people, + it is recommended to build the example provided in the + source and next to adapt it to local installation. + +

+ + + +

PREREQ

+ +

Apache

+ +

To use Lemonldap::NG, you have to run a LDAP + server and of course an Apache server compiled with mod-perl (version 1.3 + or 2.x). Generaly, the version of Apache proposed with your Linux + distribution match, but some distributions used an experimental version of + mod_perl with Apache2 (mod_perl-1.99) which does not work with + Lemonldap::NG. With such distributions (like Debian-3.1), you have to use + Apache-1.3 or to use a mod_perl backport (www.backports.org package for + Debian works fine). + +

For Apache2, you can use both mpm-worker and + mpm-prefork. Mpm-worker works faster and Lemonldap::NG use the thread + system for best performance. If you have to use mpm-prefork (for example + if you use PHP), Lemonldap::NG will work anyway. + +

You can use Lemonldap::NG in an heterogene world: + the authentication portal and the manager can work in any version of + Apache 1.3 or more even if mod_perl is not compiled, with + ModPerl::Registry or not… Only the handler (site protector) need + mod_perl. The different handlers can run on different servers with + different versions of Apache/mod_perl. + +

Perl prereq

+ +

Perl modules: Apache::Session, Net::LDAP, + MIME::Base64, CGI, LWP::UserAgent, Cache::Cache, DBI, XML::Simple + +

With Debian: + +

+ +
+
+apt-get install libapache-session-perl libnet-ldap-perl libcache-cache-perl 
+                  libdbi-perl perl-modules libwww-perl libcache-cache-perl 
+                  libxml-simple-perl
+
+
+ +

Portal: + +

Apache::Session, Net::LDAP, MIME::Base64, CGI, + DBI + +

With Debian: + +

+ +
+
+apt-get install libapache-session-perl libnet-ldap-perl libdbi-perl 
+                  perl-modules
+
+
+ +

Handler: + +

Apache::Session, LWP::UserAgent, Cache::Cache, + DBI + +

With Debian: + +

+ +
+
+apt-get install libapache-session-perl libdbi-perl libwww-perl 
+                  libcache-cache-perl
+
+
+ +

Manager: + +

CGI, XML::Simple, DBI + +

With Debian: + +

+ +
+
+apt-get install perl-modules libxml-simple-perl
+
+
+ +

SOFTWARE + INSTALLATION

+ +

If you just want to install a handler or a portal + or a manager: + +

+ +
+
+$ tar xzf lemonldap-ng-*.tar.gz
+  $ cd lemonldap-ng-*/Lemonldap-NG-(Portal|Handler|Manager)
+  $ perl Makefile.PL && make && make test
+  $ sudo make install
+
+
+ +

else for a complete install: + +

+ +
+
+$ tar xzf lemonldap-ng-*.tar.gz
+  $ cd lemonldap-ng-*
+  $ make && make test
+  $ sudo make install
+
+
+ +

See prereq in + +

LEMONLDAP + INSTALLATION

+ +

Database + configuration

If you use DBI or another system to share + Lemonldap::NG configuration, you have to initialize the database. + +

For example, create the database "lemonldapng" : + +

+ +
+
+# mysqladmin create lemonldapng
+
+
+ +
Lemonldap::NG Configuration + database
+ +

To store configuration, use this table : + +

+ +
+
+CREATE TABLE lmConfig (
+     cfgNum int not null primary key,
+     locationRules text,
+     exportedHeaders text,
+     globalStorage text,
+     globalStorageOptions text,
+     macros text,
+     groups text,
+     portal text,
+     domain text,
+     ldapServer text,
+     ldapPort int,
+     ldapBase text,
+     securedCookie int,
+     cookieName text,
+     authentication text,
+     exportedVars text,
+     managerDn text,
+     managerPassword text,
+     whatToTrace text
+     );
+
+
+ +
Apache::Session database
+ +

The choice of Apache::Session::* module is free. + See Apache::Session::Store::* or Apache::Session::* to know how to + configure the module. For example, if you want to use + Apache::Session::MySQL, you can create the database like this: + +

+ +
+
+CREATE TABLE sessions (
+    id char(32),
+    a_session text
+    );
+
+
+ +

Manager + configuration

+ +

Copy example/manager.cgi and personalize it if + you want (see Lemonldap::NG::Manager). You have to set in particular + configStorage. For example with MySQL: + +

+ +
+
+$my $manager = Lemonldap::NG::Manager->new ( {
+                        dbiChain   => "DBI:mysql:database=mybase;host=1.2.3.4",
+                        dbiUser    => "lemonldap-ng",
+                        dbiPasword => "mypass",
+                 } );
+
+
+ +

Securise Manager access with Apache: Lemonldap + does not securise the manager itself yet: + +

+ +
+
+SSLEngine On
+  Order Deny, Allow
+  Deny from all
+  Allow from admin/network
+  AuthType Basic
+  ...
+
+
+ +

Configuration + edition

+ +

Connect to the manager with your browser start + configure your Web-SSO. You have to set at least some parameters: + +
General + parameters
+ +
    +
  • Authentication parameters -> portal URL to access to the + authentication portal.
  • + +
  • Domain: the cookie domain. All protected VirtualHosts have to be + under it.
  • + +
  • LDAP parameters -> LDAP Server.
  • + +
  • LDAP parameters -> LDAP Accout and password: required only if + anonymous binds are not accepted.
  • + +
  • Session Storage -> Apache::Session module: how to store user + sessions. You can use all module that inherit from Apache::Session like + Apache::Session::MySQL.
  • + +
  • Session Storage -> Apache::Session Module parameters: see + Apache::Session::<Choosen module>.
  • +
+ +
User groups
+ +

Use the "New Group" button to add your first + group. On the left, set the keyword which will be used later and set on + the right the corresponding rule. You can use : + +
    +
  • an LDAP filter (it will be tested with the user uid)
  • +
or + +
    +
  • a Perl condition enclosed with {}. All variables declared in + "General parameters -> LDAP attributes" can be used with a "$". For + example: MyGroup / { $uid eq "foo" or $uid eq "bar" }
  • +
+ +
Virtual + hosts
+ +

You have to create a virtual host for each Apache + host (virtual or real) protected by Lemonldap::NG even if just a + sub-directory is protected. Else, user who want to access to the protected + area will be rejected with a "500 Internal Server Error" message and the + apache logs will explain the problem. + +

Each virtual host has 2 groups of parameters: + +
    +
  • Headers: the headers added to the apache request. Default: Auth-User + => $uid.
  • + +
  • Rules: subdivised in 2 categories: + +
      +
    • default: the default rule
    • + +
    • personalized rules: association of a Perl regular expression and + a condition. For example: ^/restricted.*$ / $groups =~ + /bMyGroupb/
    • +
    +
  • +
+
+ + diff --git a/build/lemonldap-ng/doc/faq-fr.html b/build/lemonldap-ng/doc/faq-fr.html new file mode 100644 index 000000000..f5fbea195 --- /dev/null +++ b/build/lemonldap-ng/doc/faq-fr.html @@ -0,0 +1,382 @@ + + + + + + + + FAQ LEMONLDAP::NG + + + + +
+

Foire + aux questions Lemonldap::NG

+ +

+ + + +

Lemonldap::NG

+ +

Qu'est-ce + qu'un Web-SSO ?

+ +

Un SSO (Single Sign On) est + un dispositif qui permet de partager les authentifications entre plusieurs + applications. L'utilisateur ne s'authentifie ainsi qu'une fois et n'est + pas interrompu lorsqu'il change d'application. Kerberos (utilisé + dans Active Directory) par exemple est un SSO. Le problème de ces + systèmes est qu'outre leur lourdeur, ils ne s'appliquent + qu'à des Intranets sur des machines relativement homogènes. + +

Le Web-SSO est le portage de ce principe + restreint aux applications Web. L'utilisateur est donc authentifié + au premier accès à une application web + protégée et les authentifications se propagent lorsqu'il + change d'application. Le gros avantage est alors que le système est + utilisable sur Internet sans pré-requis sur les postes clients (il + suffit d'accepter les cookies de session). Par exemple, lorsqu'un + utilisateur accède à une boîte-aux-lettres Google, il + n'est pas réauthentifié s'il accède à + l'application de gestion des groupes ou tout autre application Google. + +

Lemonldap::NG est un des systèmes + permettant la gestion du Web-SSO. + +

Qu'apporte + Lemonldap::NG par rapport aux autres SSO ?

+ +
    +
  • Lemonldap comme lemonldap::NG sont des modules Apache Perl et + offrent des performances qui rendent imperceptible le traitement de + l'accès.
  • + +
  • Un des autres points forts de Lemonldap::NG est sa capacité + à gérer les droits de façon centralisée: les + SSO type Kerberos ou CAS permettent le partage des authentifications + mais délèguent aux applications la gestion des + autorisations d'accès. Dans le cas de Lemonldap::NG, la gestion + des droits peut être centralisée totalement, en partie ou + pas du tout pour chaque application: Lemonldap::NG fournit un + système d'autorisations basé sur le tri des URL par + expressions régulières auquelles on associe une + règle. Il fournit également des en-têtes HTTP + à l'application contenant n'importe quel attribut issue de + l'annuaire LDAP. Celle-ci peut alors gérer la + traçabilité des accès et éventuellement des + droits d'accès (voir la + documentation AAA).
  • + +
  • Lemonldap::NG n'imose aucune modification de l'annuaire: les droits + sont calculés à partir de n'importe quel attribut.
  • + +
  • Lemonldap::NG peut publier n'importe quel attribut LDAP ou des + expressions calculées à partir de ces attributs dans les + en-têtes HTTP. On peut ainsi éviter aux applications + d'avoir à consulter l'annuaire LDAP.
  • + +
  • Lemonldap::NG traite tous les sites hébergés (virtuels + ou réels) indépendamment: on peut ainsi fournir à + chaque application des en-têtes personnalisés.
  • + +
  • Lemonldap::NG fournit une interface web d'administration + présentant simplement la configuration, les droits d'accès + et les en-têtes par site protégé (voir la + démonstration>http://lemonldap.objectweb.org/NG/ManagerDemo/fr/). + On peut également ne montrer qu'une partie de la configuration en + lecture seule et une autre en lecture écriture: l'interface + d'administration peut ainsi être partiellement + déléguée par site protégé.
  • +
+ +

Configuration

+ +

Quel système de + stockage de configuration choisir ?

+ +

Lemonldap::NG fournit 3 types de stockage de + configuration: + +
    +
  • File: le système le plus + simple, il ne permet en revanche de partager la configuration que parmi + les serveurs qui partagent un système de fichier. On peut ainsi + l'utiliser dans le cas où tous les VirtualHosts à + protéger se trouvent sur le même serveur,
  • + +
  • DBI: DBI(3) est + une couche d'abstraction de l'accès aux bases de données + fournie par Perl. Utilisée dans Lemonldap::NG, elle permet de + partager la configuration entre serveurs mais suppose que tous ces + serveurs accèdent à la même base de donnée. + C'est une solution recommandée pour partager la configuration sur + un réseau de serveurs,
  • + +
  • SOAP: Ce système n'est pas + à proprement parler un système de stockage, mais permet + à un serveur distant d'accéder à la configuration + par une simple connexion HTTP(S). Le serveur SOAP accède lui + à la configuration par un des systèmes + précédents (File ou DBI).
  • +
+ +

L'exemple fourni + fonctionne en HTTP, mais pas en HTTPS.

+ +

Dans le mécanisme des redirections vers le + portail puis vers le site protégé, il faut indiquer à + l'agent (handler) s'il est de type HTTPS ou non. Ceci est fait par le + paramètre https qui doit être mis à 1. Ce + paramètre n'est pas accessible dans la configuration (manager), car + il est spécifique aux hôtes virtuels. C'est donc lors de + l'appel à la fonction init (dans le fichier My::Package) + qu'il doit être renseigné: + +

+
+__PACKAGE__->init ( {
+    localStorage        => "Cache::FileCache",
+    localStorageOptions => {
+              'namespace'          => 'MyNamespace',
+              'default_expires_in' => 600,
+              'directory_umask'    => '007',
+              'cache_root'         => '/tmp',
+              'cache_depth'        => 5,
+    },
+    configStorage       => {
+              type                 => 'File',
+              dirName              => '/var/lib/lemonldap-ng/conf',
+    },
+    https               => 1,
+} );
+
+ +

Comment + faire fonctionner Lemonldap::NG avec un annuaire Active-Directory + ?

+ +

Active-Directory utilise le champ cn + comme identifiant unique au lieu de uid. Il faut donc modifier la + configuration de Lemonldap::NG en deux points : + +
    +
  1. la recherche de l'utilisateur dans l'annuaire doit être + effectuée avec le champ cn (ou + samAccountName),
  2. + +
  3. les journaux d'Apache doivent être enrichis avec ce même + champ.
  4. +
Pour le deuxième point, la modification est très simple + : il faut remplacer $uid par $cn dans le champ + "Paramètres généraux -> Donnée à + inscrire dans les journaux d'Apache (et vérifier que cette variable + est déclarée dand les attributs à exporter). Le + changement de filtre de recherche nécessite la surcharge d'une + méthode dans le portail. Cette modification peut être + effectuée comme suit: +
+#!/usr/bin/perl
+use Lemonldap::NG::Portal::SharedConf;
+my $portal = Lemonldap::NG::Portal::SharedConf->new(
+    {
+        configStorage => {
+            type    => 'File',
+            dirName => '/var/lib/lemonldap-ng/conf',
+        },
+        formateFilter => sub {
+            my $self = shift;
+            $self->{filter} = "(&(cn=" . $self->{user} . ")(objectClass=person))";
+            PE_OK;
+        } # fin de la surcharge
+    }
+);
+
+ +

Fonctionnement

+ +

A quoi sert le cache local + des agents (handlers) ?

+ +

Le cache local des agents a deux fonctions: + +
    +
  • partager la configuration entre processus Apache: on évite + ainsi un téléchargement de la configuration à + chaque création d'un processus. C'est également + indispensable pour utiliser le mécanisme de rechargement de la + configuration sans relance du serveur Apache,
  • + +
  • partager les sessions en cours entre processus et threads Apache: + ceci permet d'éviter d'avoir à effectuer une requête + au magasin central des sessions à chaque requête (on ne + retombe en effet pas nécessairement sur le même processus). + Dans le cas où le cache central des sessions est accessible par + le réseau, on transforme ainsi une requête TCP en une + requête au système de ficher voir simplement à la + mémoire partagée ce qui augmente fortement les + performances.
  • +
+ +

+ Pourquoi ne peut-on pas configurer le cache local des agents (handlers) + dans la console d'administration ?

+ +

Le cache local doit être choisi ou + paramétré en fonction du serveur: si on choisit par exemple + le module Cache::FileCache, le répertoire de stockage n'est pas + nécessairement le même partout. De plus, une modification du + cache ne peut être appliquée sans redémarrage du + serveur Apache contrairement aux autres paramètres + gérés par la console d'administration. + +

Qu'est ce que + le Cross Domain Authentication (CDA) ?

+ +

Le système de propagation de la session + Lemonldap::NG est basé sur des cookies. Or ces cookies sont + attachés au domaine dont ils sont issus. Lemonldap::NG fournit un + dispositif permettant de passer outre ce problème: il suffit + d'utiliser le portail Lemonldap::NG::Portal::CDA et les agents + Lemonldap::NG::Handler::CDA sur les sites protégés en dehors + du domaine du portail. + +

Comment + fonctionne le Cross Domain Authentication (CDA) + ?

+ +

Un portail Lemonldap::NG::Portal::CDA + détecte si l'URL demandée n'est pas dans le même + domaine. Si c'est le cas, il ajoute un paramètre à cette + requête correspondant au cookie de session. Lorsque l'utilisateur + est renvoyé vers cette URL, l'agent Lemonldap::NG::Handler::CDA + reconnaît ce paramètre et génère alors le + cookie dans son domaine. Il retire alors le paramètre ajouté + par le portail et effectue le traitement normal de la requête. + +

Authentification

+ +

Peut-on changer le mode + d'authentification ?

+ +

Lemonldap::NG fournit plusieurs modes + d'authentification (à paramétrer dans le champ + "authentification" de l'interface d'administration) : + +
    +
  • ldap : c'est le mode par + défaut: le portail tente de se connecter avec les + éléments fournis par l'utilisateur
  • + +
  • CAS : le portail Lemonldap::NG + devient alors un simple relais CAS: si l'utilisateur n'est pas + authentifié, on le revoie vers le portail CAS
  • + +
  • SSL : ce dispositif confie à + Apache le soin d'authentifier les utilisateurs par mécanisme SSL. + Ce dispositif est très intéressant lorsqu'on utilise des + certificats SSL: si on protège toutes les applications par + certificats mutuels les nombreuses négociations SSL + pénaliserons les performances et en cas d'emploi de cartes + à puces protégeant chaque opération, l'utilisateur + devra saisir plusieurs fois son code. Avec ce dispositif, seule + l'accès au portail Lemonldap::NG nécessite la + présentation du certificat client. Ensuite, c'est le cookie + sécurisé qui assure la propagation de + l'authentification.
  • + +
  • Apache : dans le même esprit, + on confie à Apache l'authentification. Par exemple avec Kerberos, + le module Kerberos d'Apache assure la protection du portail. On + améliore ainsi les performances puisqu'une seule + négociation Kerberos est nécessaire pour toute la + session.
  • +
+
+ + diff --git a/build/lemonldap-ng/doc/install-fr.html b/build/lemonldap-ng/doc/install-fr.html new file mode 100644 index 000000000..9bb2a7528 --- /dev/null +++ b/build/lemonldap-ng/doc/install-fr.html @@ -0,0 +1,182 @@ + + + + + + + + FAQ LEMONLDAP::NG + + + + +
+

INSTALLATION DE + L'EXEMPLE

+ +

+ + L'exemple proposé utilise un site protégé + nommé test.example.com. Les utilisateurs non-authentifiés + sont redirigés vers auth.example.com. + +

PRE REQUIS

+ +

Logiciels

+ +

Pour utiliser Lemonldap::NG, vous devez disposer + d'un server LDAP et d'un server Apache compilé avec le module + mod-perl (version 1.3 ou 2.x). Généralement, la version + d'Apache proposée par votre distribution Linux est suffisante, mais + certaines distributions utilisent une version expérimentale de + mod_perl2 avec Apache2 (mod_perl-1.99) qui ne fonctionne pas avec + Lemonldap::NG. Avec de telles distributions (Debian-3.1 par exemple), vous + devez utiliser Apache-1.3 ou utiliser des backports mod_perl, CGI.pm et + CGI/Cookie.pm (les paquets Debian du site www.backports.org fonctionnent + très bien). + +

Modules Perl + requis

+ +

Apache::Session, Net::LDAP, MIME::Base64, CGI, + LWP::UserAgent, Cache::Cache, DBI, XML::Simple, SOAP::Lite (only if you + want to use SOAP with the manager). + +

Sur Debian, lancez: + +
+
+apt-get install libapache-session-perl libnet-ldap-perl libcache-cache-perl libdbi-perl perl-modules libwww-perl libcache-cache-perl libxml-simple-perl
+# et si vous souhaitez utiliser les fonctionnalités SOAP du manager:
+apt-get install libsoap-lite-perl
+
+
+ +

COMPILATION

+ +

Installation + complète

+ +

+ +
+
+$ tar xzf lemonldap-ng-*.tar.gz
+$ cd lemonldap-ng-*
+$ make && make test
+$ sudo make install
+$ make example
+
+
+ +

Installation + sur Debian

+ +

+ +
+
+$ tar xzf lemonldap-ng-*.tar.gz
+$ cd lemonldap-ng-*
+$ debuild
+$ sudo dpkg -i ../lemonldap-ng*.deb
+
+
+ +

CONFIGURATION DE L'EXEMPLE

+ +

Après compilation, vous disposez d'un + fichier example/apache.conf. Vous avez simplement à l'inclure dans + le fichier de configuration d'Apache: + +

+ +
+
+# Apache-1.3: add this to httpd.conf
+include /path/to/lemonldap-ng/source/example/apache.conf
+# Apache-2.x:
+include /path/to/lemonldap-ng/source/example/apache2.conf
+# Debian Apache-1.3
+ln -s /usr/share/doc/lemonldap-ng/example/apache.conf /etc/apache/conf.d/test.conf
+# or with Apache-2.x
+ln -s /usr/share/doc/lemonldap-ng/example/apache2.conf /etc/apache2/sites-enabled/test.conf
+
+
+ +

Modifiez votre fichier /etc/hosts pour y ajouter: + +

+ +
+
+127.0.0.2       auth.example.com
+127.0.0.3       test.example.com
+127.0.0.4       manager.example.com
+
+
+ +

Vous devez ensuite indiquer les paramètres + de connexion LDAP. Vous pouvez au choix : + +
    +
  • utiliser l'interface d'administration: redémarrez Apache et + connectez vous à http://manager.example.com/
  • + +
  • éditer /path/to/lemonldap-ng/source/example/lmConfig-1 et + renseigner vos paramètres LDAP (utilisateurs Debian: + /usr/share/doc/lemonldap-ng/example/conf/lmConfig-1).
  • +
Si vous ne renseignez pas managerDn et managerPassword, Lemonldap::NG + utilisera une connexion anonyme pour trouver le dn de l'utilisateur. + +

NOTES: + +
    +
  • seuls quelques paramètres peuvent être + édités à la main dans le fichier de configuration. + Vous devez utiliser le manager pour la modifier, mais comme l'exemple + est déjà configuré, vous pouvez éditer ce + fichier directement,
  • + +
  • chaque nouvelle configuration est sauvegarder dans un nouveau + fichier par le manager (ou un nouvel enregistrement avec l'interface de + connexion au bases de données DBI) ainsi vous pouvez restaurer + une ancienne configuration.
  • +
Redémarrez ensuite Apache et utilisez votre navigateur + préféré pour vous connecter à http://test.example.com/. Vous serez + redirigés vers auth.example.com. Connectez-vous avec un compte + valide et la page protégée apparaîtra. +
+ + diff --git a/build/lemonldap-ng/doc/install.html b/build/lemonldap-ng/doc/install.html index 0643ce2b0..8ee2584ee 100644 --- a/build/lemonldap-ng/doc/install.html +++ b/build/lemonldap-ng/doc/install.html @@ -1,377 +1,172 @@ - + + + + - Lemonldap::NG - - - - - + + + FAQ LEMONLDAP::NG + + +
+

EXAMPLE + INSTALLATION

-

Lemonldap::NG Installation

-

Lemonldap::NG is a modular Web-SSO based on Apache::Session modules. It -simplifies the build of a protected area with a few changes in the application. -It manages both authentication and authorization and provides headers for -accounting. So you can have a full AAA protection.

+

-

See README file to known how it works.

+ The proposed example use a protected site named test.example.com. Non + authenticated users are redirected to auth.example.com. -

  • Prereq
  • +

    PREREQ

    -
      -

    1. Software
    2. +

      Software

      -

      To use Lemonldap::NG, you have to run a LDAP server and of course an Apache -server compiled with mod-perl (version 1.3 or 2.x). Generaly, the version of -Apache proposed with your Linux distribution match, but some distributions used -an experimental version of mod_perl with Apache2 (mod_perl-1.99) which does -not work with Lemonldap::NG. With such distributions (like Debian-3.1), you -have to use Apache-1.3 or to use a mod_perl backport (www.backports.org -package for Debian works fine).

      +

      To use Lemonldap::NG, you have to run a LDAP + server and of course an Apache server compiled with mod-perl (version 1.3 + or 2.x). Generaly, the version of Apache proposed with your Linux + distribution match, but some distributions used an experimental version of + mod_perl with Apache2 (mod_perl-1.99) which does not work with + Lemonldap::NG. With such distributions (like Debian-3.1), you have to use + Apache-1.3 or to use a mod_perl, CGI.pm and CGI/Cookie.pm backports + (www.backports.org package for Debian works fine). -

    3. Perl prereq
    4. +

      Needed Perl + modules

      -
      -
      Perl modules :
      -
      -

      Apache::Session, Net::LDAP, MIME::Base64, CGI, LWP::UserAgent, Cache::Cache, - DBI, XML::Simple, SOAP::Lite (only if you want to use SOAP with the manager)

      -
      +

      Apache::Session, Net::LDAP, MIME::Base64, CGI, + LWP::UserAgent, Cache::Cache, DBI, XML::Simple, SOAP::Lite (only if you + want to use SOAP with the manager). -
      With Debian :
      -
      -
      -    apt-get install libapache-session-perl libnet-ldap-perl libcache-cache-perl \
      -                    libdbi-perl perl-modules libwww-perl libcache-cache-perl \
      -                    libxml-simple-perl
      -  
      -

      If you want to use SOAP with the manager :

      -
      -    apt-get install libsoap-lite-perl
      -  
      -
      -
      -
    +

    With Debian, use: -

  • Building
  • - -
      - -

    1. Complete installation
    2. -
      -    $ tar xzf lemonldap-ng-*.tar.gz
      -    $ cd lemonldap-ng-*
      -    $ make && make test
      -    $ sudo make install
      -    $ make example
      +    
      +
      +apt-get install libapache-session-perl libnet-ldap-perl libcache-cache-perl libdbi-perl perl-modules libwww-perl libcache-cache-perl libxml-simple-perl
      +# If you want to use SOAP with the manager:
      +apt-get install libsoap-lite-perl
       
      +
      -

    3. Installation on Debian
    4. -
      -    $ tar xzf lemonldap-ng-*.tar.gz
      -    $ cd lemonldap-ng-*
      -    $ debuild   # or fakeroot dpkg-buildpackage
      -    $ sudo dpkg -i ../*lemonldap-ng*.deb
      +    

      BUILDING

      + +

      Complete + install

      + +

      + +
      +
      +$ tar xzf lemonldap-ng-*.tar.gz
      +$ cd lemonldap-ng-*
      +$ make && make test
      +$ sudo make install
      +$ make example
       
      +
      -
    +

    Debian + install

    -

  • Example configuration
  • +

    -

    After build, you have new files in the example/ directory -(/usr/share/doc/lemonldap-ng/example with Debian). You just have -to include this file in Apache configuration :

    - -
      -
    • in httpd.conf (with Apache-1.3.x) -
      -    include /path/to/lemonldap-ng/source/example/apache.conf
      -  
      -
    • - -
    • or with Apache2 -
      -    include /path/to/lemonldap-ng/source/example/apache2.conf
      -  
      -
    • -
    - -

    Modify your /etc/hosts file to include :

    - -
    -    127.0.0.2       auth.example.com
    -    127.0.0.3       test.example.com
    -    127.0.0.4       manager.example.com
    +    
    +
    +$ tar xzf lemonldap-ng-*.tar.gz
    +$ cd lemonldap-ng-*
    +$ debuild
    +$ sudo dpkg -i ../lemonldap-ng*.deb
     
    +
    -

    and restart Apache.

    +

    EXAMPLE + CONFIGURATION

    -

    Before the example works, you have to set your LDAP settings. There are two -ways to do it : +

    After build, you have a new file named + example/apache.conf. You just have to include this file in Apache + configuration: -
      -
    • Connect to http://manager.example.com/ - and edit the corresponding parameters in "general parameters"
    • +

      -
    • Edit /path/to/lemonldap-ng/source/example/conf/lmConfig-1 and - specify your LDAP settings.
    • -
    - -

    If you don't set managerDn and managerPassword, Lemonldap::NG will -use an anonymous bind to find user dn.

    - -

    WARNINGS :

    - -
      -
    • only few parameters can be set by hand in the configuration file. You have - to use the manager to change configuration, but since the example is yet - configured, you can edit directly the file
    • -
    • each new configuration is saved by the manager in a new file (or a new - record with DBI) so you can recover an old configuration by removing
    • -
    - -

    Next, try to connect to http://test.example.com/. -You'll be redirect to auth.example.com. Try to authenticate yourself with a -valid account and the protected page will appear. You will find other -explanations on this page.

    - - - -

  • Advanced installation
  • - -
      - -

    1. Prereq
    2. - -
        - -

      1. Apache
      2. - -

        To use Lemonldap::NG, you have to run a LDAP server and of course an Apache -server compiled with mod-perl (version 1.3 or 2.x). Generaly, the version of -Apache proposed with your Linux distribution match, but some distributions used -an experimental version of mod_perl with Apache2 (mod_perl-1.99) which does -not work with Lemonldap::NG. With such distributions (like Debian-3.1), you -have to use Apache-1.3 or to use a mod_perl backport (www.backports.org -package for Debian works fine).

        - -

        For Apache2, you can use both mpm-worker and mpm-prefork. Mpm-worker works -faster and Lemonldap::NG use the thread system for best performance. If you -have to use mpm-prefork (for example if you use PHP), Lemonldap::NG will work -anyway.

        - -

        You can use Lemonldap::NG in an heterogene world : the authentication portal and -the manager can work in any version of Apache 1.3 or more even if mod_perl is -not compiled, with ModPerl::Registry or not... Only the handler (site protector) -need mod_perl. The different handlers can run on different servers with -different versions of Apache/mod_perl.

        - -

      3. Perl Prereq
      4. - -

        Warning : Handler and Portal parts both need Lemonldap::NG::Manager components -to access to configuration.

        - -
        -
        Manager :
        -

        CGI, XML::Simple, DBI, LWP::UserAgent (and SOAP::Lite if you want to use SOAP)

        - -

        With Debian :

        -
        -    # apt-get install perl-modules libxml-simple-perl libdbi-perl libwww-perl
        -   
        -

        And if you want to use SOAP :

        -
        -    # apt-get install libsoap-lite-perl
        -   
        -
        - -
        Portal :
        -

        Apache::Session, Net::LDAP, CGI, Lemonldap::NG::Manager

        - -

        With Debian :

        -
        -   # apt-get install libapache-session-perl libnet-ldap-perl perl-modules
        -  
        -
        - -
        Handler :
        -

        Apache::Session, LWP::UserAgent, Cache::Cache, Lemonldap::NG::Manager

        - -

        With Debian :

        -
        -    # apt-get install libapache-session-perl libwww-perl libcache-cache-perl
        -  
        -
        -
        -
      - -

    3. Software installation
    4. - -

      If you just want to install a handler or a portal or a manager :

      - -
      -    $ tar xzf lemonldap-ng-*.tar.gz
      -    $ cd lemonldap-ng-*/Lemonldap-NG-(Portal|Handler|Manager)
      -    $ perl Makefile.PL && make && make test
      -    $ sudo make install
      +    
      +
      +# Apache-1.3: add this to httpd.conf
      +include /path/to/lemonldap-ng/source/example/apache.conf
      +# Apache-2.x:
      +include /path/to/lemonldap-ng/source/example/apache2.conf
      +# Debian Apache-1.3
      +ln -s /usr/share/doc/lemonldap-ng/example/apache.conf /etc/apache/conf.d/test.conf
      +# or with Apache-2.x
      +ln -s /usr/share/doc/lemonldap-ng/example/apache2.conf /etc/apache2/sites-enabled/test.conf
       
      +
      -

      else for a complete install :

      -
      -    $ tar xzf lemonldap-ng-*.tar.gz
      -    $ cd lemonldap-ng-*
      -    $ make && make test
      -    $ sudo make install
      +    

      Modify your /etc/hosts file to include: + +

      + +
      +
      +127.0.0.2       auth.example.com
      +127.0.0.3       test.example.com
      +127.0.0.4       manager.example.com
       
      +
      -

      See prereq in Exeample installation

      +

      Now you have to edit configuration to set your + LDAP settings. You can either use : -

    5. Lemonldap::NG installation
    6. +
        +
      • the manager interface: restart Apache and connect to http://manager.example.com/
      • -
          +
        1. edit /path/to/lemonldap-ng/source/example/lmConfig-1 and specify + your LDAP settings (Debian users: + /usr/share/doc/lemonldap-ng/example/conf/lmConfig-1).
        2. +
      If you don't set managerDn and managerPassword, Lemonldap::NG will + use an anonymous bind to find user dn. -

    7. Databases configuration
    8. +

      WARNINGS: -
      Lemonldap::NG Configuration database
      +
        +
      • only few parameters can be set by hand in the configuration file. + You have to use the manager to change configuration, but since the + example is yet configured, you can edit directly the file,
      • -

        If you use DBI or another system to share Lemonldap::NG configuration, you have -to initialize the database. An example is given in example/lmConfig.mysql for -MySQL.

        - - -
        Apache::Session database
        - -

        The choice of Apache::Session::* module is free. See Apache::Session::Store::* -or Apache::Session::* to know how to configure the module. For example, if you -want to use Apache::Session::MySQL, you can create the database like this :

        - -
        -    CREATE DATABASE sessions (
        -      id char(32),
        -      a_session text
        -    );
        -
        - -

      • Manager configuration
      • - -

        Copy example/manager.cgi and personalize it if you want (see -Lemonldap::NG::Manager). You have to set in particular configStorage. For -example with MySQL :

        - -
        -    $my $manager = Lemonldap::NG::Manager->new ( {
        -                        dbiChain   => "DBI:mysql:database=mybase;host=1.2.3.4",
        -                        dbiUser    => "lemonldap-ng",
        -                        dbiPassword => "mypass",
        -                 } );
        -
        - -

        You can securise Manager access with Lemonldap::NG like any other site (after -configuring it) or with Apache. Example :

        - -
        -    SSLEngine On
        -    Order Deny, Allow
        -    Deny from all
        -    Allow from admin-network/netmask
        -    AuthType Basic
        -    ...
        -
        - -

      • Configuration edition
      • - -

        Connect to the manager with your browser start configure your Web-SSO. You have -to set at least some parameters :

        - -
        General parameters
        - -

        Main parameters :

        -
          -
        • Authentication parameters -> portal : URL to access to the authentication portal
        • -
        • Domain : the cookie domain. Unless some protected VirtualHosts - are not under it, you have to use Lemonldap::NG::Portal::CDA and - Lemonldap::NG::Handler::CDA
        • -
        • LDAP parameters -> LDAP Server
        • -
        • LDAP parameters -> LDAP Accout and password : required only if anonymous binds are not accepted
        • -
        • Session Storage -> Apache::Session module : how to store user sessions. You can use all module that inherit - from Apache::Session like Apache::Session::MySQL
        • -
        • Session Storage -> Apache::Session Module parameters : see Apache::Session::<Choosen module>
        • -
        - -
        User groups
        - -

        Use the "New Group" button to add your first group. On the left, set the -keyword which will be used later and set on the right the corresponding rule. -you can use :

        - -
          -
        • an LDAP filter (it will be tested with the user uid)
        • -
        • or a Perl condition enclosed with {}. All variables declared in - "General parameters -> LDAP attributes" or "macros" - can be used with a "$". For example : -
          -    MyGroup  =>  { $uid eq "foo" or $uid eq "bar" }
          -   
          -
        • -
        - -
        Virtual hosts
        - -

        You have to create a virtual host for each Apache host (virtual or real) -protected by Lemonldap::NG even if just a sub-directory is protected. Else, -user who want to access to the protected area will be rejected with a "500 -Internal Server Error" message and the apache logs will explain the problem.

        - -

        Each virtual host has 2 groups of parameters :

        - -
          -
        • Headers : the headers added to the apache request. Default : -
          -        Auth-User => $uid
          -  
          -
        • -
        • Rules : subdivised in 2 categories : -
            -
          • default : the default rule
          • -
          • personalized rules : association of a Perl regular expression and a - condition. For example : -
            -        ^/restricted.*$  /  $groups =~ /\bMyGroup\b/
            -    
            -
          • -
          -
    - - +
  • each new configuration is saved by the manager in a new file (or a + new record with DBI) so you can recover an old configuration by removing + the new one.
  • + Next, restart Apache and use your prefered browser and try to connect + to http://test.example.com/. You'll be + redirect to auth.example.com. Try to authenticate yourself with a valid + account and the protected page will appear. +
    - diff --git a/build/lemonldap-ng/doc/overview-fr.html b/build/lemonldap-ng/doc/overview-fr.html new file mode 100644 index 000000000..2ebc7503d --- /dev/null +++ b/build/lemonldap-ng/doc/overview-fr.html @@ -0,0 +1,377 @@ + + + + + + + + FAQ LEMONLDAP::NG + + + + +
    +

    LemonLDAP::NG

    + +

    Lemonldap::NG est un Web-SSO modulaire + basé sur les modules Apache::Session. Il simplifie la construction + d'une aire protégée en minimisant les impacts sur les + applications. Il gère à la fois les authentifications et les + autorisations et fournit des en-têtes HTTP pour la + traçabilité. On obtient ainsi une protection AAA complete + (Authentication, Authorization and Accounting) des + espaces web. + +

    Lemonldap::NG est une réécriture + complète de Lemonldap. Tous les éléments + nécessaires à son exploitation et son administration sont + fournis dans le package. En revanche les composants + développés pour Lemonldap ne sont pas compatibles avec + Lemonldap::NG. + +

    + + + +

    Mécanismes + d'authentification, d'autorisation et de + traçabilité

    + +

    Tous les paramètres abordés dans ce + chapître sont accessibles via l'interface d'administration (voir la + démonstration). + +

    Authentification

    + +

    Si un utilisateur n'est pas encore + authentifié et tente de se connecter à une aire + protégée par un agent Lemonldap::NG, il est redirigé + vers le portail. Celui-ci authentifie l'utilisateur par défaut par + une connexion LDAP, mais vous pouvez également utiliser un autre + schéma tel les certificats x509 (voir + Lemonldap::NG::Portal::AuthSSL(3)). + +

    Lemonldap::NG utilise les cookies de session + générés par le module Apache::Session soit aussi + sécurisé que n'importe quelle système basé sur + des cookies aléatoires de 128 bits. Il est recommandé + d'activer l'option "cookie sécurisé" pour éviter les + vols de session. + +

    Par défaut, une session reste 10 minutes + dans le magasin local du serveur Apache, donc dans le pire des cas, un + utilisateur conserve son autorisation au plus 10 minutes après + avoir perdu ses droits. + +

    Autorisation

    + +

    Les autorisations sont controlées + seulement par les agents protégeant les applications. En effet, le + portail ne peut connaître à l'avance les applications sur + lesquels l'utilisateur se connectera. En configurant votre Web-SSO, vous + devez: + +
      +
    • choisir les attributs LDAP que vous souhaitez utiliser pour les + autorisations et la traçabilité,
    • + +
    • créer d'éventuelles expressions Perl pour + définir des groupes d'utilisateur (en utilisant les attributs + LDAP),
    • + +
    • créer des règles d'accès associant des + expressions régulières triant les URL à des + expressions Perl calculant le droit d'accès correspondant.
    • +
    Exemple (Voir Lemonldap::NG::Manager::Conf(3) pour comprendre le + stockage de la configuration) : + +
      +
    • Variables exportées (attributs LDAP):
    • +
    + +
    +
    +# Nom-choisi     => attribut LDAP
    +cn               => cn
    +departmentUID    => departmentUID
    +login            => uid
    +
    +
    + +
      +
    • Groupes d'utilisateurs :
    • +
    + +
    +
    +# Nom-choisi  => définition du groupe
    +group1        => { $departmentUID eq "unit1" or $login = "user1" }
    +
    +
    + +
      +
    • Protection d'un site web: chaque VirtualHost (ou hôte + réel) Apache dispose de ses propres règles d'accès: + +
        +
      • www1.domain.com :
      • +
      +
    • +
    + +
    +
    +^/protected/.*$  => $groups =~ /bgroup1b/
    +default          => accept
    +
    +
    + +
      +
    • www2.domain.com :
    • +
    + +
    +
    +^/site/.*$       => $uid eq "admin" or $groups =~ /bgroup2b/
    +^/(js|css)       => accept
    +default          => deny
    +
    +
    + +
    Performances
    + +

    Vous pouvez utiliser des expressions Perl aussi + complexe que nécessaire et vous pouvez utiliser tous les attibuts + LDAP (et créer vos propres attributs additionnels avec le + mécanisme des macros) dans les définitions de groupes, les + règles d'accès et les en-têtes HTTP + personnalisés: vous devez seulement utiliser le nom choisi + précédé d'un "$". + +

    Vous devez toutefois bien choisir vos + expressions: + +
      +
    • les groupes et les macros ne sont évaluées que lorsque + l'utilisateur est renvoyé vers le portail,
    • + +
    • les règles d'accès et les en-têtes + exportés sont évalués à chaque requête + sur un site protégé.
    • +
    Il est donc recommandé d'utiliser le mécanisme des + groupes pour éviter de calculer de longues expressions à + chaque requête: + +
    +
    +^/protected/.*$   => $groups =~ /bgroup1b/
    +
    +
    + +

    Dans la définition des groupes, vous + pouvez au choix utiliser des filtres LDAP ou des expressions Perl ou + encore mixer les deux. Les expressions Perl sont encadrées par {} : + +
    +
    +group1 => (|(uid=xavier.guimard)(ou=unit1))
    +group1 => <uid eq "xavier.guimard" or $ou eq "unit1">
    +group1 => (|(uid=xavier.guimard)<ou eq "unit1">)
    +
    +
    + +

    Pour limiter les requêtes LDAP, il est + conseillé d'utiliser les expressions Perl. Ainsi seuls 2 + sollicitations de l'annuaire sont nécessaires. + +

    Traçabilité

    + +
    Tracer + les accès au portail
    + +

    Lemonldap::NG::Portal n'enregistre pas les + événements de connexion par défaut, mais il est + très facile de surcharger la méthode "log". + +
    Tracer les accès aux + applications
    + +

    Comme un Web-SSO ne peut interpréter le + contenu des requêtes HTTP transmise aux applications + protégées, il ne peut enregistrer au mieux que les URL. Et + comme Apache le fait parfaitement, Lemonldap::NG::Handler(3) lui fournit + le nom à enregistrer dans les journaux. Le paramètre + optionnel "whatToTrace" indique la variable à utiliser ($uid par + défaut). + +

    La trace réelle doit être + effectuée par l'application seule capable d'interpréter le + résultat des transactions. + +

    Lemonldap::NG peut exporter des en-têtes + HTTP aussi bien en utilisant Apache en reverse-proxy qu'en + protégent directement les applications. Par défaut, le champ + Auth-User est utilisé mais vous pouvez choisir les en-têtes + que vous transmettez à chaque application séparemment. Les + expressions définissant les en-têtes associent : + +
      +
    • le nom d'en-tête,
    • + +
    • une expression Perl utilisant les données de l'utilisateur + (attributs, macros et groupes).
    • +
    Exemple: + +
      +
    • www1.domain.com :
    • +
    + +
    +
    +Auth-User     => $uid
    +Unit          => $ou
    +
    +
    + +
      +
    • www2.domain.com :
    • +
    + +
    +
    +Authorization => "Basic ".encode_base64($employeeNumber.":dummy")
    +Remote-IP     => $ip
    +
    +
    + +

    Installation

    + +

    Attention : + +
      +
    • Lemonldap::NG est un projet différent de Lemonldap et + contient tous les éléments nécessaires à son + utilisation et son administration. Ainsi les logiciels tel le module + webmin de Lemonldap ne fonctionnent pas avec Lemonldap::NG.
    • + +
    • L'agent de protection Apache ("handler") fonctionne à la fois + avec les versions 1.3 et 2.x d'Apache, c'est à dire avec les + versions 1 et 2 de mod_perl (mais pas avec mod_perl 1.99). Le portail et + le l'interface d'administration ("manager") sont de simples CGI et + peuvent donc fonctionner sur n'importe quel serveur compatible.
    • + +
    • La configuration de Lemonldap::NG ne doit être + éditée qu'avec l'interface d'administration à oins + que vous ne sachiez exactement ce que vous faites. Les paramètres + présentés dans ce document sont tous accessibles dans + l'arbre de configuration.
    • +
    Voir installation manuel pour la + documentation d'installation. + +

    Système de stockage des + sessions

    + +

    Lemonldap::NG utilise 3 niveaux de cache pour les + données des utilisateurs authentifiés : + +
      +
    • un module Apache::Session:: au choix + utilisé par le portail lemonldap::NG::Portal pour stocker les + données après authentification,
    • + +
    • un module Cache::Cache au choix utilisé par l'agent + Lemonldap::NG::Handler pour partager les données entre les + threads et les processus d'Apache et bien sur entre les hôtes + virtuels hébergés sur le même serveur,
    • + +
    • les variables internes à l'agent Lemonldap::NG::Handler : si + le même utilisateur utilise de nouveau le même thread ou + processus, aucune requête n'est nécessaire pour calculer le + droit d'accès. Ceci est particulièrement + intéressant avec le système de connexions persistantes du + protocole HTTP/1.1 (Keep-Alive).
    • +
    Ainsi, le nombre de requêtes au cache principal est + limité à 1 par utilisateur actif toutes les 10 minutes. + +

    Lemonldap::NG est très rapide, mais vous + pouvez encore améliorer les performances en utilisnt un module + Cache::Cache ne nécessitant pas d'accès au disque. + +

    Auteur

    + +

    Xavier Guimard, <x.guimard@free.fr> + +

    Copyright et + license

    + +

    Copyright © 2005-2007 par Xavier Guimard + <x.guimard@free.fr> + +

    Ce logiciel est libre, vous pouvez le + redistribuer et/ou le modifier sous les mêmes termes que Perl + lui-même en version 5.8.4 ou à votre guise en version Perl 5 + supérieure. +
    + + diff --git a/build/lemonldap-ng/doc/overview.html b/build/lemonldap-ng/doc/overview.html index 11956c3a5..f61f16178 100644 --- a/build/lemonldap-ng/doc/overview.html +++ b/build/lemonldap-ng/doc/overview.html @@ -1,247 +1,342 @@ - + + + + - Lemonldap::NG - - - - + + + FAQ LEMONLDAP::NG + + +
    +

    LemonLDAP::NG

    -

    Lemonldap::NG

    +

    Lemonldap::NG is a modular Web-SSO based on + Apache::Session modules. It simplifies the build of a protected area with + a few changes in the application. It manages both authentication and + authorization and provides headers for accounting. So you can have a full + AAA protection for your web space as described below. -

    Lemonldap::NG is a modular Web-SSO based on Apache::Session modules. It -simplifies the build of a protected area with a few changes in the application. -It manages both authentication and authorization and provides headers for -accounting. So you can have a full AAA protection for your web space as -described below.

    +

    Lemonldap::NG is a complete rewrite of Lemonldap. + All components needed to use it and to aminister it are included in the + tarball. Contrary, all modules developed for Lemonldap may not work with + Lemonldap::NG. -
      -
    1. Authentication, Authorization and Accounting mechanisms
    2. -
    3. Installation
    4. -
    5. Session storage system
    6. -
    7. Logout system
    8. -
    9. Author
    10. -
    11. Copyright and licence
    12. -
    +

    -
      -

    1. Authentication, Authorization and Accounting mechanisms
    2. +
        +
      • + Authentication, + Authorization and Accounting mechanisms -
          -

        1. Authentication
        2. +
            +
          • Authentication
          • -

            If a user isn't authenticated and attemps to connect to an area protected by a -Lemonldap::NG compatible handler, he is redirected to a portal. The portal -authenticates user with a ldap bind by default, but you can also use another -authentication sheme like using x509 user certificates (see -Lemonldap::NG::Portal::AuthSSL(3) for more).

            +
          • + Authorization -

            Lemonldap::NG use session cookies generated by Apache::Session so as secure -as a 128-bit random cookie. You may use the securedCookie options to avoid -session hijacking.

            + +
          • -

            You have to manage life of sessions by yourself since Lemonldap::NG knows -nothing about the L module you've choosed, but it's very easy -using a simple cron script because Lemonldap::NG::Portal stores the start -time in the _utime field.
            -By default, a session stay 10 minutes in the local storage, so in the worth -case, a user is authorized 10 minutes after he lost his rights.

            +
          • + Accounting -

          • Authorization
          • + +
          • +
          + -
            -
          • choose the ldap attributes you want to use to manage accounting and - authorization.
          • -
          • create Perl expressions to define user groups (using ldap attributes)
          • -
          • create an array foreach virtual host associating URI regular expressions and - Perl expressions to use to grant access.
          • -
          +
        3. Installation
        4. -

          Example (See Lemonldap::NG::Manager::Conf(3) to see how configuration is stored) :

          +
        5. Session storage system
        6. - + +

          Authentication, + Authorization and Accounting mechanisms

          + +

          All parameters described here can be edited by + the administration interface (See Manager + demonstration). + +

          Authentication

          + +

          If a user isn't authenticated and attemps to + connect to an area protected by a Lemonldap::NG compatible handler, he is + redirected to a portal. The portal authenticates user with a ldap bind by + default, but you can also use another authentication sheme like using x509 + user certificates (see Lemonldap::NG::Portal::AuthSSL(3) for more). + +

          Lemonldap use session cookies generated by + Apache::Session so as secure as a 128-bit random cookie. You may use the + securedCookie options to avoid session hijacking. + +

          You have to manage life of sessions by yourself + since Lemonldap::NG knows nothing about the L module you've choosed, but + it's very easy using a simple cron script because Lemonldap::NG::Portal + stores the start time in the _utime field. + +

          By default, a session stay 10 minutes in the + local storage, so in the worth case, a user is authorized 10 minutes after + he lost his rights. + +

          Authorization

          + +

          Authorization is controled only by handlers + because the portal knows nothing about the way the user will choose. When + configuring your Web-SSO, you have to: + +
            +
          • choose the ldap attributes you want to use to manage accounting and + authorization.
          • + +
          • create Perl expressions to define user groups (using ldap + attributes)
          • + +
          • create an array foreach virtual host associating URI regular + expressions and Perl expressions to use to grant access.
          • +
          Example (See Lemonldap::NG::Manager::Conf(3) to see how configuration + is stored) : + +
            +
          • Exported variables :
          • +
          + +
          +
           # Custom-Name    => LDAP attribute
           cn               => cn
           departmentUID    => departmentUID
           login            => uid
          - 
          + +
          -
        7. User groups : -
          +    
            +
          • User groups :
          • +
          + +
          +
           # Custom-Name => group definition
          -  group1      => { $departmentUID eq "unit1" or $login = "user1" }
          -
        8. - -
        9. Area protection: -
          -# Each VirtualHost has its own configuration
          -# associating URL regexp to Perl expression
          -    * www1.domain.com :
          -          ^/protected/.*$  => $groups =~ /\bgroup1\b/
          -          default          => accept
          -      },
          -    * www2.domain.com :
          -          ^/site/.*$       => $uid eq "admin" or $groups =~ /\bgroup2\b/
          -          ^/(js|css)       => accept
          -          default          => deny
          -  
        10. -
      - -
        -

      1. Performance
      2. - -

        You can use Perl expressions as complicated as you want and you can use all -the exported LDAP attributes (and create your own attributes: with 'macros' -mechanism) in groups evaluations, area protections or custom HTTP headers -(you just have to call them with a "$").

        - -

        You have to be careful when choosing your expressions:

        - -
          -
        • groups and macros are evaluated each time a user is redirected to the portal,
        • -
        • virtual host rules and exported headers are evaluated for each request on a - protected area.
        • -
        - -

        It is also recommanded to use the groups mechanism to avoid having to evaluate -a long expression at each HTTP request :

        - -
        -  # Virtual hosts :
        -      ...
        -      www1.domain.com :
        -          ^/protected/.*$   => $groups =~ /\bgroup1\b/
        +group1        => { $departmentUID eq "unit1" or $login = "user1" }
         
        +
    -

    You can also use LDAP filters, or Perl expression or mixed expressions in -groups definitions. Perl expressions has to be enclosed with {} :

    + + +
    +
    +^/protected/.*$  => $groups =~ /bgroup1b/
    +default          => accept
     
    +
    -

    It is also recommanded to use Perl expressions to avoid requiering the LDAP -server more than 2 times per authentication.

    + - -

  • Accounting
  • - -
      -

    1. Logging portal access
    2. - -

      Lemonldap::NG::Portal doesn't log anything by default, but it's easy to -overload log method for normal portal access.

      - -

    3. Logging application access
    4. - -

      Because a Web-SSO knows nothing about the protected application, it can't do -more than logging URL. As Apache does this fine, Lemonldap::NG::Handler(3) -gives it the name to used in logs. The whatToTrace parameter indicates -which variable Apache has to use ($uid by default).

      - -

      The real accounting has to be done by the application itself which knows the -result of SQL transaction for example.

      - -

      Lemonldap::NG can export HTTP headers either using a proxy or protecting -directly the application. By default, the Auth-User field is used but you can -change it using the exportedHeaders parameters (in the Manager, each virtual -host as custom headers branch). This parameters contains an associative array -per virtual host :

      - -
        -
      • keys are the names of the choosen headers,
      • -
      • values are Perl expressions where you can use user datas stored in the - global storage.
      • -
      - -

      Example:

      - -
      - * www1.domain.com :
      -        Auth-User     => $uid
      -        Unit          => $ou
      - * www2.domain.com :
      -        Authorization => "Basic ".encode_base64($employeeNumber.":dummy")
      -        Remote-IP     => $ip
      +    
      +
      +^/site/.*$       => $uid eq "admin" or $groups =~ /bgroup2b/
      +^/(js|css)       => accept
      +default          => deny
       
      -
    - + -

  • Installation
  • +
    Performance
    -

    Warnings :

    - +

    ou have to be careful when choosing your + expressions: -

    See INSTALL file for a complete installation documentation.

    + It is also recommanded to use the groups mechanism to avoid having to + evaluate a long expression at each HTTP request : -

    Lemonldap::NG use 3 levels of cache for authenticated users :

    +
    +
    +^/protected/.*$   => $groups =~ /bgroup1b/
    +
    +
    - +

    You can also use LDAP filters, or Perl expression + or mixed expressions in groups definitions. Perl expressions has to be + enclosed with {} : -

    So the number of request to the central storage is limited to 1 per active -user each 10 minutes.

    +
    +
    +group1 => (|(uid=xavier.guimard)(ou=unit1))
    +group1 => <uid eq "xavier.guimard" or $ou eq "unit1">
    +group1 => (|(uid=xavier.guimard)<ou eq "unit1">)
    +
    +
    -

    Lemonldap::NG is very fast, but you can increase performance using a -Cache::Cache module that does not use disk access.

    +

    It is also recommanded to use Perl expressions to + avoid requiering the LDAP server more than 2 times per authentication. -

  • Logout system
  • +

    Accounting

    -

    Lemonldap::NG provides a single logout system : you can use it by - adding a link to the portal with "logout=1" parameter in the portal (See - Lemonldap::NG::Portal(3)) and/or by configuring handler to intercept some URL - (See Lemonldap::NG::Handler(3)). The logout system: +

    Logging portal + access
    - +

    Lemonldap::NG::Portal doesn't log anything by + default, but it's easy to overload log method for normal portal access. -

  • Author
  • +
    Logging + application access
    -

    Xavier Guimard, <x.guimard@free.fr> +

    Because a Web-SSO knows nothing about the + protected application, it can't do more than logging URL. As Apache does + this fine, Lemonldap::NG::Handler(3) gives it the name to used in logs. + The whatToTrace parameter indicates which variable Apache has to use ($uid + by default). -

  • Copyright and licence
  • +

    The real accounting has to be done by the + application itself which knows the result of SQL transaction for example. -

    Copyright © 2005-2007 by Xavier Guimard <x.guimard@free.fr>

    +

    Lemonldap::NG can export HTTP headers either + using a proxy or protecting directly the application. By default, the + Auth-User field is used but you can change it using the exportedHeaders + parameters (in the Manager, each virtual host as custom headers branch). + This parameters contains an associative array per virtual host : -

    This library is free software; you can redistribute it and/or modify -it under the same terms as Perl itself, either Perl version 5.8.4 or, -at your option, any later version of Perl 5 you may have available.

    + Example: + + + +
    +
    +Auth-User     => $uid
    +Unit          => $ou
    +
    +
    + + + +
    +
    +Authorization => "Basic ".encode_base64($employeeNumber.":dummy")
    +Remote-IP     => $ip
    +
    +
    + +

    Installation

    + +

    Warnings : + + See installation manuel for a + complete installation documentation. + +

    Session storage + system

    + +

    Lemonldap::NG use 3 levels of cache for + authenticated users : + + So the number of request to the central storage is limited to 1 per + active user each 10 minutes. + +

    Lemonldap::NG is very fast, but you can increase + performance using a Cache::Cache module that does not use disk access. + +

    Author

    + +

    Xavier Guimard, <x.guimard@free.fr> + +

    Copyright and + licence

    + +

    Copyright © 2005-2007 by Xavier Guimard + <x.guimard@free.fr> + +

    This library is free software; you can + redistribute it and/or modify it under the same terms as Perl itself, + either Perl version 5.8.4 or, at your option, any later version of Perl 5 + you may have available. + diff --git a/build/lemonldap-ng/scripts/doc.pl b/build/lemonldap-ng/scripts/doc.pl new file mode 100755 index 000000000..3d0a8f6b3 --- /dev/null +++ b/build/lemonldap-ng/scripts/doc.pl @@ -0,0 +1,49 @@ +#!/usr/bin/perl + +use strict; +use XML::Simple; +use utf8; + +my $docs = { + 'http://wiki.lemonldap.objectweb.org/xwiki/bin/view/NG/FAQ?language=fr' => 'faq-fr.html', + 'http://wiki.lemonldap.objectweb.org/xwiki/bin/view/NG/Presentation?language=en' => 'overview.html', + 'http://wiki.lemonldap.objectweb.org/xwiki/bin/view/NG/Presentation?language=fr' => 'overview-fr.html', + 'http://wiki.lemonldap.objectweb.org/xwiki/bin/view/NG/DocInstallExample?language=en' => 'install.html', + 'http://wiki.lemonldap.objectweb.org/xwiki/bin/view/NG/DocInstallExample?language=fr' => 'install-fr.html', + 'http://wiki.lemonldap.objectweb.org/xwiki/bin/view/NG/DocInstall?language=en' => 'advanced-install.html', +}; + +while ( my ( $url, $file ) = each %$docs ) { + open DOC, "wget -q -O - $url |"; + + #open DOC, '/tmp/doc'; + + my $buf; + my $ind = 0; + my $div; + while () { + $ind++ if (/
    /); + next unless ($ind); + $div++ if (/
    $file"; + print FILE ' + + + +FAQ LEMONLDAP::NG + + + +'; + print FILE "$buf"; + close FILE; +} diff --git a/modules/lemonldap-ng-handler/example/MyHandler.pm b/modules/lemonldap-ng-handler/example/MyHandler.pm index 03a88a3a4..8a802eca5 100644 --- a/modules/lemonldap-ng-handler/example/MyHandler.pm +++ b/modules/lemonldap-ng-handler/example/MyHandler.pm @@ -7,9 +7,9 @@ __PACKAGE__->init ( { localStorageOptions => { 'namespace' => 'MyNamespace', 'default_expires_in' => 600, - 'directory_umask' => '007', - 'cache_root' => '/tmp', - 'cache_depth' => 5, + 'directory_umask' => '007', + 'cache_root' => '/tmp', + 'cache_depth' => 5, }, configStorage => { diff --git a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm index 0d9a8b686..314faaa05 100644 --- a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm +++ b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm @@ -332,7 +332,7 @@ sub print_upload { } sub upload { - my $self = shift; + my $self = shift; my $config = $self->tree2conf(@_); return SYNTAX_ERROR unless( $self->checkConf($config) ); return $self->config->saveConf($config); diff --git a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_HTML.pm b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_HTML.pm index 295661e34..7df1347d9 100644 --- a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_HTML.pm +++ b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_HTML.pm @@ -81,7 +81,8 @@ sub javascript { newRule newHeader httpHeaders waitingResult unknownError configurationWasChanged configLoaded warningConfNotApplied applyConf prevConf lastConf nextConf deleteVirtualHost - areYouSure syntaxError deleteConf confirmDeleteConf)) { + areYouSure syntaxError deleteConf confirmDeleteConf + invalidVirtualHostName)) { $text{$_} = &{"txt_$_"}; $text{$_} =~s/'/\\'/g; } @@ -127,7 +128,7 @@ function onNodeSelect(nodeId) { switch(tree.getUserData(nodeId,"modif")) { case 'text': k='valeur'; - v=''; + v=''; break; case 'both': k=''; @@ -240,6 +241,10 @@ function insertNewChild(a,b,c) { function newVirtualHost() { var rep=prompt("$text{newVirtualHost}"); if(rep) { + if(!rep.match(/^\\w[\\w\\.\\-]*\\w\$/)){ + alert('$text{invalidVirtualHostName}'); + return 0; + } insertNewChild('virtualHosts',rep,rep) tree.setUserData(rep,'modif','text'); insertNewChild(rep,rep+'_exportedHeaders','$text{httpHeaders}'); diff --git a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_i18n.pm b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_i18n.pm index 4e9b3c7a5..4821cd2a0 100644 --- a/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_i18n.pm +++ b/modules/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/_i18n.pm @@ -94,6 +94,7 @@ sub fr { confirmDeleteConf => "Vous allez effacer cette configuration. Confirmez-vous ?", configurationDeleted => 'Configuration éffacée', configurationNotDeleted => 'Configuration non éffacée', + invalidVirtualHostName => "Nom de d'hôte virtuel incorrect", }; } @@ -157,5 +158,6 @@ sub en { confirmDeleteConf => "You're going to delete configuration. Do you confirm ?", configurationDeleted => 'Configuration deleted', configurationNotDeleted => 'Configuration not deleted', + invalidVirtualHostName => 'Invalid virtual host name', }; } diff --git a/modules/lemonldap-ng-portal/example/index.pl b/modules/lemonldap-ng-portal/example/index.pl index 1edcae757..05c41c5b8 100644 --- a/modules/lemonldap-ng-portal/example/index.pl +++ b/modules/lemonldap-ng-portal/example/index.pl @@ -7,7 +7,7 @@ my $portal = Lemonldap::NG::Portal::SharedConf->new( configStorage => { type => 'File', dirName => '__CONFDIR__', - } + }, } );