Formal Verification of the Internet Key Exchange (Ikev2) Security Protocol Tristan Ninet
Total Page:16
File Type:pdf, Size:1020Kb
Formal verification of the Internet Key Exchange (IKEv2) security protocol Tristan Ninet To cite this version: Tristan Ninet. Formal verification of the Internet Key Exchange (IKEv2) security protocol. Cryptogra- phy and Security [cs.CR]. Université Rennes 1, 2020. English. NNT : 2020REN1S002. tel-02882167 HAL Id: tel-02882167 https://tel.archives-ouvertes.fr/tel-02882167 Submitted on 26 Jun 2020 HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. Thèse de doctorat de L’UNIVERSITÉ DE RENNES 1 École Doctorale No 601 Mathématiques et Sciences et Technologies de l’Information et de la Communication Spécialité : Informatique Par Tristan NINET Formal verification of the Internet Key Exchange (IKEv2) security protocol Thèse présentée et soutenue à Rennes, le 9 mars 2020 Unité de recherche : Inria Rapporteurs avant soutenance : Caroline FONTAINE Directrice de Recherche, CNRS, LSV / ENS Paris-Saclay Steve KREMER Directeur de Recherche, Inria, LORIA Nancy Composition du Jury : Président : Steve KREMER Directeur de Recherche, Inria, LORIA Nancy Examinateurs : Pierre-Etienne MOREAU Professeur, Université de Lorraine, École des Mines de Nancy Thomas GENET Maître de conférence, Université de Rennes 1 Dir. de thèse : Stéphanie DELAUNE Directrice de Recherche, CNRS, IRISA Rennes Co-dir. de thèse : Olivier ZENDRA Chargé de Recherche, Inria Rennes Invité(s) : Romaric MAILLARD Architecte Equipements, Thales SIX GTS France Acknowledgment Je tiens à remercier Olivier, pour m’avoir accompagné du (presque) début à la fin, et en particulier pour avoir toujours su trouver les mots pour me rassurer et me remotiver. J’adresse également toute ma gratitude à Stéphanie, pour avoir accepté de reprendre ma thèse, et sans qui la qualité des travaux accomplis ne serait pas ce qu’elle est. Je remercie bien sûr Romaric et Frédéric pour m’avoir accueilli au sein de Thalès. Merci à toi Romaric, pour ton investissement et pour toutes ces discussions qui m’ont tant ap- pris. Merci Frédéric, pour m’avoir fait confiance et pour m’avoir laissé toute la liberté de travailler sur ma thèse. J’adresse également ma reconnaissance aux rapporteurs, Caroline Fontaine et Steve Kre- mer, pour avoir pris le temps de lire et corriger le manuscrit, et plus largement aux membres du jury, dont Pierre-Etienne Moreau et Thomas Genet, pour l’intérêt que vous avez porté à mes travaux. Je remercie du fond du cœur toute l’équipe TAMIS. Tous nos moments passés ensemble ont été à la fois passionnants et réconfortants. Tout cela m’a été indispensable. Je remercie enfin ma famille et mes amis pour leur soutien sans faille, et plus particuliè- rement Tita, pour avoir traversé la France en train, malgré la montée du COVID-19 en France, afin d’assister à la soutenance de ton petit-fils. 3 Résumé Cette thèse se situe au croisement de deux domaines de l’informatique. Le premier domaine est celui de l’architecture réseaux IPsec et son protocole d’échange de clés IKEv2, et le second domaine est la vérification formelle de protocoles de sécurité. Cette thèse viseà appliquer à IKEv2 les dernières avancées en vérification formelle. Dans ce résumé, nous présentons d’abord le contexte de cette thèse, puis nous intro- duisons le lecteur aux protocoles de sécurité et à leurs potentielles attaques, puis nous abordons la vérification formelle de protocoles de sécurité, et enfin nous présentons nos contributions. Contexte Les protocoles de sécurité sont des protocoles de communication dont l’un des objectifs est de garantir des propriétés de sécurité à des agents. Auparavant, ces protocoles étaient principalement utilisés par les armées afin d’échanger des informations sans que l’ennemi ne puisse les intercepter. Aujourd’hui les protocoles de sécurité sont sortis du seul contexte militaire et sont devenus omniprésents. Le protocole TLS [27] est probablement l’un des protocoles de sécurité les plus im- portants. TLS est le protocole utilisé pour sécuriser le protocole HTTP, ce qui est alors indiqué par le préfixe « https:// » dans les URLs. Grâce à TLS, il est notamment pos- sible d’effectuer des achats en ligne, d’accéder à un réseau social, ou encore de consulter son compte bancaire, et ce de manière sécurisée, c’est-à-dire sans qu’un attaquant puisse écouter nos conversations ou apprendre notre numéro de carte bancaire et nos mots de passe. Un autre exemple de protocole de sécurité utilisé au quotidien est le protocole Wi-Fi [40]. Ce protocole permet d’accéder à un réseau local sans utiliser de câble, en utilisant des ondes électromagnétiques comme moyen de communication. Or par nature, les ondes électromagnétiques peuvent être interceptées par toute machine se situant suffisamment proche de la machine émettrice. Il est donc nécessaire que le protocole Wi-Fi garantisse la confidentialité et l’authenticité des données échangées. Pour cela, le protocole effectue 5 des opérations cryptographiques telles que le chiffrement. Nous avons vu que les protocoles de sécurité jouent un rôle essentiel dans la sécurité de nos infrastructures modernes. Pourtant, de nombreuses failles ont été découvertes dans ces protocoles, même des années après leur mise en place. Par example, un attaquant possédant la clé secrète (clé WPA) d’un point d’accès Wi-Fi (le routeur Wi-Fi) peut aujourd’hui déchiffrer les communications de toutes les autres machines qui communiquent avec le routeur. Pour cela l’attaquant écoute les signaux Wi-Fi, intercepte l’échange de clés qui s’effectue à l’établissement d’une connection, puis déduit de cet échange la clé quisera utilisée pour chiffrer la connection (la « clé de session »). La méthode est décrite dans [89] par exemple. Le fait que l’attaquant puisse déduire aussi aisément la clé de session provient d’une faille logique dans la conception du protocole Wi-Fi. Dans cette thèse, nous nous concentrons sur le cas des réseaux privés virtuels (ou VPN, pour Virtual Private Network). Un VPN permet à plusieurs machines distantes de communiquer à travers Internet comme s’ils se situaient dans le même réseau local. Les VPNs sont par exemple utilisés par les entreprises pour relier leur site de travail, ou pour permettre à leurs employés d’accéder à leur réseau privé depuis n’importe quel endroit. Les VPNs sont également utilisés par les armées pour sécuriser les connexions entre les sites militaires, ou encore par les citoyens de certains pays pour échapper à la censure. L’une des architectures (i.e. ensemble de protocoles) utilisées pour créer des VPNs est Internet Protocol Security (IPsec) [76]. Or, préalablement à la mise en place d’un VPN IPsec entre deux machines distantes, il est nécessaire que le deux machines établissent entre elles une clé secrète (i.e. connue seulement des ces deux machines) qui servira à chiffrer et à authentifier leurs communications. Le protocole chargé de générer cetteclé secrète pour IPsec est Internet Key Exchange version 2 (IKEv2) [46]. La sécurité d’un VPN repose donc sur la sécurité de IKEv2. Il est alors crucial que la sécurité de IKEv2 soit assurée. Dans cette thèse, nous utilisons des techniques modernes de verification formelle pour tenter de répondre à cet enjeu. Protocoles et attaques Regardons maintenant de plus près à quoi ressemble un protocole de sécurité. Ces proto- coles sont des programmes qui manipulent des primitives cryptographiques afin de per- mettre à deux machines distantes de communiquer de manière sécurisée. Les attaques qui ne cassent pas les primitives cryptographiques mais exploitent un assemblage incorrect de 6 ces dernières sont appelées attaques logiques. Jusque dans les années 1970, la seule primitive existante était le chiffrement symé- trique. En chiffrement symétrique, la même clé est utilisée pour le chiffrement etpour le déchiffrement. Utilisée seule, cette méthode de chiffrement présente le problème que chaque machine doit garder en mémoire une clé pour chaque autre machine avec laquelle elle soit communiquer. Cela devient difficile à gérer lorsque le nombre de machines croît. Les travaux de Diffie et Hellman publiés en 1976 [28] marquent un tournant dansla cryptographie en introduisant la cryptographie asymétrique. Dans cette méthode, chaque machine possède une clé privée et une clé publique. La clé publique est connue de tout le monde, tandis que la clé privée n’est connue que de son propriétaire. Pour communiquer avec une machine, on chiffre notre message avec la clé publique de cette machine, et l’algorithme de chiffrement assure que seul le détenteur de la clé privée associée peut déchiffrer le message. L’avantage de cette méthode est que chaque machine ne doitgarder en mémoire que sa clé privée et sa clé publique. Avant chaque communication, les machines communiquent alors leur clé publique à quiconque veut communiquer avec elles. Notons qu’il existe bien d’autres primitives cryptographiques. Par exemple, la signa- ture numérique permet à une machine d’authentifier un message à l’aide de sa clé privée. La vérification se fait avec la clé publique. Le Message Authentication Code (MAC)rem- plit la même fonction que la signature numérique, mais la même clé est utilisée pour la génération du MAC et pour sa vérification. De manière informelle, un protocole est un ensemble de rôles qui effectuent des actions. Les rôles sont appelés « initiateur », « répondeur », « client », « serveur », etc. Les actions sont du type : générer un nombre aléatoire, appliquer une primitive cryptographique, envoyer un message, ou encore recevoir un message. De plus il est courant de diviser les messages en entités logiques appelés payloads, et de diviser les payloads en champs.