Git Product home page Git Product logo

th3f0r3ign3r / dnssec Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 267 KB

Ce document est la transcription finale des effort effectues dans la realisation de rapport de fin de formation en Audit, Securite des Systemes et Reseaux Informatiques sur le theme Implementation d'une infrastructure a cle publique (PKI): cas du DNSSEC.

dns bind dnssec dns-server bind9 benindnsforum dnsforum benindns pki root tld resolver

dnssec's Introduction

Domain Name System Security Extension DNSSEC

Implementation du DNS Security Extension suivant la hierachie DNS

Ce document est la transcription finale des effort effectues dans la realisation de rapport de fin de formation en Audit, Securite des Systemes et Reseaux Informatiques sur le theme Implementation d'une infrastructure a cle publique (PKI): Cas du DNSSEC.

Systeme D'exploitation

Pour la realisation de ce Projet nous avons installer nos serveurs sur :

Les outils

Pour l'installation des serveurs nous avons utiliser BIND9.

Voici comment l'installer :

sudo apt install bind9 bind9-utils haveged

Architecture

Suivant la hierachie d'un syteme DNS nous avons mis en place 4 serveurs tels que :

  • Serveur Root 10.0.0.1
  • Serveur TLD 10.0.0.3
  • Resolveur Recursif 10.0.0.8
  • Serveur de Nom 10.0.0.5

Et pour finalier nous avons utiliser une machine client 10.0.0.10 pour faire les tests de resolutions de nom. L'architecture de l'implementation suis le schema suivant :

DNSSEC

Configuration

Nous allons passer a la configuration des serveurs.

Pour la mise en place de ce projet nous avons installer ces serveurs sur des machines virtuels sous VMWARE WORKSTATION sous linux Ubuntu 16.04 LTS.

Dans un premier temps nous allons configurer les serveurs differement et ensuite nous allons passer a la generation des cles public/prive et ensuite a la signature de zones.

Serveur Root .

1 - Modifier le fichier /etc/bind/named.conf.options :

Pour qu'il ressemble a ceci :

options {
	directory "/var/cache/bind";

	dnssec-validation no;
	//dnssec-enable yes;

	auth-nxdomain no;    # conform to RFC1035
	listen-on { any; };

};

2 - Modifier le fichier /etc/bind/named.conf.local :

//include "/etc/bind/zones.rfc1918";

zone "." {
	type master;
	file "/etc/bind/root.srv";
	allow-transfer { any; };
        allow-query { any; };
};

zone "0.0.10.in-addr.arpa" {
	type master;
	file "/etc/bind/root.srv.inv";
	allow-transfer { any; };
        allow-query { any; };
};

3 - Configuration des fichier de zone :

  • Creer le ficher root.srv
touch root.srv
  • Modifier le fichier et y inserer la configuration suivante :
;
; BIND data file for local loopback interface
;
$TTL	604800
@	IN	SOA	root. srvmaster.root. (
			      2		; Serial
			 604800		; Refresh
			  86400		; Retry
			2419200		; Expire
			 604800 )	; Negative Cache TTL
;
@	IN	NS	root.
root.	A	10.0.0.1
  • Creer le fichier root.srv.inv
touch root.srv.inv
  • modifier le fichier et y inserer la config suivante :
;
; BIND reverse data file for local loopback interface
;
$TTL	604800
@	IN	SOA	root. srvmaster.root. (
			      1		; Serial
			 604800		; Refresh
			  86400		; Retry
			2419200		; Expire
			 604800 )	; Negative Cache TTL
;
@	IN	NS	root.
1	IN	PTR	root.

4 - Commenter la zone root "." dans le fichier /etc/bind/named.conf.default-zones comme suit :

//zone "." {
//	type hint;
//	file "/etc/bind/db.root";
//};

5 - Fixer l'addresse IP sur la machime comme suit :

ens33 ici est mis pour designer mon interface Ethernet dans certains cas on trouveras eth0

auto ens33
iface ens33 inet static
	address 10.0.0.1
	netmask	255.255.255.0
	broadcast 10.0.0.255
	dns-nameserver 10.0.0.1

6 - Vider le fichier /etc/resolv.conf et y ajouter cette ligne :

nameserver 10.0.0.1

