<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>IAM The French Blog</title>
	<atom:link href="http://www.iamthefrenchblog.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.iamthefrenchblog.com</link>
	<description>The French Blog on Identity and Access Management</description>
	<lastBuildDate>Tue, 24 Apr 2012 09:21:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Un Module PowerShell pour Centrify DirectControl</title>
		<link>http://www.iamthefrenchblog.com/2012/04/un-module-powershell-pour-centrify-directcontrol/</link>
		<comments>http://www.iamthefrenchblog.com/2012/04/un-module-powershell-pour-centrify-directcontrol/#comments</comments>
		<pubDate>Tue, 24 Apr 2012 09:20:52 +0000</pubDate>
		<dc:creator>Fabrice</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Centrify Suite]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Centrify]]></category>
		<category><![CDATA[Direct Control]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[powershell]]></category>

		<guid isPermaLink="false">http://www.iamthefrenchblog.com/?p=583</guid>
		<description><![CDATA[Voici un Module PowerShell très utile pour gérer les données stockées par Centrify dans Active Directory. En effet, si vous avez des modifications à apporter et ceci de façon répétitive (implémentation de Design AD, importation de compte utilisateurs Unix dans AD, importation de définitions de privilèges Sudo vers DirectAuthorize, etc.), il est fort utile de [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.iamthefrenchblog.com/wp-content/uploads/2010/07/brand_centrify.gif"><img class="alignleft size-full wp-image-73" style="margin: 20px;" title="brand_centrify" src="http://www.iamthefrenchblog.com/wp-content/uploads/2010/07/brand_centrify.gif" alt="" width="187" height="48" /></a>Voici un Module PowerShell très utile pour gérer les données stockées par Centrify dans Active Directory. En effet, si vous avez des modifications à apporter et ceci de façon répétitive (implémentation de Design AD, importation de compte utilisateurs Unix dans AD, importation de définitions de privilèges Sudo vers DirectAuthorize, etc.), il est fort utile de pouvoir scripter tout ceci. Si Centrify fournissait un SDK avec les version 3.x et 4.x de DirectControl, celui-ci ne permettait guère plus que l&#8217;utilisation du VB script et plus intéressant la possibilité de créer ses propres dll (mais là on rentre dans du développement lourd).</p>
<p>Cela fait un moment que je discute avec Centrify de l&#8217;intérêt de fournir des Cmdlets PowerShell, parce qu&#8217;à chaque fois que la gestion des données stockées de l&#8217;AD sera effectuée par des équipes Windows, l&#8217;utilisation de PowerShell est aujourd&#8217;hui plus séduisante que des scripts VB !</p>
<p>Voici donc ma contribution aux outils fournis par Centrify, leur succès sur site fait que les Cmdlets PowerShell seront intégrés prochainement dans la Suite Centrify (probablement à partir de la 5.1).</p>
<p>Je posterai plusieurs exemples de scripts aidant à la gestion de Centrify ou aidant la migration des données depuis Unix vers AD, mais en attendant&#8230;</p>
<p>Bon scripting ^^</p>
<p>Visiter la page dédiée : <a title="Centrify PowerShell Module" href="http://www.iamthefrenchblog.com/centrify-powershell-module/">Centrify PowerShell Module</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.iamthefrenchblog.com/2012/04/un-module-powershell-pour-centrify-directcontrol/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ADInit : un script PowerShell pour déployer une organisation dans AD</title>
		<link>http://www.iamthefrenchblog.com/2012/02/adinit-un-script-powershell-pour-deployer-une-organisation-dans-ad/</link>
		<comments>http://www.iamthefrenchblog.com/2012/02/adinit-un-script-powershell-pour-deployer-une-organisation-dans-ad/#comments</comments>
		<pubDate>Tue, 21 Feb 2012 18:00:09 +0000</pubDate>
		<dc:creator>Fabrice</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[ADInit]]></category>
		<category><![CDATA[Astuces]]></category>
		<category><![CDATA[Centrify Suite]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Centrify]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.iamthefrenchblog.com/?p=489</guid>
		<description><![CDATA[Quand il s&#8217;agit de déployer une organisation complète dans un annuaire Active Directory (OU, Groupes, délégations, etc.), il est souvent impensable de faire ça  à la main dans la console d&#8217;administration AD de la MMC ou autre navigateur LDAP. Et à moins d&#8217;embaucher des chinois dans un cave, pour créer les quelques centaines d&#8217;objets dans [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.iamthefrenchblog.com/wp-content/uploads/2010/12/ps_icon.png"><img class="alignleft  wp-image-187" style="margin: 20px;" title="ps_icon" src="http://www.iamthefrenchblog.com/wp-content/uploads/2010/12/ps_icon.png" alt="" width="154" height="154" /></a>Quand il s&#8217;agit de déployer une organisation complète dans un annuaire Active Directory (OU, Groupes, délégations, etc.), il est souvent impensable de faire ça  à la main dans la console d&#8217;administration AD de la MMC ou autre navigateur LDAP. Et à moins d&#8217;embaucher des chinois dans un cave, pour créer les quelques centaines d&#8217;objets dans AD, la solution passe généralement par un script.</p>
<p>Oui mais voilà, généralement on créé des structures relativement identiques, et si on pouvais disposer d&#8217;un script suffisamment générique pour créer tout ça ?</p>
<p>Eh bien oui c&#8217;est possible, voilà donc un script PowerShell à base de PS 2.0, qui reçoit en entrée un fichier texte décrivant les opérations à faire dans l&#8217;annuaire AD de son choix. Ce script m&#8217;a été inspiré par un script VBS que j&#8217;ai eu l&#8217;occasion d&#8217;utiliser il y a bientôt deux ans dans un grand groupe international, merci à l&#8217;auteur de ce premier script dont j&#8217;ai malheureusement complétement oublié le nom Oo.</p>
<p>J&#8217;ai créé une page dédiée à ce script, n&#8217;hésitez pas à l&#8217;utiliser et à me faire part de vos remarques ^^</p>
<p>La page du script ADInit : <a title="ADInit" href="http://www.iamthefrenchblog.com/adinit/">ADInit</a></p>
<p>La page de téléchargement : <a title="Download" href="http://www.iamthefrenchblog.com/adinit/download/">ADInit Download</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.iamthefrenchblog.com/2012/02/adinit-un-script-powershell-pour-deployer-une-organisation-dans-ad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Un token OTP pour jouer à Star Wars &#8211; The Old Republic</title>
		<link>http://www.iamthefrenchblog.com/2012/01/un-token-otp-pour-jouer-a-star-wars-the-old-republic/</link>
		<comments>http://www.iamthefrenchblog.com/2012/01/un-token-otp-pour-jouer-a-star-wars-the-old-republic/#comments</comments>
		<pubDate>Sun, 29 Jan 2012 08:36:24 +0000</pubDate>
		<dc:creator>Fabrice</dc:creator>
				<category><![CDATA[Actualités]]></category>
		<category><![CDATA[authentification]]></category>
		<category><![CDATA[OTP]]></category>
		<category><![CDATA[token]]></category>

		<guid isPermaLink="false">http://www.iamthefrenchblog.com/?p=485</guid>
		<description><![CDATA[Quand la sécurité numérique s&#8217;immisce dans la vie quotidienne Les éditeurs du jeu en ligne Star Wars &#8211; The Old Republic proposent d&#8217;utiliser un token OTP pour sécuriser l&#8217;accés à votre compte en ligne lorsque vous jouer. En effet le principe de l&#8217;OTP fait que le code généré par le token que vous possédez est [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.iamthefrenchblog.com/wp-content/uploads/2012/01/keyfob.png"><img class="alignleft size-full wp-image-486" style="margin: 20px;" title="keyfob" src="http://www.iamthefrenchblog.com/wp-content/uploads/2012/01/keyfob.png" alt="" width="206" height="154" /></a>Quand la sécurité numérique s&#8217;immisce dans la vie quotidienne <img src='http://www.iamthefrenchblog.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Les éditeurs du jeu en ligne Star Wars &#8211; The Old Republic proposent d&#8217;utiliser un token OTP pour sécuriser l&#8217;accés à votre compte en ligne lorsque vous jouer. En effet le principe de l&#8217;OTP fait que le code généré par le token que vous possédez est vérifiable, c&#8217;est à dire que le token associé à votre compte ne peut générer qu&#8217;une certaine série de code (et dans un ordre vérifiable), garantissant ainsi un deuxiéme facteur d&#8217;authentification :</p>
<ul>
<li>Ce que je sais : le mot de passe de mon compte</li>
<li>Ce que je possède : le token OTP générant un code vérifiable</li>
</ul>
<p>A quand l&#8217;authentification par certificat numérique ou par biométrie pour ajouter un troisième facteur  ? (Ce que je suis)</p>
<p>La page d&#8217;info sur l&#8217;utilisation de votre token OTP : <a href="http://www.swtor.com/fr/clesecurisee">http://www.swtor.com/fr/clesecurisee</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.iamthefrenchblog.com/2012/01/un-token-otp-pour-jouer-a-star-wars-the-old-republic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visual Studio une application Steam ?</title>
		<link>http://www.iamthefrenchblog.com/2012/01/visual-studio-une-application-steam/</link>
		<comments>http://www.iamthefrenchblog.com/2012/01/visual-studio-une-application-steam/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 19:10:07 +0000</pubDate>
		<dc:creator>Fabrice</dc:creator>
				<category><![CDATA[Actualités]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.iamthefrenchblog.com/?p=483</guid>
		<description><![CDATA[Totalement inutile, donc indispensable ! Microsoft propose un Widget pour Visual Studio permettant de débloquer des badges au fur et à mesure d&#8217;accomplissements, histoire de prendre Visual Studio pour un jeu Steam Les badges sont rangés dans plusieurs catégories, un pop-up s&#8217;affiche dans Visual studio à chaque fois que vous gagnez un nouveau badge et [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.iamthefrenchblog.com/wp-content/uploads/2011/04/visual-studio-2010-logo.png"><img class="alignleft size-full wp-image-271" style="margin: 20px;" title="visual-studio-2010-logo" src="http://www.iamthefrenchblog.com/wp-content/uploads/2011/04/visual-studio-2010-logo.png" alt="" width="233" height="178" /></a>Totalement inutile, donc indispensable !</p>
<p>Microsoft propose un Widget pour Visual Studio permettant de débloquer des badges au fur et à mesure d&#8217;accomplissements, histoire de prendre Visual Studio pour un jeu Steam <img src='http://www.iamthefrenchblog.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Les badges sont rangés dans plusieurs catégories, un pop-up s&#8217;affiche dans Visual studio à chaque fois que vous gagnez un nouveau badge et vous allez même povoir twitter, facebooker, googler, bref pourrir le mur de vos potes, à chaque fois que vous aurez un badge.</p>
<p>Pour en savoir plus, lire le post du Blog Officiel de Visual Studio : <a href="http://blogs.msdn.com/b/visualstudio/archive/2012/01/18/announcing-visual-studio-achievements.aspx" target="_blank">http://blogs.msdn.com/b/visualstudio/archive/2012/01/18/announcing-visual-studio-achievements.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.iamthefrenchblog.com/2012/01/visual-studio-une-application-steam/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Livre Blanc Microsoft sur leur offre de cloud privé</title>
		<link>http://www.iamthefrenchblog.com/2012/01/livre-blanc-microsoft-sur-leur-offre-de-cloud-prive/</link>
		<comments>http://www.iamthefrenchblog.com/2012/01/livre-blanc-microsoft-sur-leur-offre-de-cloud-prive/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 14:20:25 +0000</pubDate>
		<dc:creator>Fabrice</dc:creator>
				<category><![CDATA[Actualités]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.iamthefrenchblog.com/?p=480</guid>
		<description><![CDATA[Un livre blanc intéressant pour mieux comprendre les offres de Cloud Privé, ce que présentent ici Microsoft dans un livre blanc publié le mois dernier étant en effet assez simailaire aux offres des autres géants du cloud tels qu&#8217;IBM, Oracle ou Amazon. Bonne lecture à tous. Le livre blanc en téléchargement  ici : Solutions de [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.iamthefrenchblog.com/wp-content/uploads/2011/11/microsoft.jpg"><img class="alignleft size-full wp-image-404" style="margin: 20px;" title="microsoft" src="http://www.iamthefrenchblog.com/wp-content/uploads/2011/11/microsoft.jpg" alt="" width="150" height="150" /></a>Un livre blanc intéressant pour mieux comprendre les offres de Cloud Privé, ce que présentent ici Microsoft dans un livre blanc publié le mois dernier étant en effet assez simailaire aux offres des autres géants du cloud tels qu&#8217;IBM, Oracle ou Amazon.</p>
<p>Bonne lecture à tous.</p>
<p>Le livre blanc en téléchargement  ici : <a href="http://www.iamthefrenchblog.com/wp-content/uploads/2012/01/Solutions-de-Cloud-Privé-Microsoft.pdf">Solutions de Cloud Privé Microsoft</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.iamthefrenchblog.com/2012/01/livre-blanc-microsoft-sur-leur-offre-de-cloud-prive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Protéger un objet des suppressions accidentelles avec PowerShell</title>
		<link>http://www.iamthefrenchblog.com/2012/01/proteger-un-objet-des-suppressions-accidentelles-avec-powershell/</link>
		<comments>http://www.iamthefrenchblog.com/2012/01/proteger-un-objet-des-suppressions-accidentelles-avec-powershell/#comments</comments>
		<pubDate>Thu, 19 Jan 2012 19:48:37 +0000</pubDate>
		<dc:creator>Fabrice</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Astuces]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.iamthefrenchblog.com/?p=476</guid>
		<description><![CDATA[Lorsque l&#8217;on utilise PowerShell pour créer des objets dans ActiveDirectory, il peut être intéressant dans le cas d&#8217;une OU ou d&#8217;un container d&#8217;appliquer le paramètres de Protection de l&#8217;objet des suppressions accidentelles, comme le fait si bien la case à cocher disponible dans la MMC. Bon, une case à cocher c&#8217;est très bien, mais quand [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.iamthefrenchblog.com/wp-content/uploads/2010/12/ps_icon.png"><img class="alignleft size-full wp-image-187" style="margin: 20px;" title="ps_icon" src="http://www.iamthefrenchblog.com/wp-content/uploads/2010/12/ps_icon.png" alt="" width="154" height="154" /></a>Lorsque l&#8217;on utilise PowerShell pour créer des objets dans ActiveDirectory, il peut être intéressant dans le cas d&#8217;une OU ou d&#8217;un container d&#8217;appliquer le paramètres de Protection de l&#8217;objet des suppressions accidentelles, comme le fait si bien la case à cocher disponible dans la MMC.</p>
<p>Bon, une case à cocher c&#8217;est très bien, mais quand on viens de faire un joli script qui nous créé en une seule passe les 150 OU de notre organisation AD, quand viens le moment de cocher 150 cases il viens comme une envie de se pendre (surtout qu&#8217;avant d&#8217;atteindre la case à cocher il aura fallu malmener sérieusement le clic gauche de la souris -_-)</p>
<p>En réalité, derrière cette case à cocher se cache trois ACE très simples, l&#8217;octroi du refus pour le groupe Builtin &laquo;&nbsp;Tout le monde&nbsp;&raquo; sur l&#8217;objet en question:</p>
<ul>
<li>Delete</li>
<li>DeleteChild</li>
<li>DeleteTree</li>
</ul>
<p>Maintenant il ne me reste plus qu&#8217;à vous montrer comment appliquer des ACE sur un objet de l&#8217;AD avec un script PowerShell.</p>
<p><span id="more-476"></span>Je ne vais décrire ici que la partie qui nous intéresse, se connecter à un objet ActiveDirectory de type OU pour l&#8217;exemple (ca marche évidement avec n&#8217;importe quel objet).</p>
<p>Le principe est assez simple, on commence par se connecter à l&#8217;objet avec la classe <strong>DirectoryServices.DirectoryEntry</strong>, puis on crée des objets ACE avec la classe <strong>DirectoryServices.ActiveDirectoryAccessRule</strong>.</p>
<p>Cette classe attend plusieurs paramètre dont le SID de l&#8217;objet qui va bénéficier de l&#8217;ACE, dans notre cas le SID est S-1-1-0 (SID spécifique correspondant au groupe Builtin &laquo;&nbsp;Tout le monde&nbsp;&raquo;).</p>
<p>Il faut également spécifier les droits que l&#8217;on veux authoriser ou refuser avec la collection <strong>DirectoryServices.ActiveDirectoryRights</strong>.</p>
<p>Finalement on précise le type d&#8217;ACE (Allow ou Deny) et l&#8217;héritage (ici None ce qui correspond à l&#8217;objet lui-même), respectivement avec les collections <strong>System.AccessControl.AccessControlType</strong> et <strong>DirectoryServices.ActiveDirectorySecurityInheritance</strong>.</p>
<p>Ne reste plus qu&#8217;à ajouter les ACE à l&#8217;objet et à valider le tout avec un Commit.</p>
<blockquote>
<pre><span style="color: #008000;"># Connect to Object</span>
<span style="color: #800080;">$Object</span> = <span style="color: #33cccc;">New-Object</span> <span style="color: #800000;">System.DirectoryServices.DirectoryEntry</span>(<span style="color: #800000;">"LDAP://OU=Test,DC=olympe,DC=demo"</span>)
<span style="color: #008000;"># Add ACE to Deny Delete, DeleteChild and DeleteTree for Everyone (which is actually the rights to protected from accidental deletion)</span>
<span style="color: #800080;">$Trustee</span> = <span style="color: #33cccc;">New-Object</span> <span style="color: #800000;">Security.Principal.SecurityIdentifier</span>(<span style="color: #800000;">"S-1-1-0"</span>)<span style="color: #008000;"> # S-1-1-0 is the SID for Everyone Built-In Group</span>
<span style="color: #800080;">$ACType</span> = [<span style="color: #33cccc;">Security.AccessControl.AccessControlType</span>]::<span style="color: #800000;">Deny</span>
<span style="color: #800080;">$Inheritance</span> = [<span style="color: #33cccc;">DirectoryServices.ActiveDirectorySecurityInheritance</span>]::<span style="color: #800000;">None</span>
<span style="color: #008000;"># Create and add ACE</span>
<span style="color: #800080;">$ACE</span> = <span style="color: #33cccc;">New-Object</span> <span style="color: #800000;">System.DirectoryServices.ActiveDirectoryAccessRule</span>(<span style="color: #800080;">$Trustee</span>, [<span style="color: #33cccc;">DirectoryServices.ActiveDirectoryRights</span>]::<span style="color: #800000;">Delete</span>, <span style="color: #800080;">$ACType</span>, <span style="color: #800080;">$Inheritance</span>)
<span style="color: #800080;">$Object</span>.psbase.ObjectSecurity.AddAccessRule(<span style="color: #800080;">$ACE</span>)
<span style="color: #800080;">$ACE</span> = <span style="color: #33cccc;">New-Object</span> <span style="color: #800000;">System.DirectoryServices.ActiveDirectoryAccessRule</span>(<span style="color: #800080;">$Trustee</span>, [<span style="color: #33cccc;">DirectoryServices.ActiveDirectoryRights</span>]::<span style="color: #800000;">DeleteChild</span>, <span style="color: #800080;">$ACType</span>, <span style="color: #800080;">$Inheritance</span>)
<span style="color: #800080;">$Object</span>.psbase.ObjectSecurity.AddAccessRule(<span style="color: #800080;">$ACE</span>)
<span style="color: #800080;">$ACE</span> = <span style="color: #33cccc;">New-Object</span> <span style="color: #800000;">System.DirectoryServices.ActiveDirectoryAccessRule</span>(<span style="color: #800080;">$Trustee</span>, [<span style="color: #33cccc;">DirectoryServices.ActiveDirectoryRights</span>]::<span style="color: #800000;">DeleteTree</span>,<span style="color: #800080;"> $ACType</span>, <span style="color: #800080;">$Inheritance</span>)
<span style="color: #800080;">$Object</span>.psbase.ObjectSecurity.AddAccessRule(<span style="color: #800080;">$ACE</span>)
<span style="color: #008000;"># Apply ACE</span>
<span style="color: #800080;">$Object</span>.psbase.CommitChanges()</pre>
</blockquote>
<p>Si la case à cocher est disponible dans le clicodrome uniquement, en utilisant un script adapté on peut imaginer protéger n&#8217;importe quel objet que l&#8217;on crée ou veux modifier. Par exemple des groupes de sécurité utilisés pour la délégation, ou bien des listes de distribution, ou encore des comptes de services.</p>
<p>Bref, cela permet d&#8217;éviter bien des sueurs à nos admins de domaine ^^</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iamthefrenchblog.com/2012/01/proteger-un-objet-des-suppressions-accidentelles-avec-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Authentification SSH sans mot de passe par échange de clefs RSA</title>
		<link>http://www.iamthefrenchblog.com/2012/01/authentification-ssh-sans-mot-de-passe-par-echange-de-clefs-rsa/</link>
		<comments>http://www.iamthefrenchblog.com/2012/01/authentification-ssh-sans-mot-de-passe-par-echange-de-clefs-rsa/#comments</comments>
		<pubDate>Mon, 02 Jan 2012 11:54:02 +0000</pubDate>
		<dc:creator>Fabrice</dc:creator>
				<category><![CDATA[Astuces]]></category>
		<category><![CDATA[Guides]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[RSA]]></category>
		<category><![CDATA[sécurité]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.iamthefrenchblog.com/?p=454</guid>
		<description><![CDATA[Lorsque l&#8217;on se connecte en SSH sur une machine Linux (ou Unix) pour effectuer des commandes à distance depuis un script ou pour effectuer des tâches administratives, il peut être très intéressant d&#8217;éviter d&#8217;utiliser une authentification par mot de passes, souvent simplistes. D&#8217;autant plus dans le cas de script, ou même lorsque l&#8217;on utilise des [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.iamthefrenchblog.com/wp-content/uploads/2012/01/ssh.jpg"><img class="alignleft size-full wp-image-455" style="margin: 20px;" title="ssh" src="http://www.iamthefrenchblog.com/wp-content/uploads/2012/01/ssh.jpg" alt="" width="184" height="184" /></a>Lorsque l&#8217;on se connecte en SSH sur une machine Linux (ou Unix) pour effectuer des commandes à distance depuis un script ou pour effectuer des tâches administratives, il peut être très intéressant d&#8217;éviter d&#8217;utiliser une authentification par mot de passes, souvent simplistes. D&#8217;autant plus dans le cas de script, ou même lorsque l&#8217;on utilise des mot de passes élaborés, il est souvent nécessaire de mettre le mot de passe dans le script, donc en clair, ce qui évidement rend inutile le fait d&#8217;utiliser des mot de passes élaborés.</p>
<p>L&#8217;utilisation de Kerberos ou de certificats peut palier l&#8217;utilisation de mot de passes et donc rendre l&#8217;authentification bien plus sécurisée. Une autre alternative et l&#8217;utilisation de clefs RSA pour l&#8217;authentification SSH. L&#8217;authentification RSA pour les connexions SSH se basent sur un échange de clefs et la signature de jetons d&#8217;authentification au moment de la connexion.</p>
<h3><span id="more-454"></span>Authentification RSA</h3>
<p>Le principe de l&#8217;authentification RSA se base sur la signature de jetons d&#8217;authentification lors de la connexion. Le client dispose d&#8217;une paire de clefs d&#8217;authentification : une clef privée qu&#8217;il est le seul à détenir et une clef publique que les serveurs utiliseront pour vérifier l&#8217;identité du client. Au moment de l&#8217;authentification, le client signe un jeton avec sa clef privée et le donne au serveur sur lequel il a besoin de s&#8217;authentifier. Le serveur doit avoir accès à la clef publique du client pour décrypter le jeton d&#8217;authentification. Comme lors de l&#8217;utilisation d&#8217;un algorithme de cryptage, seule la clef publique correspondant à la clef privée permet de décrypter le message : c&#8217;est le principe de signature numérique. Le serveur, avec la clef publique, peut donc vérifier la signature du jeton d&#8217;authentification, en ayant l&#8217;assurance que seul le client a pu générer la signature (le client est le seul à détenir la clef privée).</p>
<h3><a href="http://www.iamthefrenchblog.com/wp-content/uploads/2012/01/Authentification-par-clefs-RSA.png"><img class="aligncenter size-full wp-image-456" title="Authentification par clefs RSA" src="http://www.iamthefrenchblog.com/wp-content/uploads/2012/01/Authentification-par-clefs-RSA.png" alt="" /></a>Génération d&#8217;une paire de clefs sur Linux</h3>
<p>Sur la machine cliente on peut générer une paire de clefs RSA avec la commande suivante :</p>
<blockquote>
<pre>badrogh@demeter:~$ <strong>ssh-keygen -t rsa</strong>
Generating public/private rsa key pair.
Enter file in which to save the key (/home/badrogh/.ssh/id_rsa):
Created directory '/home/badrogh/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/badrogh/.ssh/id_rsa.
Your public key has been saved in /home/badrogh/.ssh/id_rsa.pub.
The key fingerprint is:
44:1b:94:be:04:4a:34:ca:ad:af:16:43:a2:28:b4:8c badrogh@demeter
The key's randomart image is:
+--[ RSA 2048]----+
|   .o  .+.       |
| . o.....o       |
|  o... oo        |
|.....  .o        |
|*oo    .S.       |
|Eoo.    .        |
|.  o.            |
|  ..             |
| ..              |
+-----------------+
badrogh@demeter:~$</pre>
</blockquote>
<p>Par défaut la clef privée est sauvegardée dans le fichier <strong>id_rsa</strong> dans un répertoire caché nommé<strong> .ssh</strong> de la homedir de l&#8217;utilisateur. La clef publique correspondante est sauvegardée dans le fichier <strong>id_rsa.pub</strong> dans le même répertoire. Lorsque l&#8217;on génère la clef privée, il est possible de protéger l&#8217;accès à cette clef par une phrase (appelée passphrase). Cela renforce la sécurité mais oblige à saisir cette phrase à chaque fois que l&#8217;on utilise la clef privée, ce qui perd tout intérêt quand l&#8217;authentification se fait dans un script.</p>
<h3>Ajout de la clef publique sur le serveur</h3>
<p>Pour permettre l&#8217;authentification par clef RSA sur le serveur, il est nécessaire d&#8217;ajouter la clef publique de l&#8217;utilisateur dans le fichier de clefs autorisées sur le serveur. Pour cela il faut connaitre le mot de passe de l&#8217;utilisateur sur le serveur et utiliser la commande suivante :</p>
<blockquote>
<pre>badrogh@demeter:~$ ssh-copy-id -i /home/badrogh/.ssh/id_rsa.pub badrogh@athena
Red Hat Enterprise Linux Server release 5.5 (Tikanga)
Kernel 2.6.18-194.el5 on an x86_64

Password:
Now try logging into the machine, with "ssh 'badrogh@athena'", and check in:

 .ssh/authorized_keys

to make sure we haven't added extra keys that you weren't expecting.

badrogh@demeter:~$
</pre>
</blockquote>
<p>Le service SSH doit également être configuré pour accepter l&#8217;authentification par clefs RSA. Le fichier de configuration du serveur SSH doit contenir les paramètres suivants :</p>
<blockquote>
<pre>RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile      .ssh/authorized_keys</pre>
</blockquote>
<p>Si vous avez besoin d&#8217;ajouter ces lignes de configuration ou de les dé-commenter, n&#8217;oubliez pas de redémarrer le service sshd !</p>
<p>A partir de là on peut s&#8217;authentifier sans mot de passe depuis les machines qui utilise la clef privée de l&#8217;utilisateur pour se connecter en SSH :</p>
<blockquote>
<pre>badrogh@demeter:~$ ssh athena
Red Hat Enterprise Linux Server release 5.5 (Tikanga)
Kernel 2.6.18-194.el5 on an x86_64

Last login: Mon Jan  2 11:41:33 2012 from demeter.olympe.demo
[badrogh@athena ~]$</pre>
</blockquote>
<h3>Utilisation de clefs RSA avec PuTTy</h3>
<p>Maintenant que nous avons généré une paire de clefs pour notre utilisateur et configuré le serveur, on peut utiliser cette méthode d&#8217;authentification même depuis une machine Windows avec le client SSH libre PuTTy.</p>
<p>Pour commencer il nous faut copier la clef privée générée pour notre utilisateur sur la machine Windows depuis laquelle on veux se connecter :</p>
<p><a href="http://www.iamthefrenchblog.com/wp-content/uploads/2012/01/ConfigPuTTy01.png"><img class="aligncenter size-full wp-image-457" title="ConfigPuTTy01" src="http://www.iamthefrenchblog.com/wp-content/uploads/2012/01/ConfigPuTTy01.png" alt="" /></a></p>
<p>Ensuite nous allons convertir cette clef dans un format utilisable par PuTTy avec l&#8217;outil <strong>puttygen.exe</strong>, disponible dans le répertoire d&#8217;installation. Notons que cet outil aurait pu être également utilisé pour générer une paire de clefs RSA, dans ce cas nous aurions dû sauvegarder la clef publique générée et ajouter cette clef dans le fichier <strong>autorized_keys</strong> du serveur. Ici nous allons convertir notre clef existante :</p>
<p><a href="http://www.iamthefrenchblog.com/wp-content/uploads/2012/01/ConfigPuTTy02.png"><img class="aligncenter size-full wp-image-458" title="ConfigPuTTy02" src="http://www.iamthefrenchblog.com/wp-content/uploads/2012/01/ConfigPuTTy02.png" alt="" /></a></p>
<p>On peut nommer la clef ainsi convertie et la sauvegarder au format ppk utilisé par PuTTy :</p>
<p><a href="http://www.iamthefrenchblog.com/wp-content/uploads/2012/01/ConfigPuTTy03.png"><img class="aligncenter size-full wp-image-459" title="ConfigPuTTy03" src="http://www.iamthefrenchblog.com/wp-content/uploads/2012/01/ConfigPuTTy03.png" alt="" /></a></p>
<p>Une fois la clef sauvegardée (bouton Save private key), on a maintenant une clef utilisable pour nos sessions SSH :</p>
<p><a href="http://www.iamthefrenchblog.com/wp-content/uploads/2012/01/ConfigPuTTy04.png"><img class="aligncenter size-full wp-image-460" title="ConfigPuTTy04" src="http://www.iamthefrenchblog.com/wp-content/uploads/2012/01/ConfigPuTTy04.png" alt="" /></a></p>
<h3>Configuration de la connexion SSH dans PuTTy</h3>
<p>Commençons par ouvrir PuTTy puis précisons le nom de login à utiliser pour la connexion SSH dans l&#8217;onglet <strong>Connection &gt; Data</strong> :</p>
<p><a href="http://www.iamthefrenchblog.com/wp-content/uploads/2012/01/ConfigPuTTy05.png"><img class="aligncenter size-full wp-image-461" title="ConfigPuTTy05" src="http://www.iamthefrenchblog.com/wp-content/uploads/2012/01/ConfigPuTTy05.png" alt="" /></a></p>
<p>Puis ajoutons la clef privée à utiliser pour la connexion SSH dans l&#8217;onglet <strong>Connection &gt; SSH &gt; Auth</strong> (bouton Browse de la section Authentication parameters) :</p>
<p><a href="http://www.iamthefrenchblog.com/wp-content/uploads/2012/01/ConfigPuTTy06.png"><img class="aligncenter size-full wp-image-462" title="ConfigPuTTy06" src="http://www.iamthefrenchblog.com/wp-content/uploads/2012/01/ConfigPuTTy06.png" alt="" /></a></p>
<p>Il nous reste à spécifier le nom du serveur où l&#8217;on veux se connecter (et où on a préalablement ajouter la clef publique dans le fichier de clefs autorisées), on peut même se sauvegarder la connexion pour la prochaine fois :</p>
<p><a href="http://www.iamthefrenchblog.com/wp-content/uploads/2012/01/ConfigPuTTy07.png"><img class="aligncenter size-full wp-image-463" title="ConfigPuTTy07" src="http://www.iamthefrenchblog.com/wp-content/uploads/2012/01/ConfigPuTTy07.png" alt="" /></a></p>
<p>A partir de là on peut se connecter en SSH avec PuTTy sans mot de passe :</p>
<p><a href="http://www.iamthefrenchblog.com/wp-content/uploads/2012/01/ConfigPuTTy08.png"><img class="aligncenter size-full wp-image-464" title="ConfigPuTTy08" src="http://www.iamthefrenchblog.com/wp-content/uploads/2012/01/ConfigPuTTy08.png" alt="" /></a></p>
<p>Et voilà <img src='http://www.iamthefrenchblog.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iamthefrenchblog.com/2012/01/authentification-ssh-sans-mot-de-passe-par-echange-de-clefs-rsa/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FIM Custom Activity – Guide de création (partie 3)</title>
		<link>http://www.iamthefrenchblog.com/2011/12/fim-custom-activity-%e2%80%93-guide-de-creation-partie-3/</link>
		<comments>http://www.iamthefrenchblog.com/2011/12/fim-custom-activity-%e2%80%93-guide-de-creation-partie-3/#comments</comments>
		<pubDate>Fri, 30 Dec 2011 13:31:07 +0000</pubDate>
		<dc:creator>Fabrice</dc:creator>
				<category><![CDATA[Forefront Identity Manager]]></category>
		<category><![CDATA[Guides]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Custom Activity]]></category>
		<category><![CDATA[FIM Service]]></category>
		<category><![CDATA[FIM2010]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.iamthefrenchblog.com/?p=428</guid>
		<description><![CDATA[Voici la suite de mon article sur la création d’une Custom Activity pour FIM 2010. Cette activité a été créé dans la FIMCustomActivityLibrary préparée dans la première partie de ce guide : FIM Custom Activity – Guide de création (partie 1) Un deuxième article montre comment ajouter des activités et écrire le code source de [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.iamthefrenchblog.com/wp-content/uploads/2011/04/visual-studio-2010-logo.png"><img class="alignleft size-full wp-image-271" style="margin: 20px;" title="visual-studio-2010-logo" src="http://www.iamthefrenchblog.com/wp-content/uploads/2011/04/visual-studio-2010-logo.png" alt="" width="233" height="178" /></a></p>
<p>Voici la suite de mon article sur la création d’une Custom Activity pour FIM 2010.</p>
<p>Cette activité a été créé dans la FIMCustomActivityLibrary préparée dans la première partie de ce guide : <a title="FIM Custom Activity – Guide de création (partie 1)" href="../2011/04/fim-custom-activity-guide-de-creation-partie-1/">FIM Custom Activity – Guide de création (partie 1)</a></p>
<p>Un deuxième article montre comment ajouter des activités et écrire le code source de ces activités : <a title="FIM Custom Activity – Guide de création (partie 2)" href="http://www.iamthefrenchblog.com/2011/11/fim-custom-activity-%e2%80%93-guide-de-creation-partie-2/">FIM Custom Activity – Guide de création (partie 2)</a></p>
<p>Dans cette troisième partie, je vais décrire comment créer l&#8217;interface homme machine (plus communément appelé GUI) de cette activité. Cette interface est un formulaire qui sera affiché dans le portail FIM et nous permettra d&#8217;ajouter des activités dans l&#8217;éditeur de Worklfow de FIM 2010.</p>
<p><span id="more-428"></span></p>
<h3>Création de la classe SettingsPart</h3>
<p>Pour commencer nous allons ajouter à notre projet Visual Studio une nouvelle classe nommée <strong>RequestLoggingActivitySettingsPart.cs</strong></p>
<p style="text-align: center;"><a href="http://www.iamthefrenchblog.com/wp-content/uploads/2011/12/CustomActivityHowTo28.png"><img class="aligncenter size-full wp-image-448" title="CustomActivityHowTo28" src="http://www.iamthefrenchblog.com/wp-content/uploads/2011/12/CustomActivityHowTo28.png" alt="" width="763" height="527" /></a></p>
<p>Le code source généré est le suivant :</p>
<blockquote>
<pre><span style="color: #0000ff;">using </span>System;
<span style="color: #0000ff;">using </span>System.Collections.Generic;
<span style="color: #0000ff;">using </span>System.Linq;
<span style="color: #0000ff;">using </span>System.Text;

<span style="color: #0000ff;">namespace </span>FIMCustomActivityLibrary.RequestLoggingActivity
{
<span style="color: #0000ff;">     class </span><span style="color: #33cccc;">RequestLoggingActivitySettingsPart</span>
     {
     }
}</pre>
</blockquote>
<p>Nous allons y ajouter les informations de références nécessaires, changer l&#8217;espace de nom pour accéder aux classes de l&#8217;interface utilisateur du portail FIM (classe WebUI) et également hériter la classe que l&#8217;on vient de créer de la classe <strong>ActivitySettingsPart </strong>:</p>
<blockquote>
<pre><span style="color: #0000ff;">using </span>System;
<span style="color: #0000ff;">using </span>System.Collections.Generic;
<span style="color: #0000ff;">using </span>System.Linq;
<span style="color: #0000ff;">using </span>System.Text;
<span style="color: #008000;">// Added references</span>
<span style="color: #0000ff;">using </span>System.Web.UI.WebControls;
<span style="color: #0000ff;">using </span>System.Workflow.ComponentModel;
<span style="color: #0000ff;">using </span>Microsoft.IdentityManagement.WebUI.Controls;
<span style="color: #0000ff;">using </span>Microsoft.ResourceManagement.Workflow.Activities;
<span style="color: #0000ff;">using </span>FIMCustomActivityLibrary.RequestLoggingActivity.RequestLoggingActivity;

<span style="color: #0000ff;">namespace </span>FIMCustomActivityLibrary.RequestLoggingActivity.WebUI
{
<span style="color: #0000ff;">     class </span><span style="color: #33cccc;">RequestLoggingActivitySettingsPart </span>: <span style="color: #33cccc;">ActivitySettingsPart</span>
     {
     }
}</pre>
</blockquote>
<p>Maintenant nous pouvons instancier les méthodes de la classe WebUI en effectuant un clic droit sur le mot clef ActivitySettingsPart et en choisissant <strong>Implémenter une classe abstraite</strong></p>
<p style="text-align: center;"><a href="http://www.iamthefrenchblog.com/wp-content/uploads/2011/12/CustomActivityHowTo29.png"><img class="aligncenter size-full wp-image-449" title="CustomActivityHowTo29" src="http://www.iamthefrenchblog.com/wp-content/uploads/2011/12/CustomActivityHowTo29.png" alt="" width="743" height="351" /></a></p>
<p><strong>Méthodes utiles<br />
</strong></p>
<p>Afin de générer des éléments dans l&#8217;interface WebUI, nous allons devoir écrire quelques méthodes permettant de dessiner un tableau, écrire du texte, lire du texte, etc. A chaque fois que nous aurons à écrire une nouvelle activité personnalisée, nous aurons besoin de ces méthodes. Dans cet exemple seule des méthodes permettant de dessiner des champs de texte simpe sont utilisées, mais on peut imaginer ici dessiner n&#8217;importe quel champs de saisie classique de type radio bouton, liste déroulante, etc.</p>
<p>Ajoutons donc une région à notre classe avec les méthodes utiles:</p>
<blockquote>
<pre><span style="color: #0000ff;">#region</span> Utility Functions
<span style="color: #008000;">// Create a TableRow that contains a label and a textbox.</span>
<span style="color: #0000ff;">private </span><span style="color: #33cccc;">TableRow </span>AddTableRowTextBox(<span style="color: #33cccc;">String </span>labelText, <span style="color: #33cccc;">String </span>controlID, <span style="color: #33cccc;">Int32 </span>width, <span style="color: #33cccc;">Int32 </span>maxLength, <span style="color: #33cccc;">Boolean </span>multiLine, <span style="color: #33cccc;">String </span>defaultValue)
{
     <span style="color: #33cccc;">TableRow </span>row = <span style="color: #0000ff;">new </span><span style="color: #33cccc;">TableRow</span>();
     <span style="color: #33cccc;">TableCell </span>labelCell = <span style="color: #0000ff;">new </span><span style="color: #33cccc;">TableCell</span>();
     <span style="color: #33cccc;">TableCell </span>controlCell = <span style="color: #0000ff;">new </span><span style="color: #33cccc;">TableCell</span>();
     Label oLabel = <span style="color: #0000ff;">new </span><span style="color: #33cccc;">Label</span>();
     <span style="color: #33cccc;">TextBox </span>oText = <span style="color: #0000ff;">new </span><span style="color: #33cccc;">TextBox</span>();

     oLabel.Text = labelText;
     oLabel.CssClass = <span style="color: #0000ff;">base</span>.LabelCssClass;
     labelCell.Controls.Add(oLabel);
     oText.ID = controlID;
     oText.CssClass = base.TextBoxCssClass;
     oText.Text = defaultValue;
     oText.MaxLength = maxLength;
     oText.Width = width;
     <span style="color: #0000ff;">if </span>(multiLine)
     {
          oText.TextMode = <span style="color: #33cccc;">TextBoxMode</span>.MultiLine;
          oText.Rows = System.<span style="color: #33cccc;">Math</span>.Min(6, (maxLength + 60) / 60);
          oText.Wrap = <span style="color: #0000ff;">true</span>;
     }
     controlCell.Controls.Add(oText);
     row.Cells.Add(labelCell);
     row.Cells.Add(controlCell);
     <span style="color: #0000ff;">return </span>row;
}

<span style="color: #0000ff;">string </span>GetText(<span style="color: #33cccc;">String </span>textBoxID)
{
     TextBox textBox = (<span style="color: #33cccc;">TextBox</span>)<span style="color: #0000ff;">this</span>.FindControl(textBoxID);
     <span style="color: #0000ff;">return </span>textBox.Text ?? <span style="color: #33cccc;">String</span>.Empty;
}

<span style="color: #0000ff;">void </span>SetText(<span style="color: #33cccc;">String </span>textBoxID, <span style="color: #33cccc;">String </span>text)
{
     <span style="color: #33cccc;">TextBox </span>textBox = (<span style="color: #33cccc;">TextBox</span>)<span style="color: #0000ff;">this</span>.FindControl(textBoxID);
     <span style="color: #0000ff;">if </span>(textBox != null)
          textBox.Text = text;
     <span style="color: #0000ff;">else</span>
          textBox.Text = <span style="color: #800000;">""</span>;
}

<span style="color: #008000;">// Set the text box to read mode or read/write mode</span>
<span style="color: #0000ff;">void </span>SetTextBoxReadOnlyOption(<span style="color: #33cccc;">String </span>textBoxID, <span style="color: #33cccc;">Boolean </span>readOnly)
{
     <span style="color: #33cccc;">TextBox </span>textBox = (<span style="color: #33cccc;">TextBox</span>)<span style="color: #0000ff;">this</span>.FindControl(textBoxID);
     textBox.ReadOnly = readOnly;
}
<span style="color: #0000ff;">#endregion</span></pre>
</blockquote>
<h3>Méthode CreateChildControls</h3>
<p>La méthode CreateChildControls va nous permettre de dessiner un tableau contenant les différents contrôle de formulaire de la WebUI de notre activité. On ajoute cette méthode à la liste des méthodes instanciées précédemment :</p>
<blockquote>
<pre><span style="color: #808080;">/// &lt;summary&gt;</span>
<span style="color: #808080;">///  </span><span style="color: #008000;">Creates a Table that contains the controls used by the activity UI</span>
<span style="color: #808080;">///  </span><span style="color: #008000;">in the Workflow Designer of the FIM portal. Adds that Table to the</span>
<span style="color: #808080;">///  </span><span style="color: #008000;">collection of Controls that defines each activity that can be selected</span>
<span style="color: #808080;">///  </span><span style="color: #008000;">in the Workflow Designer of the FIM Portal. Calls the base class of</span>
<span style="color: #808080;">///  </span><span style="color: #008000;">ActivitySettingsPart to render the controls in the UI.</span>
<span style="color: #808080;">/// &lt;/summary&gt;</span>
<span style="color: #0000ff;">protected override void </span>CreateChildControls()
{
     <span style="color: #33cccc;">Table </span>controlLayoutTable = <span style="color: #0000ff;">new </span><span style="color: #33cccc;">Table</span>();

     <span style="color: #008000;">// Width is set to 100% of the control size</span>
     controlLayoutTable.Width = <span style="color: #33cccc;">Unit</span>.Percentage(100.0);
     controlLayoutTable.BorderWidth = 0;
     controlLayoutTable.CellPadding = 2;
     <span style="color: #008000;">// Add a TableRow for each textbox in the UI</span>
     controlLayoutTable.Rows.Add(<span style="color: #0000ff;">this</span>.AddTableRowTextBox(<span style="color: #800000;">"Logging Activity Name:"</span>, <span style="color: #800000;">"txtLoggingActivityName"</span>, 400, 100, <span style="color: #0000ff;">false</span>, <span style="color: #800000;">"Enter the logging activity name (description title)."</span>));
     controlLayoutTable.Rows.Add(<span style="color: #0000ff;">this</span>.AddTableRowTextBox(<span style="color: #800000;">"Log File Path:"</span>, <span style="color: #800000;">"txtLogFilePath"</span>, 400, 100, <span style="color: #0000ff;">false</span>, <span style="color: #800000;">"Enter the log file Path."</span>));
     <span style="color: #0000ff;">this</span>.Controls.Add(controlLayoutTable);

     <span style="color: #0000ff;">base</span>.CreateChildControls();
}</pre>
</blockquote>
<h3>Méthode GenerateActivityOnWorkflow</h3>
<p>Cette méthode instancie l&#8217;objet de type <strong>RequestLoggingActivity </strong>et y associe les propriétés présentes dans les contrôles de la WebUI (c&#8217;est le constructeur de notre activité) :</p>
<blockquote>
<pre><span style="color: #888888;">/// &lt;summary&gt;
/// </span><span style="color: #008000;">Called when a user clicks the Save button in the Workflow Designer.</span>
<span style="color: #888888;">/// </span><span style="color: #008000;">Returns an instance of the RequestLoggingActivity class that</span>
<span style="color: #888888;">/// </span><span style="color: #008000;">has its properties set to the values entered into the text box controls</span>
<span style="color: #888888;">/// </span><span style="color: #008000;">used in the UI of the activity.</span>
<span style="color: #888888;">/// &lt;/summary&gt;</span>
<span style="color: #0000ff;">public override </span><span style="color: #33cccc;">Activity </span>GenerateActivityOnWorkflow(<span style="color: #33cccc;">SequentialWorkflow </span>workflow)
{
     <span style="color: #0000ff;">if </span>(!<span style="color: #0000ff;">this</span>.ValidateInputs())
     {
          <span style="color: #0000ff;">return null</span>;
     }
     <span style="color: #33cccc;">RequestLoggingActivity </span>LoggingActivity = <span style="color: #0000ff;">new </span><span style="color: #33cccc;">RequestLoggingActivity</span>();
     LoggingActivity.LoggingActivityName = <span style="color: #0000ff;">this</span>.GetText(<span style="color: #800000;">"txtLoggingActivityName"</span>);
     LoggingActivity.LogFilePath = <span style="color: #0000ff;">this</span>.GetText(<span style="color: #800000;">"txtLogFilePath"</span>);
     <span style="color: #0000ff;">return </span>LoggingActivity;
}</pre>
</blockquote>
<h3>Méthode LoadActivitySettings</h3>
<p>Cette méthode est appelée par FIM à chaque fois que l&#8217;activité est rechargée. Elle permet de lire les propriétés de l&#8217;activité actuellement instanciée par le Workflow :</p>
<blockquote>
<pre><span style="color: #888888;">/// &lt;summary&gt;
/// </span><span style="color: #008000;">Called by FIM when the UI for the activity must be reloaded.</span>
<span style="color: #888888;">/// </span><span style="color: #008000;">It passes us an instance of our workflow activity so that we can</span>
<span style="color: #888888;">/// </span><span style="color: #008000;">extract the values of the properties to display in the UI.</span>
<span style="color: #888888;">/// &lt;/summary&gt;</span>
<span style="color: #0000ff;">public override void </span>LoadActivitySettings(<span style="color: #33cccc;">Activity </span>activity)
{
     <span style="color: #33cccc;">RequestLoggingActivity </span>LoggingActivity = activity <span style="color: #0000ff;">as </span><span style="color: #33cccc;">RequestLoggingActivity</span>;
     <span style="color: #0000ff;">if </span>(<span style="color: #0000ff;">null </span>!= LoggingActivity)
     {
          <span style="color: #0000ff;">this</span>.SetText(<span style="color: #800000;">"txtLoggingActivityName"</span>, LoggingActivity.LoggingActivityName);
          <span style="color: #0000ff;">this</span>.SetText(<span style="color: #800000;">"txtLogFilePath"</span>, LoggingActivity.LogFilePath);
     }
}</pre>
</blockquote>
<h3>Méthode PersistSettings</h3>
<p>Cette méthode permet d’enregistrer les valeurs saisies dans les contrôles vers les propriétés de l&#8217;activité. Cette méthode est appelée lors de l&#8217;appuie du bouton de validation d&#8217;une activité dans l&#8217;interface WebUI de FIM.</p>
<blockquote>
<pre><span style="color: #888888;">/// &lt;summary&gt;
/// </span><span style="color: #008000;">Saves the activity settings.</span>
<span style="color: #888888;">/// &lt;/summary&gt;</span>
<span style="color: #0000ff;">public override </span><span style="color: #33cccc;">ActivitySettingsPartData </span>PersistSettings()
{
     <span style="color: #33cccc;">ActivitySettingsPartData </span>data = <span style="color: #0000ff;">new </span><span style="color: #33cccc;">ActivitySettingsPartData</span>();
     data[<span style="color: #800000;">"LoggingActivityName"</span>] = <span style="color: #0000ff;">this</span>.GetText(<span style="color: #800000;">"txtLoggingActivityName"</span>);
     data[<span style="color: #800000;">"LogFilePath"</span>] = <span style="color: #0000ff;">this</span>.GetText("txtLogFilePath");
     <span style="color: #0000ff;">return </span>data;
}</pre>
</blockquote>
<h3>Méthode RestoreSettings</h3>
<p>Cette méthode permet de lire les propriétés de l&#8217;activité et de les afficher dans la WebUI de FIM. C&#8217;est cette méthode qui est appelée lorsque l&#8217;on édite une activité existante.</p>
<blockquote>
<pre><span style="color: #888888;">/// &lt;summary&gt;
///  </span><span style="color: #008000;">Restores the activity settings in the UI</span>
<span style="color: #888888;">/// &lt;/summary&gt;</span>
<span style="color: #0000ff;">public override void </span>RestoreSettings(<span style="color: #33cccc;">ActivitySettingsPartData </span>data)
{
     <span style="color: #0000ff;">if </span>(<span style="color: #0000ff;">null </span>!= data)
     {
          <span style="color: #0000ff;">this</span>.SetText(<span style="color: #800000;">"txtLoggingActivityName"</span>, (<span style="color: #33cccc;">String</span>)data[<span style="color: #800000;">"LoggingActivityName"</span>]);
          <span style="color: #0000ff;">this</span>.SetText(<span style="color: #800000;">"txtLogFilePath"</span>, (<span style="color: #33cccc;">String</span>)data[<span style="color: #800000;">"LogFilePath"</span>]);
     }
}</pre>
</blockquote>
<p><strong>Méthode SwitchMode</strong></p>
<p>Cette méthode permet de passer les contrôles de la WebUI de lecture seule à lecture/écriture. Lorsque l&#8217;on affiche une activité existante, cette méthode est appelé quand le bouton <strong>Edit </strong>est pressé.</p>
<blockquote>
<pre><span style="color: #888888;">/// &lt;summary&gt;
///  </span><span style="color: #008000;">Switches the activity between read only and read/write mode</span>
<span style="color: #888888;">/// &lt;/summary&gt;</span>
<span style="color: #0000ff;">public override void </span>SwitchMode(<span style="color: #33cccc;">ActivitySettingsPartMode </span>mode)
{
     <span style="color: #33cccc;">Boolean </span>readOnly = (mode == <span style="color: #33cccc;">ActivitySettingsPartMode</span>.View);
     <span style="color: #0000ff;">this</span>.SetTextBoxReadOnlyOption(<span style="color: #800000;">"txtLoggingActivityName"</span>, readOnly);
     <span style="color: #0000ff;">this</span>.SetTextBoxReadOnlyOption(<span style="color: #800000;">"txtLogFilePath"</span>, readOnly);
}</pre>
</blockquote>
<h3>Méthode Title</h3>
<p>Cette méthode permet d&#8217;afficher le titre (ou description) de l&#8217;activité. Très utile lorsque l&#8217;on créé des activités génériques manipulant des attributs différents. Par exemple si l&#8217;on créé plusieurs activités de log de requête : une à chaque création d&#8217;utilisateur, une autre à la suppression d&#8217;un utilisateur et enfin une à chaque modification de groupe, permettre de nommer différemment ces activités lorsqu&#8217;on les créé dans le portail devient indispensable !</p>
<blockquote>
<pre><span style="color: #888888;">/// &lt;summary&gt;
///  </span><span style="color: #008000;">Returns the activity name.</span>
<span style="color: #888888;">/// &lt;/summary&gt;</span>
<span style="color: #0000ff;">public override </span><span style="color: #33cccc;">String </span>Title
{
     <span style="color: #0000ff;">get</span>
     {
          <span style="color: #0000ff;">if </span>(<span style="color: #33cccc;">String</span>.IsNullOrEmpty(<span style="color: #0000ff;">this</span>.GetText(<span style="color: #800000;">"txtLoggingActivityName"</span>)))
               <span style="color: #0000ff;">return </span><span style="color: #800000;">"Request Logging Activity"</span>;
          <span style="color: #0000ff;">else
               return </span><span style="color: #800000;">"Request Logging Activity: "</span> + <span style="color: #0000ff;">this</span>.GetText(<span style="color: #800000;">"txtLoggingActivityName"</span>);
     }
}</pre>
</blockquote>
<h3>Méthode ValidateInputs</h3>
<p>Cette méthode permet de vérifier la validité des valeurs saisies au moment de l&#8217;enregistrement de l&#8217;activité. Cette méthode doit retourner <strong>Vrai </strong>si les valeurs sont valides et <strong>Faux </strong>dans le cas contraire.</p>
<blockquote>
<pre><span style="color: #888888;">/// &lt;summary&gt;
///  </span><span style="color: #008000;">This method should be used to validate information entered</span>
<span style="color: #888888;">///  </span><span style="color: #008000;">by the user when the activity is added to a workflow in the Workflow</span>
<span style="color: #888888;">///  </span><span style="color: #008000;">Designer.</span>
<span style="color: #888888;">///  </span><span style="color: #008000;">We could add code to verify that the log file path already exists on</span>
<span style="color: #888888;">///  </span><span style="color: #008000;">the server that is hosting the FIM Portal and check that the activity</span>
<span style="color: #888888;">///  </span><span style="color: #008000;">has permission to write to that location. However, the code</span>
<span style="color: #888888;">///  </span><span style="color: #008000;">would only check if the log file path exists when the</span>
<span style="color: #888888;">///  </span><span style="color: #008000;">activity is added to a workflow in the workflow designer.</span>
<span style="color: #888888;">///  </span><span style="color: #008000;">If you don't want to implement this class, just return true.</span>
<span style="color: #888888;">/// &lt;/summary&gt;</span>
<span style="color: #0000ff;">public override </span><span style="color: #33cccc;">Boolean </span>ValidateInputs()
{
     <span style="color: #33cccc;">Boolean </span>InputsValid = <span style="color: #0000ff;">false</span>;
     <span style="color: #008000;">// Test Log file path</span>
     <span style="color: #33cccc;">String </span>Path = <span style="color: #0000ff;">this</span>.GetText(<span style="color: #800000;">"txtLogFilePath"</span>);
     <span style="color: #0000ff;">if </span>(System.IO.<span style="color: #33cccc;">Directory</span>.Exists(Path))
     {
          InputsValid = <span style="color: #0000ff;">true</span>;
     }
     <span style="color: #0000ff;">return </span>InputsValid;
}</pre>
</blockquote>
<h3>Compilation et ajout dans le portail FIM</h3>
<p>Notre librairie est maintenant prête à être compilée. Il ne nous restera plus qu&#8217;à ajouter cette librairie d&#8217;activités au portail FIM.</p>
<p>Je décrirai cette étape dans un quatrième article consacré aux Custom Activities FIM 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iamthefrenchblog.com/2011/12/fim-custom-activity-%e2%80%93-guide-de-creation-partie-3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Guide des bonnes pratiques des Stratégies de Groupes ou les GPO chez MS</title>
		<link>http://www.iamthefrenchblog.com/2011/12/guide-des-bonnes-pratiques-des-strategies-de-groupes-ou-les-gpo-chez-ms/</link>
		<comments>http://www.iamthefrenchblog.com/2011/12/guide-des-bonnes-pratiques-des-strategies-de-groupes-ou-les-gpo-chez-ms/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 10:31:16 +0000</pubDate>
		<dc:creator>Fabrice</dc:creator>
				<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Guides]]></category>
		<category><![CDATA[GPO]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.iamthefrenchblog.com/?p=422</guid>
		<description><![CDATA[Après le guide sur la fédération d&#8217;identité voici le tour des Stratégies de Groupes. Microsoft utilise évidement un grand nombre de GPO en interne pour des besoins diverses et variés, mais comment gérer efficacement des GPO pour un société internationale de cette taille ? Par exemple en suivant un ensemble de bonnes pratiques (et également [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.iamthefrenchblog.com/wp-content/uploads/2011/10/microsoftGPO1.png"><img class="alignleft size-full wp-image-328" style="margin: 20px;" title="microsoftGPO" src="http://www.iamthefrenchblog.com/wp-content/uploads/2011/10/microsoftGPO1.png" alt="" width="300" height="75" /></a>Après le guide sur la fédération d&#8217;identité voici le tour des Stratégies de Groupes. Microsoft utilise évidement un grand nombre de GPO en interne pour des besoins diverses et variés, mais comment gérer efficacement des GPO pour un société internationale de cette taille ?</p>
<p>Par exemple en suivant un ensemble de bonnes pratiques (et également avec une bonne dose de rigueur ^^).</p>
<p>Si vous aussi vous cherchez à instaurer des bonnes pratiques pour la mise en place de vos GPO, et quelques soit vos besoins, voici un livre blanc fourni par un ami décrivant les bonnes pratiques en place chez MS pour leur gestion des GPO.</p>
<p>Télécharger le pdf ici : <a href="http://www.iamthefrenchblog.com/wp-content/uploads/2011/12/GPO_Best-Practices_How-MSdoit.pdf">GPO_Best Practices_How MSdoit</a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.iamthefrenchblog.com/2011/12/guide-des-bonnes-pratiques-des-strategies-de-groupes-ou-les-gpo-chez-ms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Guide sur la fédération d&#8217;identité et le contrôle d&#8217;accès</title>
		<link>http://www.iamthefrenchblog.com/2011/12/guide-sur-la-federation-didentite-et-le-controle-dacces/</link>
		<comments>http://www.iamthefrenchblog.com/2011/12/guide-sur-la-federation-didentite-et-le-controle-dacces/#comments</comments>
		<pubDate>Mon, 12 Dec 2011 08:10:48 +0000</pubDate>
		<dc:creator>Fabrice</dc:creator>
				<category><![CDATA[Active Directory Federation Service]]></category>
		<category><![CDATA[Actualités]]></category>
		<category><![CDATA[Guides]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[ADFS]]></category>
		<category><![CDATA[Federation Service]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.iamthefrenchblog.com/?p=420</guid>
		<description><![CDATA[Si vous vous intéressez de près ou de loin à la fédération d&#8217;identité avec ADFS, sachez que la version 2.0 du guide “A Guide to Claims-Based Identity and Access Control” écrit par l&#8217;équipe Microsoft Patterns and Practices est disponible en téléchargement sur le site de MS: A Guide to Claims-Based Identity and Access Control Merci [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.iamthefrenchblog.com/wp-content/uploads/2011/11/microsoft.jpg"><img class="alignleft size-full wp-image-404" style="margin: 20px;" title="microsoft" src="http://www.iamthefrenchblog.com/wp-content/uploads/2011/11/microsoft.jpg" alt="" width="150" height="150" /></a></p>
<p>Si vous vous intéressez de près ou de loin à la fédération d&#8217;identité avec ADFS, sachez que la version 2.0 du guide “A Guide to Claims-Based Identity and  Access Control” écrit par l&#8217;équipe Microsoft Patterns and Practices est disponible en téléchargement sur le site de MS:</p>
<p><a title="A Guide to Claims-Based Identity and Access Control" href="http://www.microsoft.com/download/en/confirmation.aspx?id=28362" target="_blank"><strong><span style="font-size: medium;">A Guide to Claims-Based Identity and Access Control</span></strong></a></p>
<p>Merci à Henrik Nilsson pour l&#8217;info <img src='http://www.iamthefrenchblog.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.iamthefrenchblog.com/2011/12/guide-sur-la-federation-didentite-et-le-controle-dacces/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

