Guide pratique de la réalisation d'une passerelle d'authentification avec Samba

Adaptation française du Samba Authenticated Gateway HOWTO

Guillaume Lelarge

Adaptation française

François-Xavier Detournière

Relecture de la version française

Jean-Philippe Guérard

Préparation de la publication de la v.f.

Version : 1.3.fr.1.0

17 février 2004

Historique des versions
Version 1.3.fr.1.02005-02-17GL, JPG
Mise à jour de la traduction française
Version 1.32005-01-06RAM
Version 1.2.1.fr.1.02004-11-06GL
Mise à jour de la traduction française
Version 1.2.12004-10-22RAM
Version 1.2.fr.1.02004-06-04GL
Version 1.22004-05-21RAM
Version 1.1.1.fr.1.02003-07-15GL
Version 1.1.12003-07-14RAM
Version 1.1.0.fr.1.02003-05-08GL, FXD, JPG
Version 1.1.02002-05-03RAM

Résumé

Ce document a pour but d'expliquer la construction d'une passerelle pare-feu, utilisant un contrôleur primaire de domaine Samba (PDC ou Primary Domain Controller) et un ensemble de règles pour authentifier les utilisateurs.


Table des matières

Introduction
Aperçu
Pour commencer en douceur
Limitations de responsabilité
Disclaimer
Nouvelles versions
Traductions
Commentaires et corrections
Droits d'utilisation et marques déposées
Copyright and trademarks
Remerciements
Besoins
Connaissances
Logiciels
Configuration de la machine Linux
Configuration basique du système
Hiérarchie des répertoires supplémentaires
Configuration du pare-feu
Configuration de Samba
Autre solution
Configuration de SSH
Important
Génération de paire de clés
Script de connexion activé par SSH
Configuration des stations Windows
Introduction
Protocoles réseau
Configuration de DHCP
Joindre le domaine de votre serveur Linux
Éditeur de politiques
Gestion des utilisateurs
Ajouter des utilisateurs
Gestion des mots de passe
Autoriser ou non l'accès aux utilisateurs
Gestion des groupes
Créer les groupes
Politique des groupes
Bibliographie
A. Adaptation française
Traduction
Relecture
Préparation de la publication
B. GNU Free Documentation License
PREAMBLE
APPLICABILITY AND DEFINITIONS
VERBATIM COPYING
COPYING IN QUANTITY
MODIFICATIONS
COMBINING DOCUMENTS
COLLECTIONS OF DOCUMENTS
AGGREGATION WITH INDEPENDENT WORKS
TRANSLATION
TERMINATION
FUTURE REVISIONS OF THIS LICENSE
ADDENDUM: How to use this License for your documents

