Modifications des fichiers de configuration FERM
parent
0a968217eb
commit
c7e85c95d5
|
@ -102,6 +102,10 @@
|
||||||
|
|
||||||
- hosts: zonedmz
|
- hosts: zonedmz
|
||||||
tasks:
|
tasks:
|
||||||
|
- name: Set timezone for DMZ
|
||||||
|
timezone:
|
||||||
|
name: Europe/Paris
|
||||||
|
|
||||||
- name: Apt Update for DMZ
|
- name: Apt Update for DMZ
|
||||||
apt:
|
apt:
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
|
@ -233,7 +237,7 @@
|
||||||
with_items:
|
with_items:
|
||||||
- 'bind9'
|
- 'bind9'
|
||||||
|
|
||||||
- name: Prepare NGINX for HAProxy
|
- name: Prepare NGINX for Bind9
|
||||||
file:
|
file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
@ -261,7 +265,7 @@
|
||||||
- '/var/log/dns/query.log'
|
- '/var/log/dns/query.log'
|
||||||
- '/var/log/dns/error.log'
|
- '/var/log/dns/error.log'
|
||||||
|
|
||||||
- name: Copy ferm configuration for HAProxy
|
- name: Copy ferm configuration for Bind9
|
||||||
copy:
|
copy:
|
||||||
src: /root/src/ferm/dns_ferm.conf
|
src: /root/src/ferm/dns_ferm.conf
|
||||||
dest: /etc/ferm/ferm.conf
|
dest: /etc/ferm/ferm.conf
|
||||||
|
@ -269,7 +273,7 @@
|
||||||
group: root
|
group: root
|
||||||
mode: '0640'
|
mode: '0640'
|
||||||
|
|
||||||
- name: Restart ferm for HAProxy
|
- name: Restart ferm for Bind9
|
||||||
systemd:
|
systemd:
|
||||||
name: "ferm"
|
name: "ferm"
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
|
@ -7,11 +7,13 @@
|
||||||
|
|
||||||
|
|
||||||
# Depuis l'extérieur sur l'interface principale
|
# Depuis l'extérieur sur l'interface principale
|
||||||
|
@def $HAVE_FRONT_REQUEST = 1; #0 pour NON 1 pour OUI
|
||||||
@def $OPEN_PORT_FRONT_REQUEST = (53);
|
@def $OPEN_PORT_FRONT_REQUEST = (53);
|
||||||
@def $NEED_UDP_FRONT_REQUEST = 1; #0 pour NON 1 pour OUI
|
@def $NEED_UDP_FRONT_REQUEST = 1; #0 pour NON 1 pour OUI
|
||||||
@def $UDP_OPEN_PORT_FRONT_REQUEST = (53);
|
@def $UDP_OPEN_PORT_FRONT_REQUEST = (53);
|
||||||
|
|
||||||
# Depuis l'intérieur sur l'interface principale
|
# Depuis l'intérieur sur l'interface principale
|
||||||
|
@def $HAVE_FRONT_ACCESS = 0; #0 pour NON 1 pour OUI
|
||||||
@def $OPEN_PORT_FRONT_ACCESS = ();
|
@def $OPEN_PORT_FRONT_ACCESS = ();
|
||||||
@def $NEED_UDP_FRONT_ACCESS = 0; #0 pour NON 1 pour OUI
|
@def $NEED_UDP_FRONT_ACCESS = 0; #0 pour NON 1 pour OUI
|
||||||
@def $UDP_OPEN_PORT_FRONT_ACCESS = ();
|
@def $UDP_OPEN_PORT_FRONT_ACCESS = ();
|
||||||
|
@ -38,8 +40,9 @@ table filter {
|
||||||
interface lo ACCEPT;
|
interface lo ACCEPT;
|
||||||
interface $IF_ADMIN ACCEPT;
|
interface $IF_ADMIN ACCEPT;
|
||||||
|
|
||||||
|
@if $HAVE_FRONT_REQUEST {
|
||||||
interface $IF_FRONT proto tcp dport $OPEN_PORT_FRONT_REQUEST ACCEPT;
|
interface $IF_FRONT proto tcp dport $OPEN_PORT_FRONT_REQUEST ACCEPT;
|
||||||
|
}
|
||||||
|
|
||||||
@if $NEED_UDP_FRONT_REQUEST {
|
@if $NEED_UDP_FRONT_REQUEST {
|
||||||
interface $IF_FRONT proto udp dport $UDP_OPEN_PORT_FRONT_REQUEST ACCEPT;
|
interface $IF_FRONT proto udp dport $UDP_OPEN_PORT_FRONT_REQUEST ACCEPT;
|
||||||
|
@ -64,8 +67,9 @@ table filter {
|
||||||
mod state state (ESTABLISHED RELATED) ACCEPT;
|
mod state state (ESTABLISHED RELATED) ACCEPT;
|
||||||
outerface lo ACCEPT;
|
outerface lo ACCEPT;
|
||||||
|
|
||||||
|
@if $HAVE_FRONT_ACCESS {
|
||||||
outerface $IF_FRONT proto tcp dport $OPEN_PORT_FRONT_ACCESS ACCEPT;
|
outerface $IF_FRONT proto tcp dport $OPEN_PORT_FRONT_ACCESS ACCEPT;
|
||||||
|
}
|
||||||
|
|
||||||
@if $NEED_UDP_FRONT_ACCESS {
|
@if $NEED_UDP_FRONT_ACCESS {
|
||||||
outerface $IF_BACK proto udp dport $UDP_OPEN_PORT_FRONT_ACCESS ACCEPT;
|
outerface $IF_BACK proto udp dport $UDP_OPEN_PORT_FRONT_ACCESS ACCEPT;
|
||||||
|
|
|
@ -7,12 +7,14 @@
|
||||||
|
|
||||||
|
|
||||||
# Depuis l'extérieur sur l'interface principale
|
# Depuis l'extérieur sur l'interface principale
|
||||||
|
@def $HAVE_FRONT_REQUEST = 1; #0 pour NON 1 pour OUI
|
||||||
@def $OPEN_PORT_FRONT_REQUEST = (80 443);
|
@def $OPEN_PORT_FRONT_REQUEST = (80 443);
|
||||||
@def $NEED_UDP_FRONT_REQUEST = 0; #0 pour NON 1 pour OUI
|
@def $NEED_UDP_FRONT_REQUEST = 0; #0 pour NON 1 pour OUI
|
||||||
@def $UDP_OPEN_PORT_FRONT_REQUEST = ();
|
@def $UDP_OPEN_PORT_FRONT_REQUEST = ();
|
||||||
|
|
||||||
# Depuis l'intérieur sur l'interface principale
|
# Depuis l'intérieur sur l'interface principale
|
||||||
@def $OPEN_PORT_FRONT_ACCESS = (80);
|
@def $HAVE_FRONT_ACCESS = 1; #0 pour NON 1 pour OUI
|
||||||
|
@def $OPEN_PORT_FRONT_ACCESS = (80 443 8006);
|
||||||
@def $NEED_UDP_FRONT_ACCESS = 0; #0 pour NON 1 pour OUI
|
@def $NEED_UDP_FRONT_ACCESS = 0; #0 pour NON 1 pour OUI
|
||||||
@def $UDP_OPEN_PORT_FRONT_ACCESS = (53);
|
@def $UDP_OPEN_PORT_FRONT_ACCESS = (53);
|
||||||
|
|
||||||
|
@ -38,8 +40,9 @@ table filter {
|
||||||
interface lo ACCEPT;
|
interface lo ACCEPT;
|
||||||
interface $IF_ADMIN ACCEPT;
|
interface $IF_ADMIN ACCEPT;
|
||||||
|
|
||||||
|
@if $HAVE_FRONT_REQUEST {
|
||||||
interface $IF_FRONT proto tcp dport $OPEN_PORT_FRONT_REQUEST ACCEPT;
|
interface $IF_FRONT proto tcp dport $OPEN_PORT_FRONT_REQUEST ACCEPT;
|
||||||
|
}
|
||||||
|
|
||||||
@if $NEED_UDP_FRONT_REQUEST {
|
@if $NEED_UDP_FRONT_REQUEST {
|
||||||
interface $IF_FRONT proto udp dport $UDP_OPEN_PORT_FRONT_REQUEST ACCEPT;
|
interface $IF_FRONT proto udp dport $UDP_OPEN_PORT_FRONT_REQUEST ACCEPT;
|
||||||
|
@ -64,8 +67,9 @@ table filter {
|
||||||
mod state state (ESTABLISHED RELATED) ACCEPT;
|
mod state state (ESTABLISHED RELATED) ACCEPT;
|
||||||
outerface lo ACCEPT;
|
outerface lo ACCEPT;
|
||||||
|
|
||||||
|
@if $HAVE_FRONT_ACCESS {
|
||||||
outerface $IF_FRONT proto tcp dport $OPEN_PORT_FRONT_ACCESS ACCEPT;
|
outerface $IF_FRONT proto tcp dport $OPEN_PORT_FRONT_ACCESS ACCEPT;
|
||||||
|
}
|
||||||
|
|
||||||
@if $NEED_UDP_FRONT_ACCESS {
|
@if $NEED_UDP_FRONT_ACCESS {
|
||||||
outerface $IF_BACK proto udp dport $UDP_OPEN_PORT_FRONT_ACCESS ACCEPT;
|
outerface $IF_BACK proto udp dport $UDP_OPEN_PORT_FRONT_ACCESS ACCEPT;
|
||||||
|
|
|
@ -74,6 +74,10 @@
|
||||||
|
|
||||||
- hosts: zoneproxy
|
- hosts: zoneproxy
|
||||||
tasks:
|
tasks:
|
||||||
|
- name: Set timezone for Proxy
|
||||||
|
timezone:
|
||||||
|
name: Europe/Paris
|
||||||
|
|
||||||
- name: APT configuration for Proxy
|
- name: APT configuration for Proxy
|
||||||
copy:
|
copy:
|
||||||
dest: "/etc/apt/apt.conf.d/01proxy"
|
dest: "/etc/apt/apt.conf.d/01proxy"
|
||||||
|
|
|
@ -0,0 +1,90 @@
|
||||||
|
@def $IF_ADMIN = eth2;
|
||||||
|
@def $IF_FRONT = eth0;
|
||||||
|
@def $IF_BACK = (eth1);
|
||||||
|
|
||||||
|
|
||||||
|
# REQUEST : EXT -> INT | ACCESS : INT -> EXT
|
||||||
|
|
||||||
|
|
||||||
|
# Depuis l'extérieur sur l'interface principale
|
||||||
|
@def $HAVE_FRONT_REQUEST = 1; #0 pour NON 1 pour OUI
|
||||||
|
@def $OPEN_PORT_FRONT_REQUEST = (80);
|
||||||
|
@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 $HAVE_FRONT_ACCESS = 0; #0 pour NON 1 pour OUI
|
||||||
|
@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 = (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);
|
||||||
|
@def $NEED_UDP_BACK_ACCESS = 1; #0 pour NON 1 pour OUI
|
||||||
|
@def $UDP_OPEN_PORT_BACK_ACCESS = (53);
|
||||||
|
|
||||||
|
|
||||||
|
table filter {
|
||||||
|
chain INPUT {
|
||||||
|
policy DROP;
|
||||||
|
mod state state INVALID DROP;
|
||||||
|
mod state state (ESTABLISHED RELATED) ACCEPT;
|
||||||
|
interface lo ACCEPT;
|
||||||
|
interface $IF_ADMIN ACCEPT;
|
||||||
|
|
||||||
|
@if $HAVE_FRONT_REQUEST {
|
||||||
|
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 DROP;
|
||||||
|
mod state state INVALID DROP;
|
||||||
|
mod state state (ESTABLISHED RELATED) ACCEPT;
|
||||||
|
outerface lo ACCEPT;
|
||||||
|
|
||||||
|
@if $_FRONT_ACCESS {
|
||||||
|
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;
|
||||||
|
}
|
Loading…
Reference in New Issue