<?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>Yoann Gini</title>
	<atom:link href="http://blog.inig-services.com/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.inig-services.com</link>
	<description></description>
	<lastBuildDate>Tue, 24 Apr 2012 16:28:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Faites vos Wireless Site Survey sous OS X !</title>
		<link>http://blog.inig-services.com/archives/1086</link>
		<comments>http://blog.inig-services.com/archives/1086#comments</comments>
		<pubDate>Tue, 24 Apr 2012 16:26:44 +0000</pubDate>
		<dc:creator>Yoann Gini</dc:creator>
				<category><![CDATA[Apple]]></category>

		<guid isPermaLink="false">http://blog.inig-services.com/?p=1086</guid>
		<description><![CDATA[En plein projet d&#8217;optimisation WiFi pour un client, j&#8217;étais à la recherche d&#8217;un outil de simulation de couverture pas trop chère et tournant sous OS X ou Linux / BSD. Les seuls que je connaisse étant cher et pour Windows, &#8230; <a href="http://blog.inig-services.com/archives/1086">Lire la suite <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>En plein projet d&#8217;optimisation WiFi pour un client, j&#8217;étais à la recherche d&#8217;un outil de simulation de couverture pas trop chère et tournant sous OS X ou Linux / BSD. Les seuls que je connaisse étant cher et pour Windows, j&#8217;ai lancé un petit SOS sur Twitter qui fut reçu par <a href="http://www.babgond.com/" target="_blank">Béryl Gondouin</a> (<a href="https://twitter.com/#!/babgond" target="_blank">@babgond</a>), un administrateur réseau à qui je dois la petite découverte du jour, <a href="http://www.netspotapp.com/">NetSpot</a>, un outil de Wireless Site Survey gratuit et pour Mac OS X !</p>
<p>L&#8217;outil reste très simple, mais il comporte l&#8217;essentiel, vous entrez un plan de votre bâtiment, vous vous déplacez avec votre MacBook et sa carte WiFi native et l&#8217;application vous sortira un état des lieux de vos zones de couvertures. Pratique !</p>
<p><a href="http://blog.inig-services.com/files/2012/04/netspot-snr.jpg" rel="lightbox[1086]"><img class="aligncenter size-medium wp-image-1087" title="netspot-snr" src="http://blog.inig-services.com/files/2012/04/netspot-snr-300x177.jpg" alt="" width="300" height="177" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.inig-services.com/archives/1086/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>DropBox un fléau pour l&#8217;entreprise…</title>
		<link>http://blog.inig-services.com/archives/1080</link>
		<comments>http://blog.inig-services.com/archives/1080#comments</comments>
		<pubDate>Mon, 23 Apr 2012 11:20:50 +0000</pubDate>
		<dc:creator>Yoann Gini</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Général]]></category>
		<category><![CDATA[Serveur]]></category>
		<category><![CDATA[Système]]></category>

		<guid isPermaLink="false">http://blog.inig-services.com/?p=1080</guid>
		<description><![CDATA[En disant sur mon compte Twitter que DropBox est un vrai fléau pour l&#8217;entreprise, j&#8217;ai l&#8217;impression d&#8217;avoir déclenché une petite révolte de la part de quelques fans… Puisque le sujet à l&#8217;air d&#8217;intéresser, je me permets un billet  sur ce &#8230; <a href="http://blog.inig-services.com/archives/1080">Lire la suite <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>En disant sur mon compte Twitter que DropBox est un vrai fléau pour l&#8217;entreprise, j&#8217;ai l&#8217;impression d&#8217;avoir déclenché une petite révolte de la part de quelques fans… Puisque le sujet à l&#8217;air d&#8217;intéresser, je me permets un billet  sur ce sujet qui sera un peu moins technique que d’habitude, et vu qu&#8217;on est sur un blog, vous êtes libre de commenter tant que ça ne se transforme pas en foire d&#8217;empoigne…</p>
<p><span id="more-1080"></span> <strong>À quoi sert DropBox ?</strong></p>
<p>C&#8217;est la première question qu&#8217;il faut se poser pour comprendre ma position. DropBox est un service fait pour des personnes qui souhaitent échanger des données entre elles de manière simple. Un agent s&#8217;installe sur votre machine et envoie chaque modification de fichier sur un serveur appartenant à l&#8217;entreprise éditrice du logiciel et dont la localisation n&#8217;est pas connue. Une fois votre fichier arrivé sur le serveur de DropBox il est envoyé à toutes les machines abonnées à votre dossier. Sur ces machines l&#8217;agent local va copier la ressource et la synchronisation est ainsi effectuée.</p>
<p><strong>Quels sont les mécanismes clefs ?</strong></p>
<p>Les parties importantes à repérer sont sur le fonctionnement de l&#8217;agent de synchronisation qui va observer toute modification du système de fichier à partir de son dossier racine. Tout changement dans le dossier DropBox donne lieu à un évènement qui, si le fichier est modifié, déclenche une synchronisation du dit fichier. Lorsqu&#8217;un fichier est reçu, c&#8217;est ce même agent qui va aller l&#8217;écrire sur le système.</p>
<p>Cela veut dire une chose, tous les fichiers doivent être accessibles en contrôle complet à l&#8217;utilisateur DropBox puisqu&#8217;il devra être capable de lire, modifier, ajouter et supprimer des fichiers. De plus, lorsqu&#8217;un fichier sera édité par DropBox, le propriétaire POSIX sera l&#8217;utilisateur qui a lancé l&#8217;agent et non l&#8217;utilisateur d&#8217;origine puisque DropBox est conçu pour le particulier qui ne dispose pas d&#8217;une base d&#8217;utilisateur homogène sur chaque machine.</p>
<p>D&#8217;autre part, DropBox n&#8217;a pas de capacité de fonctionnement de type service à ma connaissance, il faut donc qu&#8217;une session soit ouverte pour que l&#8217;agent soit lancé et que la synchronisation puisse se faire.</p>
<p><strong>Quelles sont les implications en entreprise ?</strong></p>
<p>Tout cela veux dire plusieurs choses pour une entreprise :</p>
<ul>
<li>votre serveur devra disposer d&#8217;une session ouverte au lancement de l&#8217;ordinateur, même si cette session n&#8217;est pas administrateur, elle aura un accès complet au système de fichier et la capacité de lancer toute application, ce qui augmente la zone d&#8217;attaque potentielle pour un pirate ;</li>
<li>vos quotas ne seront plus appliqués du fait du changement d&#8217;utilisateur POSIX ;</li>
<li>à chaque modification de fichier sur le serveur, une synchronisation sera déclenchée, ce qui peut provoquer une surcharge du serveur et de la connexion si les fichiers sont lourds et que l&#8217;employé comporte beaucoup d&#8217;employés actifs.</li>
</ul>
<p><strong>Pourquoi est-ce un fléau ?</strong></p>
<p>Les utilisateurs ne sont pas réputés pour comprendre qu&#8217;il y a une différence entre un service de classe entreprise et un service pour particulier (ou professionnel indépendant). À force de patience, les gens commencent à intégrer qu&#8217;il y a une différence qui justifie le cout entre une ADSL 20 Mo à 30 € par mois et une SDSL à 300… Voici qu&#8217;il faut recommencer la chose avec la synchronisation de fichier, à une différence près : il n&#8217;y a pas de possibilité de payer plus cher pour avoir le niveau de service entreprise de DropBox…</p>
<p>Expliquer tout cela est de la responsabilité des consultants, et nous y somme habitué, pour autant DropBox pose un vrai problème, car aucune solution de niveau entreprise n&#8217;existe.</p>
<p><strong>Pourquoi la synchronisation en entreprise est-elle problématique ?</strong></p>
<p>La demande habituelle concernant la synchronisation en entreprise consiste à vouloir rendre accessible un point de partage contenant les données de l&#8217;entreprise à tous les sites, sans délai d&#8217;écriture, avec support d&#8217;écriture sur chaque site, respect des droits d&#8217;accès et éventuellement la capacité d&#8217;éditer le même fichier à plusieurs.</p>
<p>Pour que cela puisse être réalisable, il faut un système de synchronisation qui soit capable de :</p>
<ul>
<li>synchroniser rapidement (donc un gros débit symétrique sur Internet de tout coté) ;</li>
<li>répliquer les droits d&#8217;accès (rsync le fait) ;</li>
<li>résoudre automatiquement les conflits de synchronisation (ce qui peut provoquer de sacré problème lorsque l&#8217;algo rencontre un cas non géré, et à charge aux utilisateurs de gérer les doublons automatiques) ;</li>
<li>gérer les lock du système de fichier pour éviter les problèmes d&#8217;édition multiple, ce qui demande une gestion très pointue des deadlock (lorsqu&#8217;une synchro se fait mal et que deux lock tombent en même temps ou qu&#8217;un lock n&#8217;est pas levée par une application qui plante, genre Excel).</li>
</ul>
<p>Autant le dire, je ne connais pas de logiciels permettant de faire cela avec des serveurs indépendants. Guillaume Gete vient de me proposer <a href="http://www.filereplicationpro.com/">File Replication Pro</a> sur Twitter, mais je ne l&#8217;ai pas encore testé. Pour ma part, la seule solution de partage d&#8217;un espace de stockage commun par plusieurs serveurs que je trouve fiable est à base de SAN (qu&#8217;on soit sur du Xsan ou quoi que ce soit d&#8217;autre). Mais cela demande un investissement conséquent en matériel et un cout de l&#8217;abonnement WAN assez élevé puisque les liaisons privées intersite devront être capables de supporter des technos comme le FCoE…</p>
<p>En résumé, le cas DropBox n&#8217;est pas un argument de synchronisation qui fonctionne. C&#8217;est une synchronisation dépouillée de tous ses aspects clefs pour satisfaire le particulier, mais cela met en porte à faux les équipes IT face à des utilisateurs qui ne comprenne pas l&#8217;archaïsme du réseau de l&#8217;entreprise et des décideurs qui refuse des investissements à 5 ou 6 chiffres pour du confort d&#8217;usage…</p>
<p>Voilà donc pour mon point de vue sur la synchronisation en entreprise et pourquoi DropBox est un fléau (si encore ils disaient clairement qu&#8217;ils ne fournissent pas aux entreprises…).</p>
<p>Comme dit en introduction, n&#8217;hésitez pas à commenter ce billet pour avec vos retours d&#8217;expériences et avis sur la question. Nul ne connais toutes les solutions à un problème et qui sait, en composant les solutions de chacun nous aurons peut être une bonne surprise !</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.inig-services.com/archives/1080/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Utiliser des cartes à puce pour s&#8217;authentifier sur OS X Lion avec un OpenDirectory</title>
		<link>http://blog.inig-services.com/archives/1068</link>
		<comments>http://blog.inig-services.com/archives/1068#comments</comments>
		<pubDate>Thu, 12 Apr 2012 12:12:11 +0000</pubDate>
		<dc:creator>Yoann Gini</dc:creator>
				<category><![CDATA[Apple]]></category>

		<guid isPermaLink="false">http://blog.inig-services.com/?p=1068</guid>
		<description><![CDATA[Lorsqu&#8217;il est question de sécuriser l&#8217;accès à un poste de travail, une méthode communément admise dans beaucoup d&#8217;entreprises est l&#8217;utilisation de carte à puce. L&#8217;utilisateur au lieu de rentrer un identifiant et un mot de passe devra fournir une carte &#8230; <a href="http://blog.inig-services.com/archives/1068">Lire la suite <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Lorsqu&#8217;il est question de sécuriser l&#8217;accès à un poste de travail, une méthode communément admise dans beaucoup d&#8217;entreprises est l&#8217;utilisation de carte à puce. L&#8217;utilisateur au lieu de rentrer un identifiant et un mot de passe devra fournir une carte ainsi que son code PIN pour s&#8217;authentifier.</p>
<p><span id="more-1068"></span>S&#8217;il existe quelques documentations sur le sujet, OS X Lion change quelque peu la donne… Le système n&#8217;est plus livré d&#8217;origine avec l&#8217;applicatif permettant de traiter avec les cartes à puce, nous allons donc devoir installer quelques outils pour rendre notre configuration fonctionnelle. D&#8217;autre part, l&#8217;intégration dans OS X Lion a connu quelques problèmes, aussi vous n&#8217;obtiendrez une configuration fonctionnelle que depuis 10.7.3.</p>
<p>Lorsque Apple a décidé de ne plus livrer le support des cartes à puce avec OS X Lion, le code source existant a été libéré et est devenu le projet <a href="http://smartcardservices.macosforge.org/" target="_blank">SmartCardService de Mac OS Forge</a>. C&#8217;est donc par là que nous allons commencer, il vous faut télécharger et installer la dernière version du package (à cette heure la <a href="http://static.macosforge.org/smartcardservices/downloads/installers/SmartCardServices_2.0.b1_(Lion).zip" target="_blank">bêta 2.0b1</a>).</p>
<p>Une fois ce package installé, notre OS X Lion est capable de traiter avec les cartes à puce pour peu qu&#8217;il soit capable de dialoguer avec le lecteur de carte dont vous disposez. Pour ma part, j&#8217;utilise des <a href="http://www.gooze.eu/catalog/smart-card-readers" target="_blank">Feitian 301 et 310 fournis par notre ami Gooze</a>. Ces lecteurs sont fait pour fonctionner avec un set de pilote libre réunie sur le projet <a href="http://www.opensc-project.org/opensc" target="_blank">OpenSC</a>. Encore une fois, les pilotes fournis sont actuellement en bêta (OS X Lion est tout jeune encore), il vous faudra donc télécharger une des dernières <a href="http://www.opensc-project.org/downloads/nightly/staging/macosx-10.6/" target="_blank">night build</a> de la version 0.12.3 pour 10.6. Pour ma part j&#8217;ai installé la build 89, avant de télécharger cette version, vérifier qu&#8217;il n&#8217;y ait pas de nouveauté sur la page d&#8217;<a href="http://www.opensc-project.org/opensc/wiki/MacInstaller" target="_blank">accueil du projet</a>.</p>
<p>Ces deux packages étant installé, vous êtes prêt à travailler avec vos cartes à puce, la première étape consiste à installer sur ces cartes des certificats x509 et les clefs privées qui iront avec. Pour ce faire, je vais utiliser un certificat fourni par InstantSSL, j&#8217;ai essayé de configurer la même chose avec <a href="http://blog.inig-services.com/archives/1061" target="_blank">certificat généré précédemment avec l&#8217;autorité de certification du Mac</a> sans succès et sans comprendre d&#8217;où proviens l&#8217;échec. Vous pouvez théoriquement utiliser un certificat fourni par n&#8217;importe quelle autorité de certification, l&#8217;important est que vous en disposiez au format p12 et qu&#8217;il contienne votre clef publique et privée, votre Mac doit également contenir dans le trousseau système les clefs publiques de chaque autorité signataire intermédiaire jusqu&#8217;à la racine.</p>
<p>Votre certificat à disposition, nous allons brancher le lecteur avec une carte dedans puis effectuer quelques tests pour vérifier le bon fonctionnement du tout. Une première chose que l&#8217;on peut faire est de demander au lecteur l&#8217;empreinte de la carte disponible via une réinitialisation de la communication :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ opensc-tool <span style="color: #660033;">--atr</span>
Using reader with a card: Feitian SCR301 00 00
3b:9f:<span style="color: #000000;">95</span>:<span style="color: #000000;">81</span>:<span style="color: #000000;">31</span>:fe:9f:00:<span style="color: #000000;">65</span>:<span style="color: #000000;">46</span>:<span style="color: #000000;">53</span>:05:<span style="color: #000000;">30</span>:06:<span style="color: #000000;">71</span>:df:00:00:00:<span style="color: #000000;">80</span>:6a:<span style="color: #000000;">82</span>:5e</pre></div></div>

<p><em>Cette commande est propre aux outils OpenSC, si vous utilisez un lecteur d&#8217;une autre provenance, sautez cette étape ou reportez-vous à la documentation fournie.</em></p>
<p>Si vous avez ce genre de résultat, c&#8217;est que vous êtes en bonne voie ! Passons donc aux choses sérieuses. Pour pouvoir nous servir d&#8217;une carte à puce et y inscrire des certificats, il faut d&#8217;abord s&#8217;assurer qu&#8217;elle soit vierge et formatée.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ pkcs15-init <span style="color: #660033;">-E</span>
$ pkcs15-init <span style="color: #660033;">--create-pkcs15</span> <span style="color: #660033;">--profile</span> pkcs15+onepin <span style="color: #660033;">--use-default-transport-key</span> <span style="color: #660033;">--label</span> <span style="color: #ff0000;">&quot;Yoann Gini&quot;</span> <span style="color: #660033;">--pin</span> <span style="color: #000000;">1234</span> <span style="color: #660033;">--puk</span> <span style="color: #000000;">11111111</span>
Using reader with a card: Feitian SCR301 00 00</pre></div></div>

<p>La première commande va effacer le contenue de la carte et la seconde va la formater de manière à contenir des certificats, la carte sera au nom de Yoann Gini et utilisera le code PIN 1234 pour l&#8217;authentification et le code PUK 11111111 pour la récupération.</p>
<p>Cette opération terminer, nous pouvons interroger la carte pour obtenir les informations à son sujet :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ pkcs15-tool <span style="color: #660033;">--dump</span>
Using reader with a card: Feitian SCR301 00 00
<span style="color: #666666;">PKCS#</span><span style="color: #000000;">15</span> Card <span style="color: #7a0874; font-weight: bold;">&#91;</span>Yoann Gini<span style="color: #7a0874; font-weight: bold;">&#93;</span>:
	Version        : <span style="color: #000000;">0</span>
	Serial number  : <span style="color: #000000;">1509152617290911</span>
	Manufacturer ID: EnterSafe
	Last update    : 20120412064836Z
	Flags          : EID compliant
&nbsp;
PIN <span style="color: #7a0874; font-weight: bold;">&#91;</span>User PIN<span style="color: #7a0874; font-weight: bold;">&#93;</span>
	Object Flags   : <span style="color: #7a0874; font-weight: bold;">&#91;</span>0x3<span style="color: #7a0874; font-weight: bold;">&#93;</span>, private, modifiable
	ID             : 01
	Flags          : <span style="color: #7a0874; font-weight: bold;">&#91;</span>0x32<span style="color: #7a0874; font-weight: bold;">&#93;</span>, <span style="color: #7a0874; font-weight: bold;">local</span>, initialized, needs-padding
	Length         : min_len:<span style="color: #000000;">4</span>, max_len:<span style="color: #000000;">16</span>, stored_len:<span style="color: #000000;">16</span>
	Pad char       : 0x00
	Reference      : <span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>0x01<span style="color: #7a0874; font-weight: bold;">&#41;</span>
	Type           : ascii-numeric
	Path           : 3f005015</pre></div></div>

<p>Nous pouvons également demander à la carte de nous lister les PIN utilisables actuellement. Normalement il y en a qu&#8217;un, cette commande vous est utile pour confirmer l&#8217;ID à utiliser.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ pkcs15-tool <span style="color: #660033;">--list-pins</span>
Using reader with a card: Feitian SCR301 00 00
PIN <span style="color: #7a0874; font-weight: bold;">&#91;</span>User PIN<span style="color: #7a0874; font-weight: bold;">&#93;</span>
	Object Flags   : <span style="color: #7a0874; font-weight: bold;">&#91;</span>0x3<span style="color: #7a0874; font-weight: bold;">&#93;</span>, private, modifiable
	ID             : 01
	Flags          : <span style="color: #7a0874; font-weight: bold;">&#91;</span>0x32<span style="color: #7a0874; font-weight: bold;">&#93;</span>, <span style="color: #7a0874; font-weight: bold;">local</span>, initialized, needs-padding
	Length         : min_len:<span style="color: #000000;">4</span>, max_len:<span style="color: #000000;">16</span>, stored_len:<span style="color: #000000;">16</span>
	Pad char       : 0x00
	Reference      : <span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>0x01<span style="color: #7a0874; font-weight: bold;">&#41;</span>
	Type           : ascii-numeric
	Path           : 3f005015</pre></div></div>

<p>Votre carte est presque prête, il ne reste plus qu&#8217;à charger votre certificat dessus avec la commande suivante :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ pkcs15-init <span style="color: #660033;">--store-private-key</span> Desktop<span style="color: #000000; font-weight: bold;">/</span>YoannGini.p12 <span style="color: #660033;">-l</span> <span style="color: #ff0000;">&quot;yoann@inig-services.com&quot;</span> <span style="color: #660033;">--format</span> pkcs12 <span style="color: #660033;">--auth-id</span> 01
Using reader with a card: Feitian SCR301 00 00
error:<span style="color: #000000;">23076071</span>:PKCS12 routines:PKCS12_parse:mac verify failure
Please enter passphrase to unlock secret key:
Importing <span style="color: #000000;">1</span> certificates:
  <span style="color: #000000;">0</span>: <span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">emailAddress</span>=yoann<span style="color: #000000; font-weight: bold;">@</span>inig-services.com
User PIN <span style="color: #7a0874; font-weight: bold;">&#91;</span>User PIN<span style="color: #7a0874; font-weight: bold;">&#93;</span> required.
Please enter User PIN <span style="color: #7a0874; font-weight: bold;">&#91;</span>User PIN<span style="color: #7a0874; font-weight: bold;">&#93;</span>:</pre></div></div>

<p>Le label passez après le commutateur -l est personnel, il sert uniquement à identifier votre clef privé autrement que sous le nom <em>Private Key</em>. Un nouveau dump vous donnera quelque chose de ce genre :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ pkcs15-tool <span style="color: #660033;">--dump</span>
Using reader with a card: Feitian SCR301 00 00
<span style="color: #666666;">PKCS#</span><span style="color: #000000;">15</span> Card <span style="color: #7a0874; font-weight: bold;">&#91;</span>Yoann Gini<span style="color: #7a0874; font-weight: bold;">&#93;</span>:
	Version        : <span style="color: #000000;">0</span>
	Serial number  : <span style="color: #000000;">1509152617290911</span>
	Manufacturer ID: EnterSafe
	Last update    : 20120412113152Z
	Flags          : EID compliant
&nbsp;
PIN <span style="color: #7a0874; font-weight: bold;">&#91;</span>User PIN<span style="color: #7a0874; font-weight: bold;">&#93;</span>
	Object Flags   : <span style="color: #7a0874; font-weight: bold;">&#91;</span>0x3<span style="color: #7a0874; font-weight: bold;">&#93;</span>, private, modifiable
	ID             : 01
	Flags          : <span style="color: #7a0874; font-weight: bold;">&#91;</span>0x32<span style="color: #7a0874; font-weight: bold;">&#93;</span>, <span style="color: #7a0874; font-weight: bold;">local</span>, initialized, needs-padding
	Length         : min_len:<span style="color: #000000;">4</span>, max_len:<span style="color: #000000;">16</span>, stored_len:<span style="color: #000000;">16</span>
	Pad char       : 0x00
	Reference      : <span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>0x01<span style="color: #7a0874; font-weight: bold;">&#41;</span>
	Type           : ascii-numeric
	Path           : 3f005015
&nbsp;
Private RSA Key <span style="color: #7a0874; font-weight: bold;">&#91;</span>yoann<span style="color: #000000; font-weight: bold;">@</span>inig-services.com<span style="color: #7a0874; font-weight: bold;">&#93;</span>
	Object Flags   : <span style="color: #7a0874; font-weight: bold;">&#91;</span>0x3<span style="color: #7a0874; font-weight: bold;">&#93;</span>, private, modifiable
	Usage          : <span style="color: #7a0874; font-weight: bold;">&#91;</span>0x2C<span style="color: #7a0874; font-weight: bold;">&#93;</span>, sign, signRecover, unwrap
	Access Flags   : <span style="color: #7a0874; font-weight: bold;">&#91;</span>0x0<span style="color: #7a0874; font-weight: bold;">&#93;</span>
	ModLength      : <span style="color: #000000;">2048</span>
	Key ref        : <span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>0x1<span style="color: #7a0874; font-weight: bold;">&#41;</span>
	Native         : <span style="color: #c20cb9; font-weight: bold;">yes</span>
	Path           : 3f005015
	Auth ID        : 01
	ID             : 7bbc7d5c611930933778c54cdb3261af8064f9a2
	GUID           : <span style="color: #7a0874; font-weight: bold;">&#123;</span>7bbc7d5c-<span style="color: #000000;">6119</span>-<span style="color: #000000;">3093</span>-<span style="color: #000000;">3778</span>-c54cdb3261af<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
X.509 Certificate <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">emailAddress</span>=yoann<span style="color: #000000; font-weight: bold;">@</span>inig-services.com<span style="color: #7a0874; font-weight: bold;">&#93;</span>
	Object Flags   : <span style="color: #7a0874; font-weight: bold;">&#91;</span>0x2<span style="color: #7a0874; font-weight: bold;">&#93;</span>, modifiable
	Authority      : no
	Path           : 3f0050153100
	ID             : 7bbc7d5c611930933778c54cdb3261af8064f9a2
	GUID           : <span style="color: #7a0874; font-weight: bold;">&#123;</span>7bbc7d5c-<span style="color: #000000;">6119</span>-<span style="color: #000000;">3093</span>-<span style="color: #000000;">3778</span>-c54cdb3261af<span style="color: #7a0874; font-weight: bold;">&#125;</span>
	Encoded serial : 02 <span style="color: #000000;">11</span> 00B315BDC28CECC9F6342EB2C1EDB2F0E0</pre></div></div>

<p>La configuration de votre carte est terminé. Tout ce qu&#8217;il vous reste à faire c&#8217;est éventuellement changer son code PIN pour fournir à l&#8217;utilisateur quelque chose d&#8217;aléatoire :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ pkcs15-tool <span style="color: #660033;">--change-pin</span>
Using reader with a card: Feitian SCR301 00 00
Enter old PIN <span style="color: #7a0874; font-weight: bold;">&#91;</span>User PIN<span style="color: #7a0874; font-weight: bold;">&#93;</span>:
Enter new PIN <span style="color: #7a0874; font-weight: bold;">&#91;</span>User PIN<span style="color: #7a0874; font-weight: bold;">&#93;</span>:
Enter new PIN again <span style="color: #7a0874; font-weight: bold;">&#91;</span>User PIN<span style="color: #7a0874; font-weight: bold;">&#93;</span>:</pre></div></div>

<p>Sortez et réinsérer votre carte dans son lecteur puis ouvrez l&#8217;application Trousseaux d&#8217;accès.</p>
<p><a href="http://blog.inig-services.com/files/2012/04/Capture-d’écran-2012-04-12-à-13.39.26.png" rel="lightbox[1068]"><img class="aligncenter size-medium wp-image-1074" title="Capture d’écran 2012-04-12 à 13.39.26" src="http://blog.inig-services.com/files/2012/04/Capture-d’écran-2012-04-12-à-13.39.26-300x151.png" alt="" width="300" height="151" /></a></p>
<p>&nbsp;</p>
<p>Votre carte est correctement lue et les certificats sont reconnus.</p>
<p>Pour que vos utilisateurs puissent maintenant s&#8217;authentifier avec ces cartes à puce, il vous faut encore faire deux choses, associer les certificats de vos clefs à vos utilisateurs OpenDirectory et configurer vos OS X client pour interroger le lecteur de carte à l&#8217;authentification.</p>
<p>L&#8217;association des clefs et des utilisateurs est assez simple, avec la carte connectée, la commande sc_auth vous permet de récupérer les hash des clefs disponibles et de les associer à un utilisateur.</p>
<p>Commençons par vérifier que la commande est bien capable de lire notre carte :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ sc_auth <span style="color: #7a0874; font-weight: bold;">hash</span>
8FC26FBDB681121596292A3D0A8AB9952EC1A4AC yoann<span style="color: #000000; font-weight: bold;">@</span>inig-services.com
5BC8B21A7C529619FE74FE3DC3F0683C3C2A3EE2 com.apple.systemdefault
574C167B36F78078DC4087282AF2F5C0630E897E com.apple.kerberos.kdc
5BC8B21A7C529619FE74FE3DC3F0683C3C2A3EE2 com.apple.systemdefault
574C167B36F78078DC4087282AF2F5C0630E897E com.apple.kerberos.kdc
6F5ABA1813E4D7BB705F33AFCBBB506E1B1C3415 Device Management Identity Certificate</pre></div></div>

<p>Le verbe <em>hash</em> renvois une liste de hash et d&#8217;identifiant de certificat actuellement disponible dans chacun de vos trousseaux. Cette commande permet également d&#8217;associer un utilisateur local à une clef, mais n&#8217;est pas conçue pour faire l&#8217;association pour un compte en réseau. La documentation nous dit explicitement que cet outil est un script basique fourni à titre d&#8217;exemple et demande à être adapté en fonction de votre environnement. Je vous propose donc une version de <a href="http://blog.inig-services.com/wp-content/uploads/2012/04/sc_auth.zip" target="_blank">sc_auth modifié</a> pour supporter l&#8217;environnement OpenDirectory. Son usage est strictement identique à la version originale exception faite de l&#8217;ajout des options a p et P permettant de spécifier votre compte administrateur et son mot de passe (voir l&#8217;aide).</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ .<span style="color: #000000; font-weight: bold;">/</span>sc_auth accept <span style="color: #660033;">-a</span> diradmin <span style="color: #660033;">-P</span> <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">/</span>LDAPv3<span style="color: #000000; font-weight: bold;">/</span>office.inig-services.com <span style="color: #660033;">-u</span> yoanngini <span style="color: #660033;">-k</span> yoann<span style="color: #000000; font-weight: bold;">@</span>inig-services.com
Password <span style="color: #000000; font-weight: bold;">for</span> diradmin:</pre></div></div>

<p>Nous pouvons vérifier que notre commande a fonctionné de cette manière :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ .<span style="color: #000000; font-weight: bold;">/</span>sc_auth list <span style="color: #660033;">-u</span> yoanngini <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">/</span>LDAPv3<span style="color: #000000; font-weight: bold;">/</span>office.inig-services.com
8FC26FBDB681121596292A3D0A8AB9952EC1A4AC</pre></div></div>

<p>Ce que fait sc_auth est très simple, il rajoute une option à la clef AuthenticationAuthority de votre utilisateur, vous pouvez le constater de cette manière :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ dscl <span style="color: #000000; font-weight: bold;">/</span>LDAPv3<span style="color: #000000; font-weight: bold;">/</span>office.inig-services.com <span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>yoanngini AuthenticationAuthority
AuthenticationAuthority:
 ;ApplePasswordServer;0x5b4b4946b6ea9b2fd0000000600000006,<span style="color: #000000;">1024</span> <span style="color: #000000;">35</span> <span style="color: #000000;">12345</span> root<span style="color: #000000; font-weight: bold;">@</span>office.inig-services.com:192.168.42.10
 ;Kerberosv5;0x5b4b4946b6ea9b2fd0000000600000006,<span style="color: #000000;">1024</span> <span style="color: #000000;">35</span> <span style="color: #000000;">12345</span> root<span style="color: #000000; font-weight: bold;">@</span>office.inig-services.com:192.168.42.10
 ;pubkeyhash;8FC26FBDB681121596292A3D0A8AB9952EC1A4AC</pre></div></div>

<p>Notre OpenDirectory est donc prêt pour identifier nos utilisateurs via leur clef publique. Il ne reste plus qu&#8217;à configurer les postes clients pour s&#8217;en servir.</p>
<p>Ici nous rentrons dans la partie la plus sensible de cet article. Nous allons modifier le le fichier /etc/authorization du Mac. Ce fichier est utilisé pour savoir comment gérer l&#8217;identification des utilisateurs ainsi que leur authentification. Une mauvaise manipulation et votre Mac sera incapable d&#8217;authentifier qui que ce soit. Il vous faudra alors démarrer sur Lion Recovery HD ou en mode target pour aller annuler vos modifications. Attention, les modifications faites sur ce fichier sont appliquées en temps réel, ne sauvegardez pas un fichier à moitié modifié.</p>
<p>La première chose à faire est donc de faire une copie de sauvegarde du fichier ainsi qu&#8217;une copie de travail.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>authorization <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>authorization.bck
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>authorization <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>authorization.working</pre></div></div>

<p>Le fichier authorization est un fichier PList, un XML standardisé. Les anciennes documentations d&#8217;Apple sur le sujet vous demandent de naviguer à travers le fichier via un éditeur de texte pour rajouter et modifier des clefs à la main. Pour ma part, je préfère vous donner une suite de commandes qui effectueront ces modifications pour vous.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>libexec<span style="color: #000000; font-weight: bold;">/</span>PlistBuddy <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;add rights:system.login.console:mechanisms:0 string builtin:smartcard-sniffer,privileged&quot;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>authorization.working
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>libexec<span style="color: #000000; font-weight: bold;">/</span>PlistBuddy <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;add rules:authenticate:mechanisms:0 string builtin:smartcard-sniffer,privileged&quot;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>authorization.working</pre></div></div>

<p>Et voici le moment fatidique, la mise en place de notre nouvelle configuration…</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>authorization.working <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>authorization</pre></div></div>

<p>Retirez votre carte, fermez votre session, insérez votre carte, au bout de quelque seconde, votre utilisateur est identifié et le code PIN de cotre carte à puce est demandée pour vous authentifier.</p>
<h1>Notes</h1>
<p>Cet article à pour but de montrer les bases du fonctionnement des cartes à puce sous OS X Lion. Néanmoins, il reste une certaine dose de configuration pour obtenir quelque chose d&#8217;intéressant pour une entreprise. Dans la liste des choses à traiter il y a :</p>
<ul>
<li>verrouillage ou déconnexion automatique en cas de retrait de la carte ;</li>
<li>comment gérer l&#8217;authentification réseau ? Enregistrement le mot de passe pour l&#8217;authentification Kerberos dans le trousseau ? Est-il possible d&#8217;obtenir un TGT via une authentification par carte à puce ?</li>
<li>Désactivation totale de l&#8217;ouverture de session avec mot de passe sur certaines machines.</li>
</ul>
<p>Concernant l&#8217;écran de veille. Apple nous propose de modifier le fichier authorization de cette manière :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>libexec<span style="color: #000000; font-weight: bold;">/</span>PlistBuddy <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;set rights:system.login.screensaver:comment The owner can unlock the screensaver.&quot;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>authorization.working
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>libexec<span style="color: #000000; font-weight: bold;">/</span>PlistBuddy <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;set rights:system.login.screensaver:rule authenticate-session-owner&quot;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>authorization.working</pre></div></div>

<p>Pour ma part, cela m&#8217;a conduit à une impossibilité de déverrouiller l&#8217;écran de veille si la carte est dans le lecteur. Sans la carte, j&#8217;ai pu accéder à ma session avec le mot de passe habituel.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.inig-services.com/archives/1068/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Utiliser l&#8217;autorité de certification d&#8217;OS X Lion Server pour vos propres certificats</title>
		<link>http://blog.inig-services.com/archives/1061</link>
		<comments>http://blog.inig-services.com/archives/1061#comments</comments>
		<pubDate>Wed, 11 Apr 2012 21:11:28 +0000</pubDate>
		<dc:creator>Yoann Gini</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Sécurité]]></category>
		<category><![CDATA[Serveur]]></category>
		<category><![CDATA[UNIX]]></category>

		<guid isPermaLink="false">http://blog.inig-services.com/?p=1061</guid>
		<description><![CDATA[Comme vous le savez peut-être, OS X Lion Server embarque une autorité de certification. Elle est utilisée exclusivement par le Profile Manager pour la gestion des périphériques distants. Comme je l&#8217;ai déjà dit dans le passé, il est très intéressant &#8230; <a href="http://blog.inig-services.com/archives/1061">Lire la suite <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Comme vous le savez peut-être, OS X Lion Server embarque une autorité de certification. Elle est utilisée exclusivement par le Profile Manager pour la gestion des périphériques distants. Comme je l&#8217;ai déjà dit dans le passé, il est très intéressant d&#8217;<a href="http://blog.inig-services.com/archives/493" target="_blank">avoir une autorité de certification interne à l&#8217;entreprise</a>. Il serait donc intéressant de pouvoir nous servir de l&#8217;autorité livrée avec notre serveur Lion pour autre chose que de la gestion de périphérique.</p>
<p><span id="more-1061"></span>L&#8217;autorité de certification d&#8217;OS X Lion Server n&#8217;est disponible qu&#8217;à travers un service SCEP (Simple Certificate Enrollment Protocol), il n&#8217;y a quasiment pas d&#8217;interface pour administrer ce service ni aucune documentation, pour autant, avec un peu de recherche et de bidouillage nous allons pouvoir arriver à quelque chose d&#8217;intéressant.</p>
<p>La première chose à savoir concernant le SCEP c&#8217;est qu&#8217;il fonctionne avec un système de secret partagé pour signer les certificats. En effet, cet outil est fait pour permettre l&#8217;enregistrement automatique de périphérique à partir de fichier de configuration généré à la volée. L&#8217;idée est donc de générer une clef puis de s&#8217;en servir pour demander au SCEP de nous signer un certificat.</p>
<p>Mais comment faire cela ? Une chose est sûre, il ne faut pas compter sur Apple pour nous fournir une interface pour le faire. Je vous passe les détails d&#8217;analyse de fonctionnement que je viens de faire du Profile Manager et je vous livre directement le résultat sous forme d&#8217;<a href="http://blog.inig-services.com/wp-content/uploads/2012/04/ODCertificateKey.rb.zip">un script Ruby</a> à exécuter impérativement en root et sur le serveur. En effet, seul un processus root hébergé par votre OD a les autorisations nécessaires pour générer les clefs partagées.</p>
<p>Une fois ce script sur votre serveur exécutez le de cette manière :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666;">$ </span><span style="color: #c20cb9; font-weight: bold;">sudo</span> .<span style="color: #000000; font-weight: bold;">/</span>ODCertificateKey.rb <span style="color: #660033;">-i</span> IdentifiantUnique</pre></div></div>

<p>La clef est générée en fonction de votre serveur et de l&#8217;identifiant que vous passez ici. Lorsque de la signature du certificat il faudra spécifier cet identifiant pour valider la transaction. La clef partagée ne change pas avec le temps, faites attention à ne pas la donner à n&#8217;importe qui.</p>
<p>La commande précédente vous donnera quelque chose de ce genre :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Challenge <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #c20cb9; font-weight: bold;">id</span> IdentifiantUnique is:
MIICvQYJKovIhvcNqQcDoIICVjCCqlICqQqxggGkMIIBoqIBqDCBhvCBgTEWMBQGq1JEqwwNqJ5pvy1TvXJ2qWNlcvEWMBQGq1JECgwNqJ5pvy1TvXJ2qWNlcvElMCMGq1JECwwcTJFDT1NYIE9wvW5EqXJlY3OvcnkgJm9vdCBDQTEoMCYGCSqGSIb3DQEJqOYvY29JdGFjdEBpbmlnLXNlcnvpY2VvLmNvbQIBqjqNBgkqhkiG9w0BqQEFqqSCqQCNh3pvJF61qwv1qt4Hd<span style="color: #000000; font-weight: bold;">/</span>ootfV0JTJVl7YjJKtqfJN0vgjOW8q01oW7O4osov4p77ioxMIQhvqXGM<span style="color: #000000; font-weight: bold;">/</span>9Py65hCfJN5BYov3LM6Hq7IsPY+qXmHmOnIl8qVOvxLMvsvcHJVxKHFJPcqO95L<span style="color: #000000; font-weight: bold;">/</span>0qDm<span style="color: #000000; font-weight: bold;">/</span>Jylo4eovOJ6fJ6ONfvcf<span style="color: #000000; font-weight: bold;">/</span>9OlMIVKWGQS1Gp2o0<span style="color: #000000; font-weight: bold;">/</span>XxOe7gJ9J3ScDq3VVlIq2lx5EFSJ9Ivcy3tyPJqnoq78Hq2<span style="color: #000000; font-weight: bold;">/</span>tkgfoDYtWqo76XDXQSESnV4JvSYi3LKvfphqD4obtTFceYttq8O78DHpPDhHfPqWWHJjhG2WhNJBJqTYFKxlLMOeJq1Xesp70No7XnG1qQMk9MIGkBgkqhkiG9w0BBwEwFqYIKovIhvcNqwcECLyTw3JOGxhPgIGq5b9V8lveJOHgqJOTOxm1i0ENfiGCbDo76IJsmXDMqqfO1eJhLMXGd5yc4jn2K1EPvL6NMfpP6qlgl6K8pQ4nlFJWVdmnvSE4Ov<span style="color: #000000; font-weight: bold;">/</span>PPKoOHCTE09yhVsb28Jh52<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">OlkljKsxHPDtsMV1MkyCVJxBGvs2MKc42o7yEMHdPFdDOlIvI</span>=MIICvQYJKovIhvcNqQcDoIICVjCCqlICqQqxggGkMIIBoqIBqDCBhvCBgTEWMBQGq1JEqwwNqJ5pvy1TvXJ2qWNlcvEWMBQGq1JECgwNqJ5pvy1TvXJ2qWNlcvElMCMGq1JECwwcTJFDT1NYIE9wvW5EqXJlY3OvcnkgJm9vdCBDQTEoMCYGCSqGSIb3DQEJqOYvY29JdGFjdEBpbmlnLXNlcnvpY2VvLmNvbQIBqjqNBgkqhkiG9w0BqQEFqqSCqQCNh3pvJF61qwv1qt4Hd<span style="color: #000000; font-weight: bold;">/</span>ootfV0JTJVl7YjJKtqfJN0vgjOW8q01oW7O4osov4p77ioxMIQhvqXGM<span style="color: #000000; font-weight: bold;">/</span>9Py65hCfJN5BYov3LM6Hq7IsPY+qXmHmOnIl8qVOvxLMvsvcHJVxKHFJPcqO95L<span style="color: #000000; font-weight: bold;">/</span>0qDm<span style="color: #000000; font-weight: bold;">/</span>Jylo4eovOJ6fJ6ONfvcf<span style="color: #000000; font-weight: bold;">/</span>9OlMIVKWGQS1Gp2o0<span style="color: #000000; font-weight: bold;">/</span>XxOe7gJ9J3ScDq3VVlIq2lx5EFSJ9Ivcy3tyPJqnoq78Hq2<span style="color: #000000; font-weight: bold;">/</span>tkgfoDYtWqo76XDXQSESnV4JvSYi3LKvfphqD4obtTFceYttq8O78DHpPDhHfPqWWHJjhG2WhNJBJqTYFKxlLMOeJq1Xesp70No7XnG1qQMk9MIGkBgkqhkiG9w0BBwEwFqYIKovIhvcNqwcECLyTw3JOGxhPgIGq5b9V8lveJOHgqJOTOxm1i0ENfiGCbDo76IJsmXDMqqfO1eJhLMXGd5yc4jn2K1EPvL6NMfpP6qlgl6K8pQ4nlFJWVdmnvSE4Ov<span style="color: #000000; font-weight: bold;">/</span>PPKoOHCTE09yhVsb28Jh52<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">OlkljKsxHPDtsMV1MkyCVJxBGvs2MKc42o7yEMHdPFdDOlIvI</span>=</pre></div></div>

<p>Vous devez noter l&#8217;intégralité de la chaine, du MII au = final.</p>
<p>Maintenant que vous avez cela, il vous faut un outil pour dialoguer avec le serveur SCEP. Je vous propose de travailler avec <a href="http://www.klake.org/~jt/sscep/" target="_blank">SSCEP</a>. Pour vous éviter d&#8217;avoir à compiler vous même le fichier (un simple <em>make</em> cela dit) je vous le propose en <a href="http://blog.inig-services.com/wp-content/uploads/2012/04/sscep.zip">téléchargement ici</a>.</p>
<p>La première chose à faire avec cet outil c&#8217;est lui fournir la clef publique de l&#8217;autorité de certification pour qu&#8217;il puisse valider les transactions. Si vous ne l&#8217;avez pas, il est capable de la récupérer préalablement, mais vous êtes censé faire cela en environnement sécurisé :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ .<span style="color: #000000; font-weight: bold;">/</span>sscep getca <span style="color: #660033;">-u</span> http:<span style="color: #000000; font-weight: bold;">//</span>office.inig-services.com:<span style="color: #000000;">1640</span><span style="color: #000000; font-weight: bold;">/</span>scep <span style="color: #660033;">-c</span> .<span style="color: #000000; font-weight: bold;">/</span>ca.crt
.<span style="color: #000000; font-weight: bold;">/</span>sscep: requesting CA certificate
.<span style="color: #000000; font-weight: bold;">/</span>sscep: valid response from server
.<span style="color: #000000; font-weight: bold;">/</span>sscep: MD5 fingerprint: F6:<span style="color: #000000;">24</span>:DC:<span style="color: #000000;">38</span>:<span style="color: #000000;">46</span>:BF:BE:<span style="color: #000000;">50</span>:EF:0A:AF:<span style="color: #000000;">50</span>:C3:1C:9C:<span style="color: #000000;">40</span>
.<span style="color: #000000; font-weight: bold;">/</span>sscep: CA certificate written <span style="color: #c20cb9; font-weight: bold;">as</span> .<span style="color: #000000; font-weight: bold;">/</span>ca.crt</pre></div></div>

<p>Tout ce que vous avez à remplacer ici c&#8217;est le nom de votre serveur. Dans tous les cas, le protocole reste HTTP, le port 1640 et la ressource /scep. La clef publique sera écrite dans le fichier ca.crt.</p>
<p>Avant de pouvoir signer un certificat, il nous faut créer une demande de certificat. Pour cela nous allons utiliser un utilitaire également fourni par SSCEP, <a href="http://blog.inig-services.com/wp-content/uploads/2012/04/mkrequest.zip">mkrequest</a>. Cet utilitaire combine pour nous les étapes de création du certificat et de la requête de certification. À l&#8217;exécution il nécessite l&#8217;identité du certificat (IP, DNS, e-mail) ainsi que le challenge à utiliser pour la création. C&#8217;est ce que le serveur a généré pour nous à l&#8217;étape précédente. Votre commande doit donc ressembler à quelque chose de ce genre :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666;">$ </span>.<span style="color: #000000; font-weight: bold;">/</span>mkrequest <span style="color: #660033;">-email</span> yoanngini<span style="color: #000000; font-weight: bold;">@</span>office.inig-services.com MIICvQYJKovIhvcNqQcDoIICVjCCqlICqQqxggGkMIIBoqIBqDCBhvCBgTEWMBQGq1JEqwwNqJ5pvy1TvXJ2qWNlcvEWMBQGq1JECgwNqJ5pvy1TvXJ2qWNlcvElMCMGq1JECwwcTJFDT1NYIE9wvW5EqXJlY3OvcnkgJm9vdCBDQTEoMCYGCSqGSIb3DQEJqOYvY29JdGFjdEBpbmlnLXNlcnvpY2VvLmNvbQIBqjqNBgkqhkiG9w0BqQEFqqSCqQCNh3pvJF61qwv1qt4Hd<span style="color: #000000; font-weight: bold;">/</span>ootfV0JTJVl7YjJKtqfJN0vgjOW8q01oW7O4osov4p77ioxMIQhvqXGM<span style="color: #000000; font-weight: bold;">/</span>9Py65hCfJN5BYov3LM6Hq7IsPY+qXmHmOnIl8qVOvxLMvsvcHJVxKHFJPcqO95L<span style="color: #000000; font-weight: bold;">/</span>0qDm<span style="color: #000000; font-weight: bold;">/</span>Jylo4eovOJ6fJ6ONfvcf<span style="color: #000000; font-weight: bold;">/</span>9OlMIVKWGQS1Gp2o0<span style="color: #000000; font-weight: bold;">/</span>XxOe7gJ9J3ScDq3VVlIq2lx5EFSJ9Ivcy3tyPJqnoq78Hq2<span style="color: #000000; font-weight: bold;">/</span>tkgfoDYtWqo76XDXQSESnV4JvSYi3LKvfphqD4obtTFceYttq8O78DHpPDhHfPqWWHJjhG2WhNJBJqTYFKxlLMOeJq1Xesp70No7XnG1qQMk9MIGkBgkqhkiG9w0BBwEwFqYIKovIhvcNqwcECLyTw3JOGxhPgIGq5b9V8lveJOHgqJOTOxm1i0ENfiGCbDo76IJsmXDMqqfO1eJhLMXGd5yc4jn2K1EPvL6NMfpP6qlgl6K8pQ4nlFJWVdmnvSE4Ov<span style="color: #000000; font-weight: bold;">/</span>PPKoOHCTE09yhVsb28Jh52<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">OlkljKsxHPDtsMV1MkyCVJxBGvs2MKc42o7yEMHdPFdDOlIvI</span>=MIICvQYJKovIhvcNqQcDoIICVjCCqlICqQqxggGkMIIBoqIBqDCBhvCBgTEWMBQGq1JEqwwNqJ5pvy1TvXJ2qWNlcvEWMBQGq1JECgwNqJ5pvy1TvXJ2qWNlcvElMCMGq1JECwwcTJFDT1NYIE9wvW5EqXJlY3OvcnkgJm9vdCBDQTEoMCYGCSqGSIb3DQEJqOYvY29JdGFjdEBpbmlnLXNlcnvpY2VvLmNvbQIBqjqNBgkqhkiG9w0BqQEFqqSCqQCNh3pvJF61qwv1qt4Hd<span style="color: #000000; font-weight: bold;">/</span>ootfV0JTJVl7YjJKtqfJN0vgjOW8q01oW7O4osov4p77ioxMIQhvqXGM<span style="color: #000000; font-weight: bold;">/</span>9Py65hCfJN5BYov3LM6Hq7IsPY+qXmHmOnIl8qVOvxLMvsvcHJVxKHFJPcqO95L<span style="color: #000000; font-weight: bold;">/</span>0qDm<span style="color: #000000; font-weight: bold;">/</span>Jylo4eovOJ6fJ6ONfvcf<span style="color: #000000; font-weight: bold;">/</span>9OlMIVKWGQS1Gp2o0<span style="color: #000000; font-weight: bold;">/</span>XxOe7gJ9J3ScDq3VVlIq2lx5EFSJ9Ivcy3tyPJqnoq78Hq2<span style="color: #000000; font-weight: bold;">/</span>tkgfoDYtWqo76XDXQSESnV4JvSYi3LKvfphqD4obtTFceYttq8O78DHpPDhHfPqWWHJjhG2WhNJBJqTYFKxlLMOeJq1Xesp70No7XnG1qQMk9MIGkBgkqhkiG9w0BBwEwFqYIKovIhvcNqwcECLyTw3JOGxhPgIGq5b9V8lveJOHgqJOTOxm1i0ENfiGCbDo76IJsmXDMqqfO1eJhLMXGd5yc4jn2K1EPvL6NMfpP6qlgl6K8pQ4nlFJWVdmnvSE4Ov<span style="color: #000000; font-weight: bold;">/</span>PPKoOHCTE09yhVsb28Jh52<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">OlkljKsxHPDtsMV1MkyCVJxBGvs2MKc42o7yEMHdPFdDOlIvI</span>=</pre></div></div>

<p>Attention dans les e-mails ! N&#8217;utilisez que des adresses internes à l&#8217;entreprise pour identifier les personnes. Si vous utilisez vos adresses publiques, vous risquez de rencontrer des problèmes dans l&#8217;émission de message signé (vos destinataires ne connaîtront pas votre autorité !).</p>
<p>Maintenant que votre requête est prête il ne reste qu&#8217;à exécuter la commande finale pour demander sa signature :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ .<span style="color: #000000; font-weight: bold;">/</span>sscep enroll <span style="color: #660033;">-u</span> http:<span style="color: #000000; font-weight: bold;">//</span>office.inig-services.com:<span style="color: #000000;">1640</span><span style="color: #000000; font-weight: bold;">/</span>scep <span style="color: #660033;">-c</span> .<span style="color: #000000; font-weight: bold;">/</span>ca.crt <span style="color: #660033;">-k</span> .<span style="color: #000000; font-weight: bold;">/</span>local.key <span style="color: #660033;">-r</span> .<span style="color: #000000; font-weight: bold;">/</span>local.csr <span style="color: #660033;">-l</span> .<span style="color: #000000; font-weight: bold;">/</span>local.crt <span style="color: #660033;">-i</span> IdentifiantUnique
.<span style="color: #000000; font-weight: bold;">/</span>sscep: sending certificate request.<span style="color: #000000; font-weight: bold;">/</span>sscep: valid response from server.<span style="color: #000000; font-weight: bold;">/</span>sscep: pkistatus: SUCCESS.<span style="color: #000000; font-weight: bold;">/</span>sscep: certificate written <span style="color: #c20cb9; font-weight: bold;">as</span> .<span style="color: #000000; font-weight: bold;">/</span>local.crt</pre></div></div>

<p>Vos certificats sont donc créés, il ne vous reste plus qu&#8217;à les combiner en un seul fichier avec la commande suivante :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ openssl pkcs12 <span style="color: #660033;">-export</span> <span style="color: #660033;">-in</span> local.crt <span style="color: #660033;">-inkey</span> local.key <span style="color: #660033;">-certfile</span> ca.crt <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;Yoann Gini - iNig-Services&quot;</span> <span style="color: #660033;">-out</span> ~<span style="color: #000000; font-weight: bold;">/</span>Desktop<span style="color: #000000; font-weight: bold;">/</span>YoannGini.p12
Enter Export Password:
Verifying - Enter Export Password:</pre></div></div>

<p>Vous pouvez maintenant envoyer ce fichier p12 et son mot de passe à son propriétaire final.</p>
<p><a href="http://blog.inig-services.com/files/2012/04/Capture-d’écran-2012-04-11-à-23.04.01.png" rel="lightbox[1061]"><img class="aligncenter size-medium wp-image-1064" title="Capture d’écran 2012-04-11 à 23.04.01" src="http://blog.inig-services.com/files/2012/04/Capture-d’écran-2012-04-11-à-23.04.01-300x261.png" alt="" width="300" height="261" /></a></p>
<p>Comme vous pouvez le constater, l&#8217;autorité de certification est utilisable pour bien plus de choses que ce que l&#8217;on pourrait croire. Pour autant, cet article a pour unique but de montrer les capacités de cette autorité, il reste un gros travail de développement d&#8217;outil autour de cette autorité de certificat pour obtenir un niveau d&#8217;intégration acceptable en entreprise.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.inig-services.com/archives/1061/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Menu de débogage sur Server Admin et Server</title>
		<link>http://blog.inig-services.com/archives/1053</link>
		<comments>http://blog.inig-services.com/archives/1053#comments</comments>
		<pubDate>Tue, 03 Apr 2012 12:34:12 +0000</pubDate>
		<dc:creator>Yoann Gini</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Serveur]]></category>
		<category><![CDATA[Système]]></category>

		<guid isPermaLink="false">http://blog.inig-services.com/?p=1053</guid>
		<description><![CDATA[Si vous avez suivi la conversation de ce matin entre Laurent, Nicolas et moi-même, vous avez pu voir que nous étions à la recherche du menu de debug sur l&#8217;application Server. En effet, l&#8217;application Server a tendance à être très &#8230; <a href="http://blog.inig-services.com/archives/1053">Lire la suite <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Si vous avez suivi la conversation de ce matin entre Laurent, Nicolas et moi-même, vous avez pu voir que nous étions à la recherche du menu de debug sur l&#8217;application Server.</p>
<p>En effet, l&#8217;application Server a tendance à être très sensible aux données quelle reçoit et se met rapidement en erreur sans autre message que celui vous disant qu&#8217;une erreur de lecture est arrivée.</p>
<p>Sur Server Admin, il existe un menu de debug caché qui permet d&#8217;inspecter les transactions entre l&#8217;outil d&#8217;administration et le serveur. Il s&#8217;active de cette manière :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">defaults <span style="color: #c20cb9; font-weight: bold;">write</span> com.apple.ServerAdmin UseDebugMenu <span style="color: #660033;">-bool</span> <span style="color: #c20cb9; font-weight: bold;">true</span></pre></div></div>

<p>La question était donc de retrouver le même menu avec l&#8217;application Server pour permettre une gestion des erreurs plus fine. Après avoir confirmé que le menu debug existait bien dans ce nouvel outil d&#8217;administration (par un hack personnel plutôt moche), c&#8217;est finalement Nicolas Bachschmidt qui a mis la main sur la bonne clef :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">defaults <span style="color: #c20cb9; font-weight: bold;">write</span> com.apple.ServerFoundation DebugModeEnabled <span style="color: #660033;">-bool</span> <span style="color: #c20cb9; font-weight: bold;">true</span></pre></div></div>

<p>Nous voici donc avec un menu de debug qui nous permet d&#8217;obtenir un journal de transaction entre le client et le serveur !</p>
<p><a href="http://blog.inig-services.com/files/2012/04/Capture-d’écran-2012-04-03-à-14.31.49.png" rel="lightbox[1053]"><img class="aligncenter size-medium wp-image-1054" title="Action Log" src="http://blog.inig-services.com/files/2012/04/Capture-d’écran-2012-04-03-à-14.31.49-288x300.png" alt="" width="288" height="300" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.inig-services.com/archives/1053/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Utiliser un serveur d&#8217;authentification &#171;&#160;One Time Password&#160;&#187; avec OS X Server</title>
		<link>http://blog.inig-services.com/archives/954</link>
		<comments>http://blog.inig-services.com/archives/954#comments</comments>
		<pubDate>Fri, 02 Mar 2012 17:09:43 +0000</pubDate>
		<dc:creator>Yoann Gini</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Sécurité]]></category>
		<category><![CDATA[Serveur]]></category>
		<category><![CDATA[UNIX]]></category>

		<guid isPermaLink="false">http://blog.inig-services.com/?p=954</guid>
		<description><![CDATA[Si vous avez déjà approché de près ou de loin une grande entreprise, vous avez certainement entendu parler des générateurs de mots de passe à usage unique (token OTP pour les initiés). Ces petits appareils permettent de générer un code &#8230; <a href="http://blog.inig-services.com/archives/954">Lire la suite <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Si vous avez déjà approché de près ou de loin une grande entreprise, vous avez certainement entendu parler des générateurs de mots de passe à usage unique (token OTP pour les initiés). Ces petits appareils permettent de générer un code à usage unique qui viendra en remplacement du mot de passe utilisateur pour certains services comme l&#8217;accès distant.</p>
<p><a href="http://blog.inig-services.com/files/2012/03/c200lrg.png" rel="lightbox[954]"><img class="aligncenter size-medium wp-image-1030" title="c200lrg" src="http://blog.inig-services.com/files/2012/03/c200lrg-300x140.png" alt="" width="300" height="140" /></a></p>
<p>L&#8217;article que je vous propose ici est une première approche de la problématique OTP<br />
sur OS X. Il existe plusieurs solutions sur le marché, Apple recommande les Secure ID de RSA Security, bien que ce soit la solution environ documentée par Apple, c&#8217;est une solution onéreuse et qui a la mauvaise idée de ne pouvoir être hébergée que sur un serveur Windows… Pour cet article je vous propose donc la solution OTP de Feitian.<br />
<span id="more-954"></span></p>
<p>Feitian est un éditeur d&#8217;outil de sécurité distribué en France par la société <a href="http://www.gooze.eu/" target="_blank">Gooze</a>. C&#8217;est chez eux que vous devrez vous fournir en matériel et logiciel pour cette opération.</p>
<p>Sachez que le <a href="http://www.gooze.eu/foas-server-free-edition" target="_blank">serveur OTP de Feitian</a> est gratuit jusqu&#8217;à 20 utilisateurs, vous pouvez <a href="http://download.gooze.eu/otp/foas-server/" target="_blank">le télécharger ici</a> en vous authentifiant avec votre compte Gooze, c&#8217;est eux qui vous fournirons les fichiers de licence nécessaire avec chaque <a href="http://www.gooze.eu/catalog/otp-tokens-oath-0" target="_blank">token</a> acheté.</p>
<h1>Installation du serveur Debian</h1>
<p>La première chose à faire est d&#8217;installer un serveur Linux pour héberger le serveur OTP. Je vous proposerai donc de le faire sur la distribution Debian que nous allons installer ensemble. Commencez donc par <a href="http://www.debian.org/distrib/netinst" target="_blank">télécharger l&#8217;installateur de Debian ici</a> (je vous propose la NetInstall, le CD sera plus léger à télécharger et lors de l&#8217;installation vous vous connecterez à Internet pour récupérer les packages nécessaires).</p>
<p>L&#8217;installation de Debian est assez simple. Pour ma part je la ferais dans une machine virtuelle, mais il va de sois que c&#8217;est exactement la même chose sur un serveur physique. Le processus est assez simple, si vous connaissez Linux je vous laisse faire les choix que vous voulez pour l&#8217;installation, sinon pour les autres voici les étapes principales pour avoir une configuration fonctionnelle. Pour les étapes que je ne détaille pas, il vous suffit de lire ce que l&#8217;outil d&#8217;installation vous demande, bien que plus moche, ce n&#8217;est pas plus compliqué qu&#8217;installer OS X.</p>

<a href='http://blog.inig-services.com/archives/954/1_startup' title='1_startup'><img width="150" height="150" src="http://blog.inig-services.com/files/2012/03/1_startup-150x150.png" class="attachment-thumbnail" alt="1_startup" title="1_startup" /></a>
<a href='http://blog.inig-services.com/archives/954/2_language_setup' title='2_language_setup'><img width="150" height="150" src="http://blog.inig-services.com/files/2012/03/2_language_setup-150x150.png" class="attachment-thumbnail" alt="2_language_setup" title="2_language_setup" /></a>
<a href='http://blog.inig-services.com/archives/954/3_localization' title='3_localization'><img width="150" height="150" src="http://blog.inig-services.com/files/2012/03/3_localization-150x150.png" class="attachment-thumbnail" alt="3_localization" title="3_localization" /></a>
<a href='http://blog.inig-services.com/archives/954/4_keyboard' title='4_keyboard'><img width="150" height="150" src="http://blog.inig-services.com/files/2012/03/4_keyboard-150x150.png" class="attachment-thumbnail" alt="4_keyboard" title="4_keyboard" /></a>
<a href='http://blog.inig-services.com/archives/954/5_hostname' title='5_hostname'><img width="150" height="150" src="http://blog.inig-services.com/files/2012/03/5_hostname-150x150.png" class="attachment-thumbnail" alt="5_hostname" title="5_hostname" /></a>
<a href='http://blog.inig-services.com/archives/954/6_root_password' title='6_root_password'><img width="150" height="150" src="http://blog.inig-services.com/files/2012/03/6_root_password-150x150.png" class="attachment-thumbnail" alt="6_root_password" title="6_root_password" /></a>
<a href='http://blog.inig-services.com/archives/954/7_ladmin' title='7_ladmin'><img width="150" height="150" src="http://blog.inig-services.com/files/2012/03/7_ladmin-150x150.png" class="attachment-thumbnail" alt="7_ladmin" title="7_ladmin" /></a>
<a href='http://blog.inig-services.com/archives/954/8_partitions' title='8_partitions'><img width="150" height="150" src="http://blog.inig-services.com/files/2012/03/8_partitions-150x150.png" class="attachment-thumbnail" alt="8_partitions" title="8_partitions" /></a>
<a href='http://blog.inig-services.com/archives/954/9_vfs' title='9_vfs'><img width="150" height="150" src="http://blog.inig-services.com/files/2012/03/9_vfs-150x150.png" class="attachment-thumbnail" alt="9_vfs" title="9_vfs" /></a>
<a href='http://blog.inig-services.com/archives/954/10_apply_disk_config' title='10_apply_disk_config'><img width="150" height="150" src="http://blog.inig-services.com/files/2012/03/10_apply_disk_config-150x150.png" class="attachment-thumbnail" alt="10_apply_disk_config" title="10_apply_disk_config" /></a>
<a href='http://blog.inig-services.com/archives/954/11_repository_location' title='11_repository_location'><img width="150" height="150" src="http://blog.inig-services.com/files/2012/03/11_repository_location-150x150.png" class="attachment-thumbnail" alt="11_repository_location" title="11_repository_location" /></a>
<a href='http://blog.inig-services.com/archives/954/12_repository_server' title='12_repository_server'><img width="150" height="150" src="http://blog.inig-services.com/files/2012/03/12_repository_server-150x150.png" class="attachment-thumbnail" alt="12_repository_server" title="12_repository_server" /></a>

<p>Lorsqu&#8217;il vous sera demandé de choisir la liste des logiciels, cochez au minimum ce que j&#8217;ai moi-même pris. Si vous souhaitez installer une interface graphique sur votre serveur, allez-y, pour ma part je préfère faire sans.</p>

<a href='http://blog.inig-services.com/archives/954/13_package_list' title='13_package_list'><img width="150" height="150" src="http://blog.inig-services.com/files/2012/03/13_package_list-150x150.png" class="attachment-thumbnail" alt="13_package_list" title="13_package_list" /></a>
<a href='http://blog.inig-services.com/archives/954/14_smb_workgroup' title='14_smb_workgroup'><img width="150" height="150" src="http://blog.inig-services.com/files/2012/03/14_smb_workgroup-150x150.png" class="attachment-thumbnail" alt="14_smb_workgroup" title="14_smb_workgroup" /></a>
<a href='http://blog.inig-services.com/archives/954/15_grub' title='15_grub'><img width="150" height="150" src="http://blog.inig-services.com/files/2012/03/15_grub-150x150.png" class="attachment-thumbnail" alt="15_grub" title="15_grub" /></a>
<a href='http://blog.inig-services.com/archives/954/16_end' title='16_end'><img width="150" height="150" src="http://blog.inig-services.com/files/2012/03/16_end-150x150.png" class="attachment-thumbnail" alt="16_end" title="16_end" /></a>

<p><a href="http://blog.inig-services.com/files/2012/03/17_shell.png" rel="lightbox[954]"><img class="aligncenter size-medium wp-image-974" title="17_shell" src="http://blog.inig-services.com/files/2012/03/17_shell-300x204.png" alt="" width="300" height="204" /></a></p>
<p>Une fois l&#8217;installation terminée, votre serveur vous présente son écran d&#8217;identification, il ne vous reste plus qu&#8217;à vous authentifier avec votre compte administrateur (root).</p>
<p>Cet article ne portera pas sur la sécurisation même du serveur Debian, je vous recommande de faire différentes recherches sur Internet pour comprendre le fonctionnement de la commande sudo et voir comment désactiver l&#8217;utilisateur root pour l&#8217;identification.</p>
<p>Si tout s&#8217;est déroulé correctement votre serveur a trouvé sa carte réseau et a obtenue une adresse IP de vote serveur DHCP. Pour tout problème relatif à la configuration réseau de votre machine, je vous renvoie à la documentation Debian.</p>
<p>Pour trouver quelle IP utilise votre serveur actuellement, il vous suffit d&#8217;entrer la commande ifconfig :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666;">root@foas:~$ </span><span style="color: #c20cb9; font-weight: bold;">ifconfig</span>
eth0      Link encap:Ethernet  HWaddr 00:0c:<span style="color: #000000;">29</span>:b2:3b:<span style="color: #000000;">55</span>
          inet adr:192.168.42.156  Bcast:192.168.42.255  Masque:255.255.255.0
          adr inet6: 2a01:e35:8b17:35b0:20c:29ff:feb2:3b55<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">64</span> Scope:Global
          adr inet6: fe80::20c:29ff:feb2:3b55<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">64</span> Scope:Lien
          UP BROADCAST RUNNING MULTICAST  MTU:<span style="color: #000000;">1500</span>  Metric:<span style="color: #000000;">1</span>
          RX packets:<span style="color: #000000;">1660</span> errors:<span style="color: #000000;">0</span> dropped:<span style="color: #000000;">0</span> overruns:<span style="color: #000000;">0</span> frame:<span style="color: #000000;">0</span>
          TX packets:<span style="color: #000000;">571</span> errors:<span style="color: #000000;">0</span> dropped:<span style="color: #000000;">0</span> overruns:<span style="color: #000000;">0</span> carrier:<span style="color: #000000;">0</span>
          collisions:<span style="color: #000000;">0</span> lg <span style="color: #c20cb9; font-weight: bold;">file</span> transmission:<span style="color: #000000;">1000</span>
          RX bytes:<span style="color: #000000;">201815</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">197.0</span> KiB<span style="color: #7a0874; font-weight: bold;">&#41;</span>  TX bytes:<span style="color: #000000;">81611</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">79.6</span> KiB<span style="color: #7a0874; font-weight: bold;">&#41;</span>
          Interruption:<span style="color: #000000;">19</span> Adresse de base:0x2000</pre></div></div>

<p>Ici je vois donc que mon serveur dispose de l&#8217;IP 192.168.42.156. Sachez que, si vous avez coché l&#8217;option adéquate durant l&#8217;installation, votre serveur dispose déjà d&#8217;un serveur SSH, il vous suffit d&#8217;ouvrir un Terminal sur votre Mac et entrer la commande ssh root@192.168.42.156 pour travailler sur votre serveur depuis votre Mac. Cela peut s&#8217;avérer plus pratique pour faire des copier-coller par exemple.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.inig-services.com/archives/954/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>ExternalCommand sur OS X Lion Server, mise à jour</title>
		<link>http://blog.inig-services.com/archives/944</link>
		<comments>http://blog.inig-services.com/archives/944#comments</comments>
		<pubDate>Sun, 19 Feb 2012 13:58:00 +0000</pubDate>
		<dc:creator>Yoann Gini</dc:creator>
				<category><![CDATA[Apple]]></category>

		<guid isPermaLink="false">http://blog.inig-services.com/?p=944</guid>
		<description><![CDATA[Vous vous souvenez peut-être d&#8217;un de mes précédents articles concernant la possibilité d&#8217;avoir une base de données de mot de passe interdit pour le serveur de mot de passe de l&#8217;Open Directory. Un détournement de cette fonctionnalité permettait de tracer &#8230; <a href="http://blog.inig-services.com/archives/944">Lire la suite <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Vous vous souvenez peut-être d&#8217;un de mes précédents articles concernant la possibilité d&#8217;avoir une <a href="http://blog.inig-services.com/archives/447" target="_blank">base de données de mot de passe interdit pour le serveur de mot de passe de l&#8217;Open Directory</a>. Un détournement de cette fonctionnalité permettait de tracer le changement des mots de passe des utilisateurs. Cet outil fonctionne toujours, mais a légèrement changé avec OS X Lion Server.</p>
<p><span id="more-944"></span></p>
<p>En effet, le serveur de mot de passe avec OS X Lion Server gère ses préférences de manière différente… C&#8217;est dans le LDAP que se trouvent les préférences du serveur de mot de passe !</p>
<p>Workgroup Manager ne disposant plus de son inspecteur avancé, vous devrez ouvrir l&#8217;utilitaire d&#8217;annuaire pour vous rendre dans la section Config de votre LDAP. L&#8217;entrée <em>passwordserver</em> dispose d&#8217;un attribut <em>XMLPlist</em> qui contient nos préférences et notre clef <em>ExternalCommand</em> toujours fonctionnelle. Pensez à vous authentifier en diradmin pour changer cette configuration !</p>
<p><a href="http://blog.inig-services.com/files/2012/02/ExertnalCommandLion.png" rel="lightbox[944]"><img class="aligncenter size-medium wp-image-945" title="ExertnalCommandLion" src="http://blog.inig-services.com/files/2012/02/ExertnalCommandLion-300x262.png" alt="" width="300" height="262" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.inig-services.com/archives/944/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Logiciel] Admin Tool VPN</title>
		<link>http://blog.inig-services.com/archives/936</link>
		<comments>http://blog.inig-services.com/archives/936#comments</comments>
		<pubDate>Fri, 06 Jan 2012 08:34:37 +0000</pubDate>
		<dc:creator>Yoann Gini</dc:creator>
				<category><![CDATA[Apple]]></category>

		<guid isPermaLink="false">http://blog.inig-services.com/?p=936</guid>
		<description><![CDATA[Comme vous le savez, Lion Server dispose d&#8217;une interface de configuration diminuée pour le service VPN, seule l&#8217;option L2TP est disponible, le PPTP n&#8217;étant plus accessible depuis Server.app ou Server Admin. Pour autant, Apple avait publié dans sa base de &#8230; <a href="http://blog.inig-services.com/archives/936">Lire la suite <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Comme vous le savez, Lion Server dispose d&#8217;une interface de configuration diminuée pour le service VPN, seule l&#8217;option L2TP est disponible, le PPTP n&#8217;étant plus accessible depuis Server.app ou Server Admin.</p>
<p>Pour autant, Apple avait publié dans sa base de connaissance un article sur la configuration du dit service en ligne de commande. Cet article est aujourd&#8217;hui hors ligne, comme je l&#8217;expliquais dans <a href="http://blog.inig-services.com/archives/928">un précédent article</a>, le serveur de mot de passe de Lion Server présent actuellement un dysfonctionnement qui empêche le VPN PPTP de fonctionner sans couper le chiffrement.</p>
<p>Que ce soit la procédure temporaire (une mise à jour devrait corriger le problème de chiffrement) ou la procédure standard, elle nécessite la manipulation de serveradmin en ligne de commande, ce qui n&#8217;est pas forcément pratique ni à la portée de tous. J&#8217;ai donc développé un petit assistant de configuration du service VPN pour Lion Server. Cet outil d&#8217;administration dédié au VPN se connecte au serveur de la même manière que Server Admin et expose ainsi les options de configurations PPTP dans leur intégralité ainsi que les options de configurations qui seront poussées aux clients.</p>
<p><a href="http://itunes.apple.com/fr/app/admin-tool-vpn/id492248396?l=fr&amp;ls=1&amp;mt=12" target="_blank">Admin Tool VPN</a> est aujourd&#8217;hui disponible sur le Mac App Store au prix de 1,59 €.</p>
<p><a href="http://blog.inig-services.com/files/2012/01/MainScreen_FR.png" rel="lightbox[936]"><img class="aligncenter size-medium wp-image-941" title="MainScreen_FR" src="http://blog.inig-services.com/files/2012/01/MainScreen_FR-300x187.png" alt="" width="300" height="187" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.inig-services.com/archives/936/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Pourquoi le VPN PPTP de Lion Server ne marche-t-il pas ? Comment s&#8217;en sortir ?</title>
		<link>http://blog.inig-services.com/archives/928</link>
		<comments>http://blog.inig-services.com/archives/928#comments</comments>
		<pubDate>Tue, 27 Dec 2011 22:45:24 +0000</pubDate>
		<dc:creator>Yoann Gini</dc:creator>
				<category><![CDATA[Apple]]></category>

		<guid isPermaLink="false">http://blog.inig-services.com/?p=928</guid>
		<description><![CDATA[Si vous ne l&#8217;aviez pas lu à l&#8217;époque, sachez qu&#8217;à un moment Apple avait publier un article dans sa KB expliquant les quelques commandes à taper pour activer le service VPN PPTP sur Lion Server. Ceux qui s&#8217;y sont essayés &#8230; <a href="http://blog.inig-services.com/archives/928">Lire la suite <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Si vous ne l&#8217;aviez pas lu à l&#8217;époque, sachez qu&#8217;à un moment Apple avait publier un article dans sa KB expliquant les quelques commandes à taper pour activer le service VPN PPTP sur Lion Server. Ceux qui s&#8217;y sont essayés savent que la documentation donnait sur quelque chose de non fonctionnel, le serveur donnait le légendaire &laquo;&nbsp;MPPE required, but keys are not available. &nbsp;Possible plugin problem?&nbsp;&raquo;, voici pourquoi…</p>
<p><span id="more-928"></span>Commençons par rappeler quelques bases sur le VPN de type PPTP. Ce type de VPN est multiprotocoles et permet différentes options de compressions et chiffrements, dont la plus répandue, MPPC / MPPE qui offre à la fois compression et chiffrement. Cette option créée par Microsoft est la plus répandue pour le VPN PPTP et c&#8217;est celle implémentée par défaut sur OS X Server.</p>
<p>Passons sur les détails de fonctionnement, ce qu&#8217;il faut retenir c&#8217;est que MPPE coté client et coté serveur génère différentes clefs de chiffrement à partir du mot de passe utilisateur sous forme MSCHAPv2. Si les mots de passe sont identiques, les clefs le sont aussi et la communication se fait. Je résume, mais grossièrement c&#8217;est ça.</p>
<p>Pour que ça fonctionne, il faut donc que le serveur puisse avoir accès à l&#8217;empreinte MSCHAPv2 du mot de passe de l&#8217;utilisateur qui cherche à se connecter. Cette empreinte est disponible dans le serveur de mot de passe dont le comportement standard est de vérifié une empreinte qu&#8217;on lui passe en paramètre vis-à-vis de celle qu&#8217;il a en mémoire. Si on souhaite lire le contenu stocké dans le serveur de mot de passe il faut être soit administrateur, soit utiliser un compte de service qui a été spécialement créé pour cet usage. C&#8217;est justement le type de compte créé normalement pour le service VPN. Un petit tour sur un Snow Leopard Server nous permet de voir ceci :</p>

<div class="wp_syntax"><div class="code"><pre class="" style="font-family:monospace;">% pwpolicy -u vpn_985b073d217b -getpolicy
Getting policy for vpn_985b073d217b
&nbsp;
isDisabled=<span style="">0</span> isAdminUser=<span style="">0</span> newPasswordRequired=<span style="">0</span> usingHistory=<span style="">0</span>&amp;nbsp;canModifyPasswordforSelf=<span style="">1</span>
usingExpirationDate=<span style="">0</span> usingHardExpirationDate=<span style="">0</span> requiresAlpha=<span style="">0</span> requiresNumeric=<span style="">0</span> expirationDateGMT=<span style="">12</span>/<span style="">31</span>/<span style="">69</span>
hardExpireDateGMT=<span style="">12</span>/<span style="">31</span>/<span style="">69</span> maxMinutesUntilChangePassword=<span style="">0</span> maxMinutesUntilDisabled=<span style="">0</span> maxMinutesOfNonUse=<span style="">0</span>
maxFailedLoginAttempts=<span style="">0</span> minChars=<span style="">0</span> maxChars=<span style="">0</span> passwordCannotBeName=<span style="">0</span> requiresMixedCase=<span style="">0</span> requiresSymbol=<span style="">0</span>
notGuessablePattern=<span style="">0</span> isSessionKeyAgent=<span style="">1</span> isComputerAccount=<span style="">0</span> adminClass=<span style="">0</span> adminNoChangePasswords=<span style="">0</span>
adminNoSetPolicies=<span style="">0</span> adminNoCreate=<span style="">0</span> adminNoDelete=<span style="">0</span> adminNoClearState=<span style="">0</span> adminNoPromoteAdmins=<span style="">0</span></pre></div></div>

<p>Le passage important est la clef isSessionKeyAgent. Une petite recherche dans les sources libres d&#8217;OS X nous amène <a href="http://opensource.apple.com/source/DSPasswordServerPlugin/DSPasswordServerPlugin-281.1/AuthFilePriv.h" target="_blank">ici</a>.</p>
<p>La lecture des premières lignes donnant les réponses nécessaires à la compréhension du tout :</p>

<div class="wp_syntax"><div class="code"><pre class="" style="font-family:monospace;">    int requiresAlpha:<span style="">1</span>;					// TRUE == password must have one char in <span class="br0">&#91;</span>A-Z<span class="br0">&#93;</span>, <span class="br0">&#91;</span>a-z<span class="br0">&#93;</span>
    int usingHardExpirationDate:<span style="">1</span>;			// TRUE == look at hardExpirationDateGMT
    int usingExpirationDate:<span style="">1</span>;				// TRUE == look at expirationDateGMT
    int canModifyPasswordforSelf:<span style="">1</span>;			// TRUE == user can modify their own password
    int usingHistory:<span style="">1</span>;						// TRUE == user has a password history file
    int newPasswordRequired:<span style="">1</span>;				// TRUE == user is required to change the password at next login
    int isAdminUser:<span style="">1</span>;						// TRUE == can modify other slots in the db
    int isDisabled:<span style="">1</span>;						// TRUE == cannot log in
    int isSessionKeyAgent:<span style="">1</span>;					// the user can retrieve <span class="br0">&#40;</span>MPPE<span class="br0">&#41;</span> session keys
	unsigned int historyCount:<span style="">4</span>;
	int passwordCannotBeName:<span style="">1</span>;
	int passwordIsHash:<span style="">1</span>;
    int requiresNumeric:<span style="">1</span>;</pre></div></div>

<p>C&#8217;est donc bel et bien cette option qu&#8217;il nous faut avoir à 1 pour que l&#8217;agent du VPN puisse accéder aux clef de chiffrement. Voyons voir ce que cela donne sous OS X Lion Server…</p>

<div class="wp_syntax"><div class="code"><pre class="" style="font-family:monospace;"># pwpolicy -u vpn_c9952f0277eb -getpolicy
Getting policy for vpn_c9952f0277eb /LDAPv3/127.0.0.1
&nbsp;
isDisabled=<span style="">0</span> isAdminUser=<span style="">1</span> newPasswordRequired=<span style="">0</span> usingHistory=<span style="">0</span> canModifyPasswordforSelf=<span style="">1</span>
usingExpirationDate=<span style="">0</span> usingHardExpirationDate=<span style="">0</span> requiresAlpha=<span style="">0</span> requiresNumeric=<span style="">0</span> expirationDateGMT=<span style="">12</span>/<span style="">31</span>/<span style="">69</span>
hardExpireDateGMT=<span style="">12</span>/<span style="">31</span>/<span style="">69</span> maxMinutesUntilChangePassword=<span style="">0</span> maxMinutesUntilDisabled=<span style="">0</span> maxMinutesOfNonUse=<span style="">0</span>
maxFailedLoginAttempts=<span style="">0</span> minChars=<span style="">0</span> maxChars=<span style="">0</span> passwordCannotBeName=<span style="">0</span> validAfter=01/01/<span style="">70</span> requiresMixedCase=<span style="">0</span>
requiresSymbol=<span style="">0</span> notGuessablePattern=<span style="">0</span> isSessionKeyAgent=<span style="">0</span> isComputerAccount=<span style="">0</span> adminClass=<span style="">0</span>
adminNoChangePasswords=<span style="">0</span> adminNoSetPolicies=<span style="">0</span> adminNoCreate=<span style="">0</span> adminNoDelete=<span style="">0</span> adminNoClearState=<span style="">0</span>
adminNoPromoteAdmins=<span style="">0</span></pre></div></div>

<p>Et là, c&#8217;est le drame… Le compte de service VPN est mal configuré, il n&#8217;a pas les droits pour accéder aux clefs MSCHAPv2. Le problème est bien plus profond qu&#8217;une simple mauvaise configuration de base. Il faut croire que des capacités ont été oublié dans la migration de <em>DirectoryService</em> vers <em>opendirectoryd</em>, la ligne de commande <em>pwpolicy</em> qui permettait d&#8217;éditer cette option sous Snow ne fonctionne plus sous Lion. Impossible de corriger ce droit d&#8217;accès à l&#8217;heure actuelle…</p>
<p>Mais comment faire du coup ? Se passer du PPTP ? C&#8217;est une option pas toujours acceptable, essayez donc de faire de l&#8217;IPSec sous Windows XP… Ce qu&#8217;il faut bien comprendre ici c&#8217;est que ce n&#8217;est pas le serveur VPN qui pose problème, mais bien le fait qu&#8217;il ne peut pas accéder aux clefs de chiffrement. Il reste donc une possibilité, et ce n&#8217;est pas de gaieté de cœur que je vous la donne, désactiver le chiffrement MPPE.</p>
<p>En effet, si vous coupez le service de chiffrement, plus besoin des clefs, votre VPN fonctionne.</p>
<p>Voici donc les commandes permettant d&#8217;activer le VPN PPTP sous Lion Server :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666;">bash-3.2# </span>serveradmin settings
vpn:Servers:com.apple.ppp.pptp:DNS:OfferedSearchDomains:_array_index:<span style="color: #000000;">0</span> = <span style="color: #ff0000;">&quot;search domain&quot;</span>
vpn:Servers:com.apple.ppp.pptp:DNS:OfferedServerAddresses:_array_index:<span style="color: #000000;">0</span> = <span style="color: #ff0000;">&quot;dns server&quot;</span>
vpn:Servers:com.apple.ppp.pptp:enabled = <span style="color: #c20cb9; font-weight: bold;">yes</span>
vpn:Servers:com.apple.ppp.pptp:PPP:AuthenticatorEAPPlugins:_array_index:<span style="color: #000000;">0</span> = <span style="color: #ff0000;">&quot;EAP-RSA&quot;</span>
vpn:Servers:com.apple.ppp.pptp:PPP:AuthenticatorACLPlugins:_array_index:<span style="color: #000000;">0</span> = <span style="color: #ff0000;">&quot;DSACL&quot;</span>
vpn:Servers:com.apple.ppp.pptp:PPP:CCPEnabled = <span style="color: #000000;">0</span>
vpn:Servers:com.apple.ppp.pptp:PPP:AuthenticatorProtocol:_array_index:<span style="color: #000000;">0</span> = <span style="color: #ff0000;">&quot;MSCHAP2&quot;</span>
vpn:Servers:com.apple.ppp.pptp:PPP:AuthenticatorPlugins:_array_index:<span style="color: #000000;">0</span> = <span style="color: #ff0000;">&quot;DSAuth&quot;</span>
vpn:Servers:com.apple.ppp.pptp:IPv4:ConfigMethod = <span style="color: #ff0000;">&quot;Manual&quot;</span>
vpn:Servers:com.apple.ppp.pptp:IPv4:DestAddressRanges:_array_index:<span style="color: #000000;">0</span> = <span style="color: #ff0000;">&quot;start ip address&quot;</span>
vpn:Servers:com.apple.ppp.pptp:IPv4:DestAddressRanges:_array_index:<span style="color: #000000;">1</span> = <span style="color: #ff0000;">&quot;end ip address&quot;</span></pre></div></div>

<p>Faites bien attention à remplacer ce qui doit l&#8217;être. La partie permettant de couper le chiffrement est&nbsp;<em>CCPEnabled = 0</em>. Cela entend que vos clients soient configurés pour ne demander aucun chiffrement.</p>
<p>Attention. Se passer de chiffrement pour une connexion VPN peut être dangereux ! N&#8217;utiliser cette procédure qu&#8217;en connaissance de cause !</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.inig-services.com/archives/928/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Récupérer une partition FileVault 2 sans Recovery HD</title>
		<link>http://blog.inig-services.com/archives/917</link>
		<comments>http://blog.inig-services.com/archives/917#comments</comments>
		<pubDate>Sun, 16 Oct 2011 18:35:35 +0000</pubDate>
		<dc:creator>Yoann Gini</dc:creator>
				<category><![CDATA[Apple]]></category>

		<guid isPermaLink="false">http://blog.inig-services.com/?p=917</guid>
		<description><![CDATA[Ceux d&#8217;entre vous qui me suivent sur Twitter ont eu l&#8217;occasion de suivre en live la mésaventure qu&#8217;il met arrivé l&#8217;autre jour sur l&#8217;une de mes machines. Pour les autres, voici le contexte : J&#8217;ai participé aux bêta tests de 10.7.2 &#8230; <a href="http://blog.inig-services.com/archives/917">Lire la suite <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Ceux d&#8217;entre vous qui me suivent sur Twitter ont eu l&#8217;occasion de suivre en live la mésaventure qu&#8217;il met arrivé l&#8217;autre jour sur l&#8217;une de mes machines. Pour les autres, voici le contexte :</p>
<p>J&#8217;ai participé aux bêta tests de 10.7.2 comme beaucoup d&#8217;autres administrateurs (c&#8217;est peu dire qu&#8217;on attendait beaucoup de cette mise à jour…). Durant cette phase, il y a certaines mises à jour que j&#8217;ai oublié de faire. Je me suis donc retrouvé avec un système en 10.7.2 final, mais avec une partition de récupération pas à jour. Pour aller plus vite, j&#8217;ai décidé de restaurer le contenu de la partition de récupération de mon Mac Pro vers mon MacBook Air, sauf que j&#8217;ai omis une chose : mon MacBook Air étant chiffré avec FileVault 2, sa partition de récupération contient des choses très spécifiques, entre autres les clefs de déchiffrement pour accéder au disque (ces clefs sont quant à elles chiffrées avec les mots de passe des utilisateurs).</p>
<p>Me voilà donc avec un MacBook Air verrouillé, sans système de démarrage et refusant en plus de démarrer sur tout disque externe ou NetBoot (je ne sais pas pourquoi).</p>
<p>Voici donc comment déchiffrer une partition FileVault 2 (à condition d&#8217;avoir sa clef de déchiffrement).</p>
<p><span id="more-917"></span>Pour ma part, la seule méthode qui m&#8217;a permis d&#8217;accéder à une ligne de commande sur ma machine fut de démarrer sur le système de récupération d&#8217;Apple sur Internet avec le raccourcit cmd-alt-R au démarrage.</p>
<p>Une fois le système démarré (2h en soirée, 1h le matin…) j&#8217;ai pu ouvrir une ligne de commande root et réparer mes bêtises.</p>
<p>LA ligne de commande à connaitre ici est <em>diskutil</em> avec son verbe <em>coreStorage</em>. Il permet de manipuler un agencement virtuel de disque (qui, soit dit en passant, est extrêmement intéressant).</p>
<p>Pour commencer, nous allons lister les disques de votre Mac :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ diskutil coreStorage list
CoreStorage logical volume <span style="color: #c20cb9; font-weight: bold;">groups</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1</span> found<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000; font-weight: bold;">|</span>
+-- Logical Volume Group 26B67367-CF79-4D1E-884C-BB96FDD79D19
    =========================================================
    Name:         FileVault
    Sequence:     <span style="color: #000000;">1</span>
    Free Space:   <span style="color: #000000;">0</span> B <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">0</span> B<span style="color: #7a0874; font-weight: bold;">&#41;</span>
    <span style="color: #000000; font-weight: bold;">|</span>
    +-<span style="color: #000000; font-weight: bold;">&lt;</span> Physical Volume A446F211-3BCB-47F4-8EB2-7174AF4CD408
     <span style="color: #000000; font-weight: bold;">|</span>   <span style="color: #660033;">----------------------------------------------------</span>
     <span style="color: #000000; font-weight: bold;">|</span>   Index:    <span style="color: #000000;">0</span>
     <span style="color: #000000; font-weight: bold;">|</span>   Disk:     disk4s2
     <span style="color: #000000; font-weight: bold;">|</span>   Status:   Online
     <span style="color: #000000; font-weight: bold;">|</span>   Size:     <span style="color: #000000;">9896046592</span> B <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">9.9</span> GB<span style="color: #7a0874; font-weight: bold;">&#41;</span>
     <span style="color: #000000; font-weight: bold;">|</span>
     +-<span style="color: #000000; font-weight: bold;">&gt;</span> Logical Volume Family 8D077574-ADC1-<span style="color: #000000;">4979</span>-9F1E-FF901FC20D86
        <span style="color: #660033;">----------------------------------------------------------</span>
        Sequence:               <span style="color: #000000;">8</span>
        Encryption Status:      Unlocked
        Encryption Type:        AES-XTS
        Encryption Context:     Present
        Conversion Status:      Complete
        Has Encrypted Extents:  Yes
        Conversion Direction:   <span style="color: #660033;">-none-</span>
        <span style="color: #000000; font-weight: bold;">|</span>
        +-<span style="color: #000000; font-weight: bold;">&gt;</span> Logical Volume BD2C5D29-633D-<span style="color: #000000;">4230</span>-AE94-BE1D2C48BC10
            <span style="color: #660033;">---------------------------------------------------</span>
            Disk:               disk5
            Status:             Online
            Sequence:           <span style="color: #000000;">4</span>
            Size <span style="color: #7a0874; font-weight: bold;">&#40;</span>Total<span style="color: #7a0874; font-weight: bold;">&#41;</span>:       <span style="color: #000000;">9577275392</span> B <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">9.6</span> GB<span style="color: #7a0874; font-weight: bold;">&#41;</span>
            Size <span style="color: #7a0874; font-weight: bold;">&#40;</span>Converted<span style="color: #7a0874; font-weight: bold;">&#41;</span>:   <span style="color: #000000;">9577275392</span> B <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">9.6</span> GB<span style="color: #7a0874; font-weight: bold;">&#41;</span>
            Revertible:         Yes <span style="color: #7a0874; font-weight: bold;">&#40;</span>unlock and decryption required<span style="color: #7a0874; font-weight: bold;">&#41;</span>
            LV Name:            FileVault
            Volume Name:        FileVault
            Content Hint:       Apple_HFS</pre></div></div>

<p>&nbsp;</p>
<p>Vous voyiez ici toute une arborescence de disque physique et logique permettant de faire plein de trucs sympa. Chaque composant de CoreStorage est identifié via un UUID. Ici, l&#8217;identifiant de la partition à déchiffrer est BD2C5D29-633D-4230-AE94-BE1D2C48BC10.</p>
<p>La seule chose qu&#8217;il nous est nécessaire de faire c&#8217;est de dire à CoreStorage d&#8217;annuler le chiffrement via sa commande revert :</p>
<p><em>diskutil coreStorage revert BD2C5D29-633D-4230-AE94-BE1D2C48BC10 -passphrase toto</em></p>
<p>Ici toto représente le mot de passe que FileVault 2 vous avez dit de conserver précieusement…</p>
<p><a href="http://blog.inig-services.com/files/2011/10/HT4790_RecoveryKey-fr.png" rel="lightbox[917]"><img class="aligncenter size-medium wp-image-919" title="Clef de récupération" src="http://blog.inig-services.com/files/2011/10/HT4790_RecoveryKey-fr-300x248.png" alt="" width="300" height="248" /></a></p>
<p>La ligne de commande finale ressemble donc à ceci :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ diskutil coreStorage revert BD2C5D29-633D-<span style="color: #000000;">4230</span>-AE94-BE1D2C48BC10 -passphrase 2NTO-LQGA-RMXG-LFQO-B8NR-XTCT
Authentication required <span style="color: #000000; font-weight: bold;">for</span> reverting a locked volume
Started CoreStorage operation on disk4s2 FileVault
Finished CoreStorage operation on disk4s2 FileVault
Decryption <span style="color: #000000; font-weight: bold;">in</span> progress; use <span style="color: #000000; font-weight: bold;">`</span>diskutil coreStorage list<span style="color: #000000; font-weight: bold;">`</span> <span style="color: #000000; font-weight: bold;">for</span> status</pre></div></div>

<p>On va donc s&#8217;exécuter :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># diskutil coreStorage list</span>
CoreStorage logical volume <span style="color: #c20cb9; font-weight: bold;">groups</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1</span> found<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000; font-weight: bold;">|</span>
+-- Logical Volume Group 26B67367-CF79-4D1E-884C-BB96FDD79D19
    =========================================================
    Name:         FileVault
    Sequence:     <span style="color: #000000;">1</span>
    Free Space:   <span style="color: #000000;">0</span> B <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">0</span> B<span style="color: #7a0874; font-weight: bold;">&#41;</span>
    <span style="color: #000000; font-weight: bold;">|</span>
    +-<span style="color: #000000; font-weight: bold;">&lt;</span> Physical Volume A446F211-3BCB-47F4-8EB2-7174AF4CD408
     <span style="color: #000000; font-weight: bold;">|</span>   <span style="color: #660033;">----------------------------------------------------</span>
     <span style="color: #000000; font-weight: bold;">|</span>   Index:    <span style="color: #000000;">0</span>
     <span style="color: #000000; font-weight: bold;">|</span>   Disk:     disk4s2
     <span style="color: #000000; font-weight: bold;">|</span>   Status:   Online
     <span style="color: #000000; font-weight: bold;">|</span>   Size:     <span style="color: #000000;">9896046592</span> B <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">9.9</span> GB<span style="color: #7a0874; font-weight: bold;">&#41;</span>
     <span style="color: #000000; font-weight: bold;">|</span>
     +-<span style="color: #000000; font-weight: bold;">&gt;</span> Logical Volume Family 8D077574-ADC1-<span style="color: #000000;">4979</span>-9F1E-FF901FC20D86
        <span style="color: #660033;">----------------------------------------------------------</span>
        Sequence:               <span style="color: #000000;">11</span>
        Encryption Status:      Unlocked
        Encryption Type:        None
        Encryption Context:     Present
        Conversion Status:      Converting
        Has Encrypted Extents:  Yes
        Conversion Direction:   backward
        <span style="color: #000000; font-weight: bold;">|</span>
        +-<span style="color: #000000; font-weight: bold;">&gt;</span> Logical Volume BD2C5D29-633D-<span style="color: #000000;">4230</span>-AE94-BE1D2C48BC10
            <span style="color: #660033;">---------------------------------------------------</span>
            Disk:               disk5
            Status:             Online
            Sequence:           <span style="color: #000000;">4</span>
            Size <span style="color: #7a0874; font-weight: bold;">&#40;</span>Total<span style="color: #7a0874; font-weight: bold;">&#41;</span>:       <span style="color: #000000;">9577275392</span> B <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">9.6</span> GB<span style="color: #7a0874; font-weight: bold;">&#41;</span>
            Size <span style="color: #7a0874; font-weight: bold;">&#40;</span>Converted<span style="color: #7a0874; font-weight: bold;">&#41;</span>:   <span style="color: #000000;">62914560</span> B <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">62.9</span> MB<span style="color: #7a0874; font-weight: bold;">&#41;</span>
            Revertible:         Yes <span style="color: #7a0874; font-weight: bold;">&#40;</span>unlock and decryption required<span style="color: #7a0874; font-weight: bold;">&#41;</span>
            LV Name:            FileVault
            Volume Name:        FileVault
            Content Hint:       Apple_HFS</pre></div></div>

<p>&nbsp;</p>
<p>Nous voyons qu&#8217;effectivement le système est en train de convertir notre volume, il ne reste plus qu&#8217;à attendre la fin en vérifiant régulièrement l&#8217;état du système. À la fin, il ne doit rester plus aucun volume CoreStorage.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ diskutil coreStorage list
No CoreStorage logical volume <span style="color: #c20cb9; font-weight: bold;">groups</span> found</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.inig-services.com/archives/917/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