Serveur TLD .com

1 - Modifier le fichier /etc/bind/named.conf.options :

Pour qu'il ressemble a ceci :

options {
	directory "/var/cache/bind";

	dnssec-validation auto;
	dnssec-enable yes;

	auth-nxdomain no;    # conform to RFC1035
	listen-on { any; };

};

2 - Modifier le fichier /etc/bind/named.conf.local :

//include "/etc/bind/zones.rfc1918";

zone "com" {
	type master;
	file "/etc/bind/db.com";
	allow-transfer { any; };
        allow-query { any; };
};

zone "0.0.10.in-addr.arpa" {
	type master;
	file "/etc/bind/db.com.inv";
	allow-transfer { any; };
        allow-query { any; };
};

3 - Configuration des fichier de zone :

  • Creer le ficher db.com
touch db.com
  • Modifier le fichier et y inserer la configuration suivante :
;
; BIND data file for local loopback interface
;
$TTL	604800
@	IN	SOA	com. root.com. (
			      2		; Serial
			 604800		; Refresh
			  86400		; Retry
			2419200		; Expire
			 604800 )	; Negative Cache TTL
;
@	IN	NS	com.
com.	A	10.0.0.3
  • Creer le fichier db.com.inv
touch db.com.inv
  • modifier le fichier et y inserer la config suivante :
;
; BIND reverse data file for local loopback interface
;
$TTL	604800
@	IN	SOA	com. root.com. (
			      1		; Serial
			 604800		; Refresh
			  86400		; Retry
			2419200		; Expire
			 604800 )	; Negative Cache TTL
;
@	IN	NS	com.
3	IN	PTR	com.

4 - Dans le fichier /etc/bind/named.conf.default-zones assurer vous que le fichier que la zone root . n'est pas commenter ou effacer :

zone "." {
	type hint;
	file "/etc/bind/db.root";
};

Creer ou modifier le fichier db.root comme suit et :

;       This file holds the information on root name servers needed to
;       initialize cache of Internet domain name servers
;       (e.g. reference this file in the "cache  .  <file>"
;       configuration file of BIND domain name servers).
;
;       This file is made available by InterNIC
;       under anonymous FTP as
;           file                /domain/named.cache
;           on server           FTP.INTERNIC.NET
;       -OR-                    RS.INTERNIC.NET
;
;       last update:    February 17, 2016
;       related version of root zone:   2016021701
;
; formerly NS.INTERNIC.NET
;
.		3600000		IN	NS	root.
root.		3600000		A	10.0.0.1    
;
; End of file

5 - Fixer l'addresse IP sur la machime comme suit :

ens33 ici est mis pour designer mon interface Ethernet dans certains cas on trouveras eth0

auto ens33
iface ens33 inet static
	address 10.0.0.3
	netmask	255.255.255.0
	broadcast 10.0.0.255
	dns-nameserver 10.0.0.3

6 - Vider le fichier /etc/resolv.conf et y ajouter cette ligne :

nameserver 10.0.0.3

7 - Declaration du TLD .com

Dans le fichier de zone du serveur root root.srv sautez une ligne et ajoutez la config suivante :

$ORIGIN	com.
@	IN	NS	com.
com.	A	10.0.0.3

Serveur de nom example.com

1 - Modifier le fichier /etc/bind/named.conf.options :

Pour qu'il ressemble a ceci :

options {
	directory "/var/cache/bind";

	dnssec-validation auto;
	dnssec-enable yes;

	auth-nxdomain no;    # conform to RFC1035
	listen-on { any; };

};

2 - Modifier le fichier /etc/bind/named.conf.local :

//include "/etc/bind/zones.rfc1918";

zone "example.com" {
	type master;
	file "/etc/bind/example.com";
	allow-transfer { any; };
        allow-query { any; };
};

zone "0.0.10.in-addr.arpa" {
	type master;
	file "/etc/bind/example.com.inv";
	allow-transfer { any; };
        allow-query { any; };
};

3 - Configuration des fichier de zone :

  • Creer le ficher example.com
touch example.com
  • Modifier le fichier et y inserer la configuration suivante :
