IIS, SQL Server et Délégation Kerberos Contrainte via AutomatedLab / IIS, SQL Server and Constrained Kerberos Delegation via AutomatedLab

Go to English version

Toujours dans la veine d’AutomatedLab, je propose dans cette article (qui fait suite à ceux-ci) un petit environnement de test la mise en place de la délégation Kerberos contrainte entre IIS et SQL Server

J’ai donc élaboré le script suivant. Ce script  a besoin de :

L’environnement est composé de 4 serveurs :

  • DC01 : Contrôleur de domaine (contoso.com)
  • SQL01: Serveur SQL Server
  • IIS01 : Serveur IIS
  • CLIENT01 : Poste client

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 (« IISSQLKerbDeleg » par défaut)
  • Le compte d’administration à utiliser (« Administrator » 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 du sites web utilisé (wideworldimporters.contoso.com)

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 »). Le site web http://wideworldimporters.contoso.com s’ouvrira automatiquement et vous obtiendrez alors :

 

Connectez-vous alors sur le serveur SQL01 et lancer un « SQL Server Profiler » (puis cliquer sur « File > New Trace – ou CTRL + N et ensuite « Connect » puis « Run » en laissant les valeurs par défaut ).

Revenez ensuite à CLIENT01 et cliquer sur le Bouton « People » (cf. capture d’écran ci-dessus). En revenant sur la fenêtre du « SQL Server Profiler » sur le serveur SQL01 vous constaterez que l’identité du client (« CONTOSO\Administrator « ) est reconnu jusque sur le serveur SQL01 grâce à la délégation contrainte Kerberos (qui est configuré sur le compte « IISAppPoolUser » – cf. sur DC01).

 

 

Quelques liens utiles :

Aller à la version française

Still working on AutomatedLab, I propose in this article (which follows these ones) a small test environment for setting up Constrained Kerberos Delegation between IIS and SQL Server

So I developed the following script. This script needs:

The environment is composed of 4 servers:

  • DC01: Domain Controller (contoso.com)
  • SQL01: SQL Server
  • IIS01: IIS server
  • CLIENT01: Client machine

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 (« IISSQLKerbDeleg » by default)
  • The administration account (« Administrator » 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 website (wideworldimporters.contoso.com)

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). The http://wideworldimporters.contoso.com website will open automatically and you will get:

 

Connect to the SQL01 server and launch a « SQL Server Profiler » (then click on « File> New Trace – or CTRL + N and then » Connect « then » Run », leaving the default values).

Then come back to CLIENT01 and click on the « People » button (see screenshot above). Returning to the « SQL Server Profiler » window on the SQL01 server, you will notice that the identity of the client (« CONTOSO\Administrator ») is recognized up to the SQL01 server thanks to the Kerberos constrained delegation (which is configured on the account « IISAppPoolUser » – see on DC01).

 

 

 

Some useful links:

Laurent.

Feel free to share:)