Ce document a pour but de vous faire comprendre (ainsi qu'à moi) le processus de construction d'un pare-feu ou d'une passerelle Linux, capable de modifier ses règles à la demande lorsque les utilisateurs se connectent ou se déconnectent de leurs postes de travail Windows.

Dans ce document, j'essaierai de montrer comment construire une passerelle pour faire du NAT ou du MASQUERADE avec des stations Windows. Utilisez votre imagination pour le modifier et avoir tout type de gestion des réseau. Vous pouvez l'utiliser pour autoriser ou refuser l'accès depuis votre réseau à des services, des serveurs ou à des sous-réseaux complets.

Imaginez que vous devez construire une passerelle pour laisser les stations Windows accéder à Internet et que vous avez besoin d'authentifier chaque utilisateur avant de le laisser accéder aux réseaux externes. La première solution à laquelle vous pensez est Squid. C'est en fait une bonne solution quand les accès HTTP et FTP sont suffisants à vos utilisateurs. Mais lorsqu'arrive le moment où vous devez les laisser accéder à d'autres services comme POP, SMTP, SSH, un serveur de base de données ou tout autre chose, vous penserez immédiatement à NAT ou MASQUERADE. Mais qu'en est-il de l'authentification de l'utilisateur ?

Donc, ceci est ma solution. Elle vous permet l'authentification de l'utilisateur et un contrôle beaucoup plus fin de son accès aux réseaux externes.

La dernière version originale de ce document est disponible sur http://ram.eti.br et sur http://www.tldp.org.

Il est possible de trouver les guides pratiques relatifs à ce document sur la page du projet de documentation Linux (LDP) sur http://tldp.org/.

La dernière version française de ce document est disponible sur www.traduc.org.

Une version portuguaise est disponible.

Une traduction française réalisée par Guillaume Lelarge est disponible sur www.traduc.org (NdT : Si vous voulez participer aux traductions, n'hésitez pas. Votre aide sera la bienvenue !)

Une traduction hongroise est disponible sur http://tldp.fsf.hu.

Ce guide pratique suppose que vous avez un noyau de la série 2.4 car il utilise iptables. En dehors de ceci, il n'existe aucune autre raison pour laquelle il ne pourrait pas être utilisé avec une machine disposant d'un noyau 2.2 après avoir adapté les scripts à ipchains.

Bien sûr, vous avez besoin d'installer les outils utilisateur d'iptables, un serveur HTTP apache si vous voulez utiliser un outil CGI pour changer les mots de passe, et samba. Et vous aurez besoin d'un noyau compilé avec les modules iptables.

Vous pouvez utiliser DHCP. Si c'est le cas, il est assez simple de le configurer. Rappelez-vous de configurer le serveur DHCP pour qu'il donne l'adresse IP du serveur de noms ainsi que l'adresse IP de la passerelle. Les machines Windows feront bon usage de cette information.

Il est très improbable que le noyau de votre distribution n'ait pas été compilé avec iptables et que les outils utilisateur ne soient pas non plus installés. Néanmoins, si vous ne les avez pas, référez-vous à http://www.netfilter.org/ ou http://www.iptables.org/ pour récupérer le logiciel et la documentation.

Vous aurez besoin d'une configuration basique du pare-feu pour que la passerelle fonctionne. Jetez un œil sur le tutoriel iptables disponible sur netfilter.org. Cette lecture est très intéressante. Néanmoins, si vous n'avez pas de temps pour cela, le code suivant est très basique mais il peut convenir à vos besoins :

#!/bin/sh
IPTABLES=/usr/sbin/iptables
/sbin/depmod -a
/sbin/insmod ip_tables
/sbin/insmod ip_conntrack
/sbin/insmod ip_conntrack_ftp
/sbin/insmod ip_conntrack_irc
/sbin/insmod iptable_nat
/sbin/insmod ip_nat_ftp
echo "1" > /proc/sys/net/ipv4/ip_forward
echo "1" > /proc/sys/net/ipv4/ip_dynaddr
$IPTABLES -P INPUT ACCEPT
$IPTABLES -F INPUT
$IPTABLES -P OUTPUT ACCEPT
$IPTABLES -F OUTPUT
$IPTABLES -P FORWARD ACCEPT
$IPTABLES -F FORWARD
$IPTABLES -t nat -F

Vous remarquerez que ce code ne fait que charger les modules du noyau en relation avec NAT et le pare-feu, et mettre en place la transmission des paquets. Vous pouvez (et devriez) placer toutes les règles pour donner à votre passerelle un comportement standard, mais toute la magie sera réalisée par des scripts appelés par le démon samba.

S'il-vous-plait, rappelez-vous que ce code n'apporte pas la moindre sécurité ! N'utilisez pas cet exemple sur des machines de production. Cet exemple a seulement pour but d'informer. Vous devez ajouter une configuration de pare-feu convenant à votre système.

Vous êtes prévenus !

Vérifiez que Samba est installé. Si votre distribution ne vient pas avec Samba préparé, alors référez-vous à http://www.samba.org pour obtenir le paquetage et la documentation sur son installation. Regardez sur leur site web et apprenez. Le site est rempli de documentations et peut-être que votre distribution Linux dispose elle-aussi de documentation sur Samba.

Nous aurons besoin de configurer Samba comme contrôleur principal de domaine. Je donnerais un fichier de configuration en exemple, mais vous devriez lire la collection de guides pratiques sur Samba et tout apprendre sur les PDC.

Le partage netlogon est l'endroit où les stations Windows vont télécharger le script de connexion (logon). Nous avons besoin de ce partage pour y placer un script de connexion qui dira à la station de monter un partage que nous utiliserons pour tracer l'adresse IP de l'utilisateur.

Comme vous le voyez, il doit y avoir une ligne comme ci-dessous dans votre fichier smb.conf.

logon script = netlogon.bat

Cette ligne indiquera au client Windows de télécharger et exécuter le script nommé netlogon.bat. Ce script doit être placé dans le partage netlogon. Donc, nous aurons aussi besoin d'un script netlogon.bat pour vos stations Windows. Vous pouvez utiliser l'exemple suivant et créer un fichier nommé NETLOGON.BAT et placé dans le partage netlogon, dans ce cas dans /home/samba/netlogon/NETLOGON.BAT.

REM NETLOGON.BAT
net use z: \\linux\samba /yes

Ce script indiquera aux stations Windows de monter le partage spécifié, et donc nous serons capable de garder la trace de l'utilisateur et de la station au travers de la sortie du programme smbstatus.

Assez simple ! Mais pas suffisant…

Comme vous pouvez le voir, nous aurons aussi besoin d'un partage de traces que j'ai nommé samba dans cet exemple. Vous pouvez voir dans le fichier smb.conf la configuration du partage de traces :

[samba]
comment = login tracking share
path = /home/samba/samba
browseable = No
root preexec = /usr/local/bin/netlogon.sh %u  %I
root postexec = /usr/local/bin/netlogoff.sh %u

Comme vous pouvez le deviner, ou le savoir si vous avez lu la documentation de Samba, les lignes « root preexec » et « root postexec » indiquent à Samba de lancer les scripts indiqués lorsqu'un utilisateur monte ou démonte le partage. Dans ce cas, nous passons le nom de l'utilisateur comme paramètre au script. Notez le %u à la fin des lignes. Ces scripts vont appeler un script ou un programme pour modifier les règles de filtrage de paquets de notre passerelle.

Notez que le script netlogon.sh doit vérifier si la station en question a déjà monté le partage des traces.

Jetez un œil sur les scripts netlogon.sh et netlogoff.sh :

#!/bin/sh
#
# netlogon.sh
#
# usage:
# netlogon.sh <nom_utilisateur>
#
if [ -f /var/run/smbgate/$1 ] ; then
    exit 0
fi
echo $2 > /var/run/smbgate/$1
IPTABLES='/usr/sbin/iptables'
EXTIF='eth0'
COMMAND='-A'
ADDRESS=`cat /var/run/smbgate/$1`
GROUP=`groups $1 | gawk '// { print $3 }'`
if [ -f /etc/smbgate/users/$1 ] ; then
    /etc/smbgate/users/$1 $COMMAND $ADDRESS $EXTIF
else     
    if [ -f /etc/smbgate/groups/$GROUP ] ; then
        /etc/smbgate/groups/$GROUP $COMMAND $ADDRESS $EXTIF
    else
        /etc/smbgate/users/default.sh $COMMAND $ADDRESS $EXTIF
    fi
fi

Ce script (netlogon.sh) a pour but d'être exécuté lors de la connexion de l'utilisateur et de sélectionner les scripts à exécuter suivant le nom de l'utilisateur et le groupe auquel celui-ci appartient. L'adresse IP de l'utilisateur sera enregistré dans un fichier sous /var/run/smbgate pour en conserver la trace. Le fichier prendra le nom de l'utilisateur et servira de nouveau lorsque celui-ci se déconnectera. L'adresse IP sera passée en argument à un script avec le nom de l'utilisateur qui mettra à jour les règles du pare-feu.

Notez que ce script commence par chercher un script utilisateur, puis, si il n'en trouve pas, il cherche un script groupe et, finalement, si il n'en trouve pas non plus, il utilise le script default.sh. Vous pouvez modifier cette logique et ce comportement si vous le souhaitez ou en avez besoin. Rappelez-vous simplement de modifier les autres de manières concordantes.

Il y a des chances pour que l'utilisateur appartienne à plus d'un des scripts et que ces scripts échouent. Je n'ai pas le temps d'écrire un meilleur code.

#!/bin/sh
#
# netlogoff.sh
#
# usage:
# netlogoff.sh <username>
#
IPTABLES='/usr/sbin/iptables'
EXTIF='ppp0'
COMMAND='-D'
TRACKSHARE="samba"
ADDRESS=`cat /var/run/smbgate/$1`
GROUP=`groups $1 | gawk '// { print $3 }'`
NM=`smbstatus -u $1 | grep $TRACKSHARE | wc -l`
if [ $NM -gt 0 ]; then
    exit
fi
if [ -f /etc/smbgate/users/$1 ] ; then
    /etc/smbgate/users/$1 $COMMAND $ADDRESS $EXTIF
else
    if [ -f /etc/smbgate/groups/$GROUP ] ; then
        /etc/smbgate/groups/$GROUP $COMMAND $ADDRESS
$EXTIF
    else
        /etc/smbgate/users/default.sh $COMMAND $ADDRESS
$EXTIF
    fi
fi
rm -f /var/run/smbgate/$1

Ce script (netlogoff.sh) a pour but d'être exécuté lors de la déconnexion de l'utilisateur. Il récupérera l'adresse à partir du fichier /var/run/smbgate/user, adresse qui sera passée en argument pour le script /etc/smbgate/users/user. Ce dernier mettra à jour le pare-feu dans l'état désiré lorsque l'utilisateur ne sera plus connecté.

Certaines versions de Windows, telles que Windows 2000, montent le répertoire partagé plus d'une fois lors de la connexion. Ceci peut apporter des problèmes avec les scripts netlogon.sh et netlogoff.sh en les exécutant plus d'une fois. Donc, vous pouvez utiliser un script de vérification de déconnexion lancé par le cron au lieu d'un script netlogoff.sh lancé par Samba. En voici un exemple :

#!/bin/sh
# checklogout.sh
#
# usage:
# doit être lancé par cron (par exemple toutes les dix minutes)
#

TRACKDIR="/var/run/smbgate"
DIRLENGTH=${#TRACKDIR}
TRACKSHARE="samba"
EXTIF='eth0'
COMMAND='-D'
if [ -d $TRACKDIR ]; then
  for n in $TRACKDIR/*; do
    [ -d $n ] && continue;
      if [ -f $n ] ; then 
        IPADDRESS=`cat $n`
        USERNAME=${n:$DIRLENGTH+1}
        NMS=`smbstatus -u $USERNAME | grep $TRACKSHARE | \
          grep $IPADDRESS | grep -v grep | wc -l`
        if [ $NMS == 0 ] ; then
          rm -f $n
        GROUP=`groups $USERNAME | gawk '// { print $3 }'`
        if [ -f /etc/smbgate/users/$USERNAME ] ; then
          /etc/smbgate/users/$USERNAME $COMMAND $IPADDRESS $EXTIF
        else
          if [ -f /etc/smbgate/groups/$GROUP ] ; then
            /etc/smbgate/groups/$GROUP $COMMAND $IPADDRESS $EXTIF
          else
            /etc/smbgate/users/default.sh $COMMAND $IPADDRESS $EXTIF
          fi
        fi
      fi
    else
      exit 0
    fi
  done
fi

Dans ce cas, vous devez supprimer la clause postexec de la déclaration du partage dans smb.conf :

root postexec = /usr/local/bin/netlogoff.sh %u

La suite est un script standard /etc/smbgate/users/user. Ce script modifiera réellement les règles du pare-feu.

#!/bin/sh
#
COMMAND=$1
ADDRESS=$2
EXTIF=$3
IPTABLES='/usr/sbin/iptables'
$IPTABLES $COMMAND POSTROUTING -t nat -s $ADDRESS -o $EXTIF -j MASQUERADE

Nous devons aussi avoir un script default.sh sur /etc/smbgate/users/ pour donner à la passerelle un comportement par défaut.

#!/bin/sh
#
# default.sh
COMMAND=$1
ADDRESS=$2
EXTIF=$3
IPTABLES='/usr/sbin/iptables'
#$IPTABLES $COMMAND POSTROUTING -t nat -s $ADDRESS -o $EXTIF -j MASQUERADE
exit 0

Le schéma complet de montage d'un partage de traces et de scripts déclenchés pour mettre à jour le pare-feu, et l'attente d'un nouveau déclenchement au démontage pour réinitialiser la règle du pare-feu pourraient trop porter à confusion, voire ne pas fonctionner. Cela pourrait même devenir obsolète lorsque le projet Samba apportera de nouvelles fonctionnalités.

La dernière version de Samba dispose de la capacité de lister les utilisateurs connectés. J'ai utilisé cette fonctionnalité dans un script pour tracer les utilisateurs et mettre à jour le pare-feu à leur (dé)connexion. Ce script ne requiert pas tout le travail décrit dans ce texte. En fait, il est très facile à utiliser.

Vous pouvez télécharger le code à partir du site du projet sur http://sourceforge.net/projects/smbgate/.

Vous pouvez vouloir utiliser votre PDC sur une machine et avoir une autre machine réalisant la fonction de passerelle. Dans ce cas, vous devez configurer votre passerelle de façon à ce qu'elle accepte les connexions authentifiées avec RSA sans mots de passe du PDC.

Jetez un œil sur le site www.openssh.org pour une information sur une configuration propre pour votre serveur et votre client SSH.

Configurez les stations Windows pour qu'elles se connectent sur le domaine et donnez le nom du domaine de votre serveur Linux. Ceci est essentiel pour le fonctionnement de la passerelle.

Vous devez savoir que pour faire joindre certaines versions de Windows à un contrôleur de domaine Samba, vous devez créer des comptes sur le PDC Linux. Regardez dans la documentation Samba pour comprendre comment configurer votre PDC pour la version spécifique de Windows que vous avez.

Comme vous pouvez le voir dans la section précédente de ce guide pratique, le démon Samba sera appelé par un script netlogon.sh à chaque fois que le partage des traces sera monté. Ce script netlogon.sh appellera un script avec le nom de l'utilisateur, donnant ainsi l'adresse IP de la station de travail en question en paramètre. Ce script utilisateur appliquera les règles souhaitées.

Par exemple, si vous voulez donner à l'utilisateur un accès complet à internet :

#!/bin/sh
#
COMMAND=$1
ADDRESS=$2
EXTIF=$3
IPTABLES='/usr/sbin/iptables'
$IPTABLES $COMMAND POSTROUTING -t nat -s $ADDRESS -o $EXTIF -j MASQUERADE

Si vous ne voulez pas modifier quoi que ce soit pour un utilisateur particulier, créez-lui simplement un script vide :

#/bin/sh
#
exit 0

Vous pouvez aussi ne pas créer de scripts pour les utilisateurs les moins privilégiés, en les laissant avec le script default.sh, qui sera aussi vide que le précédent, ou donnez un accès limité de cette façon :

#!/bin/sh
#
COMMAND=$1
ADDRESS=$2
EXTIF=$3
EXTIFADDRESS=$4
IPTABLES='/usr/sbin/iptables'
$IPTABLES $COMMAND POSTROUTING -t nat -s $ADDRESS -o $EXTIF --dport 25 -j SNAT \
    --to-source $EXTIFADDRESS
$IPTABLES $COMMAND POSTROUTING -t nat -s $ADDRESS -o $EXTIF --dport 110 -j SNAT \
    --to-source $EXTIFADDRESS

Rappelez-vous que ce script nécessite la modification de tous les scripts précédents pour inclure le paramètre supplémentaire. Et rappelez-vous que vous n'irez nulle part avec ce guide pratique si vous ne comprenez pas iptables.

A. Adaptation française

La publication de ce document a été préparée par Jean-Philippe Guérard  :

  • transformation des adresses électroniques pour éviter les faucheurs d'adresses ;

  • transformation des oe appropriés (dans œil, œuvre, etc.) en « &oelig; » ;

  • intégration de la partie copyright et disclaimer en v.o. en plus de la v.f. conformément à la licence ;

  • ajout de blancs insécables (&nbsp;) devant les ponctuations doubles ;

  • transformations des guillemets en guillemets français "«&nbsp;" et "&nbsp;»" ;

  • correction du lien vers la « collection des howto samba ».

B. GNU Free Documentation License

This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The "Document", below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as "you". You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law.

A "Modified Version" of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language.

A "Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them.

The "Invariant Sections" are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none.

The "Cover Texts" are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words.

A "Transparent" copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not "Transparent" is called "Opaque".

Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML, PostScript or PDF designed for human modification. Examples of transparent image formats include PNG, XCF and JPG. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML, PostScript or PDF produced by some word processors for output purposes only.

The "Title Page" means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, "Title Page" means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text.

A section "Entitled XYZ" means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as "Acknowledgements", "Dedications", "Endorsements", or "History".) To "Preserve the Title" of such a section when you modify the Document means that it remains a section "Entitled XYZ" according to this definition.

The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License.

If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects.

If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages.

If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public.

It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document.

You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version:

  1. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission.
  2. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement.
  3. State on the Title page the name of the publisher of the Modified Version, as the publisher.
  4. Preserve all the copyright notices of the Document.
  5. Add an appropriate copyright notice for your modifications adjacent to the other copyright notices.
  6. Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below.
  7. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice.
  8. Include an unaltered copy of this License.
  9. Preserve the section Entitled "History", Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled "History" in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence.
  10. Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the "History" section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission.
  11. For any section Entitled "Acknowledgements" or "Dedications", Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein.
  12. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles.
  13. Delete any section Entitled "Endorsements". Such a section may not be included in the Modified Version.
  14. Do not retitle any existing section to be Entitled "Endorsements" or to conflict in title with any Invariant Section.
  15. Preserve any Warranty Disclaimers.

If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles.

You may add a section Entitled "Endorsements", provided it contains nothing but endorsements of your Modified Version by various parties--for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard.

You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one.

The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version.

You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers.

The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work.

In the combination, you must combine any sections Entitled "History" in the various original documents, forming one section Entitled "History"; likewise combine any sections Entitled "Acknowledgements", and any sections Entitled "Dedications". You must delete all sections Entitled "Endorsements".