Toujours dans la veine d’AutomatedLab, je propose dans cette article (qui fait suite à ces deux-ci : 1 et 2) un petit environnement de test pour toutes les authentifications IIS :
- Anonyme.
- Basique
- Kerberos
- NTLM
- Digest
- Certificat Client AD
- Certificat Client IIS 1:1
- Certificat ClientIIS N:1
- Formulaire
J’ai donc élaboré le script suivant. Ce script a besoin de :
- contoso.com.zip : qui contient la source de notre site Web.
L’environnement est composé de 4 serveurs :
- IISNODE01 : Serveur IIS
- CLIENT01 : Poste client
- CA01 : Autorité de certificats
- DC01 : Contrôleur de domaine (contoso.com)
Le nom des serveurs est écrit dans le code (faites un “Global Replace” CTRL+H si les noms ne vous conviennent pas). De même que certains autres paramètres tels que :
- Le nom du Lab (“IISAuthLab” par défaut)
- Le compte d’administration à utiliser (“Administrator” par défaut)
- Le compte de test pour les divers authentifications (“JohnDoe” par défaut).
- Le mot de passe associé (“P@ssw0rd” par défaut)
- Le nom du domaine (FQDN et NetBIOS) (“contoso.com” et “CONTOSO” par défaut)
- Le compte du compte de démarrage de l’application pool IIS (“IISAppPoolUser” par défaut)
- Le nom des sites web utilisés (anonymous.contoso.com, basic.contoso.com …)
- Le compte d’impersonation pour l’authentification par certificat IIS (N:1).
Une fois le script terminé, connectez-vous sur CLIENT01 et démarrez Internet Explorer (et cliquez sur l’icône “Home” – Si rien n’apparaît lancer un “gpupdate /force /wait:-1”). Toutes les sites web s’ouvriront automatiquement et vous obtiendrez alors (un onglet par site/authentification):
Quelques liens utiles :
- https://docs.microsoft.com/en-us/archive/blogs/friis/the-complete-list-of-changes-to-make-to-activate-client-certificate-mapping-on-iis-using-active-directory
- https://techcommunity.microsoft.com/t5/iis-support-blog/configuring-many-to-one-client-certificate-mappings-for-iis-7-7/ba-p/346732
- https://docs.microsoft.com/en-us/iis/manage/configuring-security/configuring-one-to-one-client-certificate-mappings
So I developed the following script. This script needs:
- contoso.com.zip : which contains the source of our website.
The environment is composed of 4 servers:
- IISNODE01: IIS server
- CLIENT01: Client machine
- CA01: Certificate Authority
- DC01: Domain Controller (contoso.com)
The name of the servers is written in the code (make a “Global Replace” CTRL+H if the names do not suit you). As well as certain other parameters such as:
- Lab name (“IISAuthLab” by default)
- The administration account (“Administrator” by default)
- The test account for the authentications (“JohnDoe” by default).
- The associated password (“P@ssw0rd” by default)
- The domain name (FQDN and NetBIOS) (“contoso.com” and “CONTOSO” by default)
- The IIS application pool identity (“IISAppPoolUser” by default)
- The name of the used websites (anonymous.contoso.com, basic.contoso.com …)
- The account used for the IIS Certificat Client Many to One.
Once the script is done, connect to CLIENT01 and start Internet Explorer (and click on the “Home” button – If nothing appears run a “gpupdate /force /wait:-1” command). All websites will open automatically and you will get (one tab per website/authentication):
Some useful links:
- https://docs.microsoft.com/en-us/archive/blogs/friis/the-complete-list-of-changes-to-make-to-activate-client-certificate-mapping-on-iis-using-active-directory
- https://techcommunity.microsoft.com/t5/iis-support-blog/configuring-many-to-one-client-certificate-mappings-for-iis-7-7/ba-p/346732
- https://docs.microsoft.com/en-us/iis/manage/configuring-security/configuring-one-to-one-client-certificate-mappings
Laurent.