;
; BIND data file for local loopback interface
;
$TTL	604800
@	IN	SOA	example.com. root.example.com. (
			      2		; Serial
			 604800		; Refresh
			  86400		; Retry
			2419200		; Expire
			 604800 )	; Negative Cache TTL
;
@	IN	NS	example.com.
example.com.	A	10.0.0.5
  • Creer le fichier db.com.inv
touch example.com.inv
  • modifier le fichier et y inserer la config suivante :
;
; BIND reverse data file for local loopback interface
;
$TTL	604800
@	IN	SOA	example.com. root.example.com. (
			      1		; Serial
			 604800		; Refresh
			  86400		; Retry
			2419200		; Expire
			 604800 )	; Negative Cache TTL
;
@	IN	NS	example.com.
5	IN	PTR	example.com.

4 - Dans le fichier /etc/bind/named.conf.default-zones assurer vous que le fichier que la zone root . n'est pas commenter ou effacer :

zone "." {
	type hint;
	file "/etc/bind/db.root";
};

Creer ou modifier le fichier db.root comme suit et :

;       This file holds the information on root name servers needed to
;       initialize cache of Internet domain name servers
;       (e.g. reference this file in the "cache  .  <file>"
;       configuration file of BIND domain name servers).
;
;       This file is made available by InterNIC
;       under anonymous FTP as
;           file                /domain/named.cache
;           on server           FTP.INTERNIC.NET
;       -OR-                    RS.INTERNIC.NET
;
;       last update:    February 17, 2016
;       related version of root zone:   2016021701
;
; formerly NS.INTERNIC.NET
;
.		3600000		IN	NS	root.
root.		3600000		A	10.0.0.1    
;
; End of file

5 - Fixer l'addresse IP sur la machime comme suit :

ens33 ici est mis pour designer mon interface Ethernet dans certains cas on trouveras eth0

auto ens33
iface ens33 inet static
	address 10.0.0.5
	netmask	255.255.255.0
	broadcast 10.0.0.255
	dns-nameserver 10.0.0.5

6 - Vider le fichier /etc/resolv.conf et y ajouter cette ligne :

nameserver 10.0.0.5

7 - Declaration du domaine example.com

Dans le fichier de zone du serveur TLD db.com sautez une ligne et ajoutez la config suivante :

$ORIGIN	example.com.
@	IN	NS	example.com.
example.com.	A	10.0.0.5

Serveur Recursif

1 - Modifier le fichier /etc/bind/named.conf :

Vider le contenu du fichier afin qu'il ressemble a ceci :

options {
	directory "/var/cache/bind";

	auth-nxdomain no;    # conform to RFC1035
	listen-on { any; };
	dnssec-validation auto;
	dnssec-enable yes;
	//dnssec-must-be-secure root yes;
};

zone "." {
	type hint;
	file "/etc/bind/db.root";
};

2 - Creer ou modifier le fichier db.root comme suit et :

;       This file holds the information on root name servers needed to
;       initialize cache of Internet domain name servers
;       (e.g. reference this file in the "cache  .  <file>"
;       configuration file of BIND domain name servers).
;
;       This file is made available by InterNIC
;       under anonymous FTP as
;           file                /domain/named.cache
;           on server           FTP.INTERNIC.NET
;       -OR-                    RS.INTERNIC.NET
;
;       last update:    February 17, 2016
;       related version of root zone:   2016021701
;
; formerly NS.INTERNIC.NET
;
.		3600000		IN	NS	root.
root.		3600000		A	10.0.0.1    
;
; End of file

3 - Fixer l'addresse IP sur la machime comme suit :

ens33 ici est mis pour designer mon interface Ethernet dans certains cas on trouveras eth0

auto ens33
iface ens33 inet static
	address 10.0.0.8
	netmask	255.255.255.0
	broadcast 10.0.0.255

4 - Vider le fichier /etc/resolv.conf afin qu'il ne contienne aucun enregistrement, car cela permettra de rediriger toutes les requetes vers le serveur BIND.

Redemarrez les services BIND

Sur chacun des serveurs que nous avons configurer nous devons redemmarrer les services DNS en executant la commande suivante :

rndc flush && /etc/init.d/bind9 restart

Generation des cles et Signature de zone

Comming Soon

dnssec's People

Contributors

th3f0r3ign3r avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.