Modifications de la template FERM et de l'index
parent
4055e8bb1a
commit
0a968217eb
|
@ -27,7 +27,7 @@ charge de former leur successeurs.
|
|||
4. [Cluster](proxmox/cluster)
|
||||
5. [Haute Disponibilitée](#)
|
||||
6. [Gestion de l'authentification](#)
|
||||
7. [Sécurisation des container / VM](proxmox/securisation)
|
||||
7. [Sécurisation des conteneurs / VM](proxmox/securisation)
|
||||
3. [Réseau](reseau)
|
||||
1. [Introduction à OpenvSwitch](reseau/introduction_ovs.md)
|
||||
2. [Topologie globale du réseau](reseau/topologie_globale.md)
|
||||
|
|
|
@ -1,11 +1,34 @@
|
|||
@def $IF_ADMIN = eth3;
|
||||
@def $IF_FRONT = eth0;
|
||||
@def $IF_BACK = (eth1 eth2);
|
||||
@def $OPEN_PORT_FRONT = (22 53);
|
||||
@def $PROTO_FRONT = (tcp udp);
|
||||
@def $OPEN_PORT_BACK = (22 53);
|
||||
@def $PROTO_BACK = (tcp udp);
|
||||
@def $HAVE_BACK = 1; #0 pour NON 1 pour OUI
|
||||
|
||||
|
||||
# REQUEST : EXT -> INT | ACCESS : INT -> EXT
|
||||
|
||||
|
||||
# Depuis l'extérieur sur l'interface principale
|
||||
@def $OPEN_PORT_FRONT_REQUEST = (53);
|
||||
@def $NEED_UDP_FRONT_REQUEST = 1; #0 pour NON 1 pour OUI
|
||||
@def $UDP_OPEN_PORT_FRONT_REQUEST = (53);
|
||||
|
||||
# Depuis l'intérieur sur l'interface principale
|
||||
@def $OPEN_PORT_FRONT_ACCESS = ();
|
||||
@def $NEED_UDP_FRONT_ACCESS = 0; #0 pour NON 1 pour OUI
|
||||
@def $UDP_OPEN_PORT_FRONT_ACCESS = ();
|
||||
|
||||
|
||||
# Depuis l'extérieur sur les interfaces secondaires
|
||||
@def $HAVE_BACK_REQUEST = 1; #0 pour NON 1 pour OUI
|
||||
@def $OPEN_PORT_BACK_REQUEST = (53);
|
||||
@def $NEED_UDP_BACK_REQUEST = 1; #0 pour NON 1 pour OUI
|
||||
@def $UDP_OPEN_PORT_BACK_REQUEST = (53);
|
||||
|
||||
# Depuis l'intérieur sur les interfaces secondaires
|
||||
@def $HAVE_BACK_ACCESS = 0; #0 pour NON 1 pour OUI
|
||||
@def $OPEN_PORT_BACK_ACCESS = ();
|
||||
@def $NEED_UDP_BACK_ACCESS = 0; #0 pour NON 1 pour OUI
|
||||
@def $UDP_OPEN_PORT_BACK_ACCESS = ();
|
||||
|
||||
|
||||
table filter {
|
||||
chain INPUT {
|
||||
|
@ -14,16 +37,50 @@ table filter {
|
|||
mod state state (ESTABLISHED RELATED) ACCEPT;
|
||||
interface lo ACCEPT;
|
||||
interface $IF_ADMIN ACCEPT;
|
||||
interface $IF_FRONT proto $PROTO_FRONT dport $OPEN_PORT_FRONT ACCEPT;
|
||||
|
||||
@if $HAVE_BACK {
|
||||
interface $IF_BACK proto $PROTO_BACK dport $OPEN_PORT_BACK ACCEPT;
|
||||
|
||||
interface $IF_FRONT proto tcp dport $OPEN_PORT_FRONT_REQUEST ACCEPT;
|
||||
|
||||
@if $NEED_UDP_FRONT_REQUEST {
|
||||
interface $IF_FRONT proto udp dport $UDP_OPEN_PORT_FRONT_REQUEST ACCEPT;
|
||||
}
|
||||
|
||||
|
||||
@if $HAVE_BACK_REQUEST {
|
||||
interface $IF_BACK proto tcp dport $OPEN_PORT_BACK_REQUEST ACCEPT;
|
||||
}
|
||||
|
||||
@if $NEED_UDP_BACK_REQUEST {
|
||||
interface $IF_BACK proto udp dport $UDP_OPEN_PORT_BACK_REQUEST ACCEPT;
|
||||
}
|
||||
|
||||
|
||||
proto icmp icmp-type echo-request ACCEPT;
|
||||
}
|
||||
|
||||
chain OUTPUT policy ACCEPT;
|
||||
chain OUTPUT {
|
||||
policy DROP;
|
||||
mod state state INVALID DROP;
|
||||
mod state state (ESTABLISHED RELATED) ACCEPT;
|
||||
outerface lo ACCEPT;
|
||||
|
||||
|
||||
outerface $IF_FRONT proto tcp dport $OPEN_PORT_FRONT_ACCESS ACCEPT;
|
||||
|
||||
@if $NEED_UDP_FRONT_ACCESS {
|
||||
outerface $IF_BACK proto udp dport $UDP_OPEN_PORT_FRONT_ACCESS ACCEPT;
|
||||
}
|
||||
|
||||
@if $HAVE_BACK_ACCESS {
|
||||
outerface $IF_BACK proto tcp dport $OPEN_PORT_BACK_ACCESS ACCEPT;
|
||||
}
|
||||
|
||||
@if $NEED_UDP_BACK_ACCESS {
|
||||
outerface $IF_BACK proto udp dport $UDP_OPEN_PORT_BACK_ACCESS ACCEPT;
|
||||
}
|
||||
|
||||
proto icmp ACCEPT;
|
||||
}
|
||||
|
||||
chain FORWARD policy DROP;
|
||||
}
|
||||
|
|
|
@ -1,11 +1,34 @@
|
|||
@def $IF_ADMIN = eth3;
|
||||
@def $IF_FRONT = eth0;
|
||||
@def $IF_BACK = (eth1 eth2);
|
||||
@def $OPEN_PORT_FRONT = (22 80 443);
|
||||
@def $PROTO_FRONT = (tcp);
|
||||
@def $OPEN_PORT_BACK = (22 80);
|
||||
@def $PROTO_BACK = (tcp);
|
||||
@def $HAVE_BACK = 1; #0 pour NON 1 pour OUI
|
||||
|
||||
|
||||
# REQUEST : EXT -> INT | ACCESS : INT -> EXT
|
||||
|
||||
|
||||
# Depuis l'extérieur sur l'interface principale
|
||||
@def $OPEN_PORT_FRONT_REQUEST = (80 443);
|
||||
@def $NEED_UDP_FRONT_REQUEST = 0; #0 pour NON 1 pour OUI
|
||||
@def $UDP_OPEN_PORT_FRONT_REQUEST = ();
|
||||
|
||||
# Depuis l'intérieur sur l'interface principale
|
||||
@def $OPEN_PORT_FRONT_ACCESS = (80);
|
||||
@def $NEED_UDP_FRONT_ACCESS = 0; #0 pour NON 1 pour OUI
|
||||
@def $UDP_OPEN_PORT_FRONT_ACCESS = (53);
|
||||
|
||||
|
||||
# Depuis l'extérieur sur les interfaces secondaires
|
||||
@def $HAVE_BACK_REQUEST = 1; #0 pour NON 1 pour OUI
|
||||
@def $OPEN_PORT_BACK_REQUEST = (22);
|
||||
@def $NEED_UDP_BACK_REQUEST = 0; #0 pour NON 1 pour OUI
|
||||
@def $UDP_OPEN_PORT_BACK_REQUEST = ();
|
||||
|
||||
# Depuis l'intérieur sur les interfaces secondaires
|
||||
@def $HAVE_BACK_ACCESS = 1; #0 pour NON 1 pour OUI
|
||||
@def $OPEN_PORT_BACK_ACCESS = (80 53 22);
|
||||
@def $NEED_UDP_BACK_ACCESS = 1; #0 pour NON 1 pour OUI
|
||||
@def $UDP_OPEN_PORT_BACK_ACCESS = (53);
|
||||
|
||||
|
||||
table filter {
|
||||
chain INPUT {
|
||||
|
@ -14,16 +37,50 @@ table filter {
|
|||
mod state state (ESTABLISHED RELATED) ACCEPT;
|
||||
interface lo ACCEPT;
|
||||
interface $IF_ADMIN ACCEPT;
|
||||
interface $IF_FRONT proto $PROTO_FRONT dport $OPEN_PORT_FRONT ACCEPT;
|
||||
|
||||
@if $HAVE_BACK {
|
||||
interface $IF_BACK proto $PROTO_BACK dport $OPEN_PORT_BACK ACCEPT;
|
||||
|
||||
interface $IF_FRONT proto tcp dport $OPEN_PORT_FRONT_REQUEST ACCEPT;
|
||||
|
||||
@if $NEED_UDP_FRONT_REQUEST {
|
||||
interface $IF_FRONT proto udp dport $UDP_OPEN_PORT_FRONT_REQUEST ACCEPT;
|
||||
}
|
||||
|
||||
|
||||
@if $HAVE_BACK_REQUEST {
|
||||
interface $IF_BACK proto tcp dport $OPEN_PORT_BACK_REQUEST ACCEPT;
|
||||
}
|
||||
|
||||
@if $NEED_UDP_BACK_REQUEST {
|
||||
interface $IF_BACK proto udp dport $UDP_OPEN_PORT_BACK_REQUEST ACCEPT;
|
||||
}
|
||||
|
||||
|
||||
proto icmp icmp-type echo-request ACCEPT;
|
||||
}
|
||||
|
||||
chain OUTPUT policy ACCEPT;
|
||||
chain OUTPUT {
|
||||
policy DROP;
|
||||
mod state state INVALID DROP;
|
||||
mod state state (ESTABLISHED RELATED) ACCEPT;
|
||||
outerface lo ACCEPT;
|
||||
|
||||
|
||||
outerface $IF_FRONT proto tcp dport $OPEN_PORT_FRONT_ACCESS ACCEPT;
|
||||
|
||||
@if $NEED_UDP_FRONT_ACCESS {
|
||||
outerface $IF_BACK proto udp dport $UDP_OPEN_PORT_FRONT_ACCESS ACCEPT;
|
||||
}
|
||||
|
||||
@if $HAVE_BACK_ACCESS {
|
||||
outerface $IF_BACK proto tcp dport $OPEN_PORT_BACK_ACCESS ACCEPT;
|
||||
}
|
||||
|
||||
@if $NEED_UDP_BACK_ACCESS {
|
||||
outerface $IF_BACK proto udp dport $UDP_OPEN_PORT_BACK_ACCESS ACCEPT;
|
||||
}
|
||||
|
||||
proto icmp ACCEPT;
|
||||
}
|
||||
|
||||
chain FORWARD policy DROP;
|
||||
}
|
||||
|
|
|
@ -8,4 +8,4 @@ Vous trouverez ici toute la documentation relative au déploiement de Proxmox.
|
|||
4. [Cluster](cluster)
|
||||
5. [Haute Disponibilité](#)
|
||||
6. [Gestion de l'authentification](#)
|
||||
7. [Sécurisation des container / VM](securisation)
|
||||
7. [Sécurisation des conteneurs / VM](securisation)
|
||||
|
|
|
@ -4,33 +4,74 @@ L'installation et la configuration de ferm est faite par tout les playbook Ansib
|
|||
|
||||
Si vous n'utilisez pas ces playbook voilà la marche à suivre.
|
||||
|
||||
Nous allons ici faire une template pour la sécurisation des conteneurs avec ferm.
|
||||
Nous présentons ici une template pour la sécurisation des conteneurs avec ferm.
|
||||
|
||||
Tout les conteneurs et toutes les VM auront un firewall dédié (ferm) qui filtrera en INPUT autorisera tout en OUTPUT et bloquera tout en FORWARDING
|
||||
Tout les conteneurs et toutes les VM auront un firewall dédié (ferm) qui filtrera en INPUT / OUTPUT et bloquera tout en FORWARDING
|
||||
|
||||
Voici comment le filtrage ce fera en INPUT :
|
||||
- Tout autoriser sur l'interface admin.
|
||||
- Autoriser que ce qui est nécessaire sur les autres interfaces (la même chose sur toute).
|
||||
- Autoriser que ce qui est nécessaire sur l'interface principale.
|
||||
- Autoriser que ce qui est nécessaire sur les interfaces secondaires avec la possibilité de rien ouvrir.
|
||||
- Option port UDP dans les deux cas.
|
||||
|
||||
Voici comment le filtrage ce fera en OUTPUT :
|
||||
- Tout bloquer, sauf les connexions établies, sur l'interface admin.
|
||||
- Autoriser que ce qui est nécessaire sur l'interface principale.
|
||||
- Autoriser que ce qui est nécessaire sur les interfaces secondaires avec la possibilité de rien ouvrir.
|
||||
- Option port UDP dans les deux cas.
|
||||
|
||||
La template utilise des paramètres pour éviter d'avoir à modifier la configuration. Il vous suffit d'adapter les paramètres suivant en fonction de la configuration souhaité.
|
||||
|
||||
- IF_FRONT : Point d'entrée principal sur le conteneur
|
||||
- IF_BACK : Point de sortie sur le conteneur
|
||||
- PROTO_FRONT : Les protocoles à autorisé sur les ports frontaux ouvert (utile pour le udp du DNS).
|
||||
- PROTO_BACK : Même chose sur les interfaces de sortie
|
||||
- HAVE_BACK : Mettre à un si il y a une ou plusieurs interfaces de sortie, à zéro sinon.
|
||||
#### Interfaces
|
||||
- IF_ADMIN : Nom de l'interface d'administration
|
||||
- IF_FRONT : Nom du point d'entrée principal sur le conteneur
|
||||
- IF_BACK : Liste des interfaces secondaire, ne doit inclure ni l'interface administration ni les interfaces qui n'ont pas besoin de règles autre que DROP.
|
||||
|
||||
Dans le cas du DNS IF_FRONT est son interface sur la zone DMZ et IF_BACK est son interface sur la zone PROXY et son interface sur la zone INT.
|
||||
#### Ports TCP ouverts
|
||||
HAVE_BACK_ACCESS : Doit accéder à des conteneurs qui sont sur des interfaces secondaires
|
||||
HAVE_BACK_REQUEST : Doit être accessible depuis des conteneurs qui sont sur des interfaces secondaires
|
||||
OPEN_PORT_FRONT : Liste des ports TCP à ouvrir en entrée sur l'interface principale
|
||||
OPEN_PORT_BACK_REQUEST : Liste des ports TCP à ouvrir en entrée sur les interfaces secondaires
|
||||
OPEN_PORT_BACK_ACCESS : Liste des ports TCP à ouvrir en sortie sur les interfaces secondaires
|
||||
|
||||
#### Ports UDP ouverts
|
||||
NEED_UDP_* : 0 si pas besoin d'ouvrir un port UDP 1 sinon
|
||||
UDP_OPEN_PORT_FRONT : Liste des ports UDP à ouvrir en entrée sur l'interface principale
|
||||
UDP_OPEN_PORT_BACK_ACCESS : Liste des ports UDP à ouvrir en sortie sur les interfaces secondaires
|
||||
UDP_OPEN_PORT_BACK_REQUEST : Liste des ports UDP à ouvrir en entrée sur les interfaces secondaires
|
||||
|
||||
Les règles restrictives en sortie permettent d'éviter qu'un attaquant puisse accéder à tout le rester du réseau.
|
||||
|
||||
```
|
||||
@def $IF_ADMIN = ;
|
||||
@def $IF_FRONT = ;
|
||||
@def $IF_BACK = ();
|
||||
@def $OPEN_PORT_FRONT = (22);
|
||||
@def $PROTO_FRONT = (tcp);
|
||||
@def $OPEN_PORT_BACK = (22);
|
||||
@def $PROTO_BACK = (tcp);
|
||||
@def $HAVE_BACK = 0; #0 pour NON 1 pour OUI
|
||||
|
||||
# REQUEST : EXT -> INT | ACCESS : INT -> EXT
|
||||
|
||||
# Depuis l'extérieur sur l'interface principale
|
||||
@def $OPEN_PORT_FRONT_REQUEST = ();
|
||||
@def $NEED_UDP_FRONT_REQUEST = 0; #0 pour NON 1 pour OUI
|
||||
@def $UDP_OPEN_PORT_FRONT_REQUEST = ();
|
||||
|
||||
# Depuis l'intérieur sur l'interface principale
|
||||
@def $OPEN_PORT_FRONT_ACCESS = ();
|
||||
@def $NEED_UDP_FRONT_ACCESS = 0; #0 pour NON 1 pour OUI
|
||||
@def $UDP_OPEN_PORT_FRONT_ACCESS = ();
|
||||
|
||||
|
||||
# Depuis l'extérieur sur les interfaces secondaires
|
||||
@def $HAVE_BACK_REQUEST = 0; #0 pour NON 1 pour OUI
|
||||
@def $OPEN_PORT_BACK_REQUEST = ();
|
||||
@def $NEED_UDP_BACK_REQUEST = 0; #0 pour NON 1 pour OUI
|
||||
@def $UDP_OPEN_PORT_BACK_REQUEST = ();
|
||||
|
||||
# Depuis l'intérieur sur les interfaces secondaires
|
||||
@def $HAVE_BACK_ACCESS = 1; #0 pour NON 1 pour OUI
|
||||
@def $OPEN_PORT_BACK_ACCESS = (53);
|
||||
@def $NEED_UDP_BACK_ACCESS = 1; #0 pour NON 1 pour OUI
|
||||
@def $UDP_OPEN_PORT_BACK_ACCESS = (53);
|
||||
|
||||
|
||||
table filter {
|
||||
chain INPUT {
|
||||
|
@ -39,16 +80,50 @@ table filter {
|
|||
mod state state (ESTABLISHED RELATED) ACCEPT;
|
||||
interface lo ACCEPT;
|
||||
interface $IF_ADMIN ACCEPT;
|
||||
interface $IF_FRONT proto $PROTO_FRONT dport $OPEN_PORT_FRONT ACCEPT;
|
||||
|
||||
@if $HAVE_BACK {
|
||||
interface $IF_BACK proto $PROTO_BACK dport $OPEN_PORT_BACK ACCEPT;
|
||||
|
||||
interface $IF_FRONT proto tcp dport $OPEN_PORT_FRONT_REQUEST ACCEPT;
|
||||
|
||||
@if $NEED_UDP_FRONT_REQUEST {
|
||||
interface $IF_FRONT proto udp dport $UDP_OPEN_PORT_FRONT_REQUEST ACCEPT;
|
||||
}
|
||||
|
||||
|
||||
@if $HAVE_BACK_REQUEST {
|
||||
interface $IF_BACK proto tcp dport $OPEN_PORT_BACK_REQUEST ACCEPT;
|
||||
}
|
||||
|
||||
@if $NEED_UDP_BACK_REQUEST {
|
||||
interface $IF_BACK proto udp dport $UDP_OPEN_PORT_BACK_REQUEST ACCEPT;
|
||||
}
|
||||
|
||||
|
||||
proto icmp icmp-type echo-request ACCEPT;
|
||||
}
|
||||
|
||||
chain OUTPUT policy ACCEPT;
|
||||
chain OUTPUT {
|
||||
policy DROP;
|
||||
mod state state INVALID DROP;
|
||||
mod state state (ESTABLISHED RELATED) ACCEPT;
|
||||
outerface lo ACCEPT;
|
||||
|
||||
|
||||
outerface $IF_FRONT proto tcp dport $OPEN_PORT_FRONT_ACCESS ACCEPT;
|
||||
|
||||
@if $NEED_UDP_FRONT_ACCESS {
|
||||
outerface $IF_BACK proto udp dport $UDP_OPEN_PORT_FRONT_ACCESS ACCEPT;
|
||||
}
|
||||
|
||||
@if $HAVE_BACK_ACCESS {
|
||||
outerface $IF_BACK proto tcp dport $OPEN_PORT_BACK_ACCESS ACCEPT;
|
||||
}
|
||||
|
||||
@if $NEED_UDP_BACK_ACCESS {
|
||||
outerface $IF_BACK proto udp dport $UDP_OPEN_PORT_BACK_ACCESS ACCEPT;
|
||||
}
|
||||
|
||||
proto icmp ACCEPT;
|
||||
}
|
||||
|
||||
chain FORWARD policy DROP;
|
||||
}
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
# Réseau
|
||||
Vous trouverez ici toute la documentation relative à l'infrastructure réseau.
|
||||
|
||||
# Schéma simplifié
|
||||
|
||||

|
||||
|
||||
# Table des matières
|
||||
1. [Introduction à OpenvSwitch](introduction_ovs.md)
|
||||
2. [Topologie globale du réseau](topologie_globale.md)
|
||||
|
|
|
@ -11,7 +11,7 @@ Les IP seront de la forme `10.1.0.ID_PROXMOX` ou l'ID Proxmox est le numéro du
|
|||
|
||||
## Le reste
|
||||
|
||||
Pour les autres interfaces chosissez une adresse cohérente vis à vis des adresses déjà allouées, la liste est disponible [ici](/reseau/mise_en_place.md).
|
||||
Pour les autres interfaces chosissez une adresse cohérente vis à vis des adresses déjà allouées, la liste est disponible [ici](mise_en_place.md).
|
||||
|
||||
Les IP sont organisé avec la logique suivante :
|
||||
- Plus le service est important plus sont numéro est petit,
|
||||
|
|
Loading…
Reference in New Issue