From dc214056449119b29ad7b19b8d47e81b343ff453 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Sun, 28 Apr 2013 19:54:45 +0200 Subject: Updated theme and templates Updated to pelican 3.2 --- content/Informatique/fail2ban.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'content/Informatique/fail2ban.rst') diff --git a/content/Informatique/fail2ban.rst b/content/Informatique/fail2ban.rst index 794797f..a276ca4 100755 --- a/content/Informatique/fail2ban.rst +++ b/content/Informatique/fail2ban.rst @@ -90,9 +90,9 @@ qui consistera à bloquer une IP pendant telle période : Dans fail2ban, nous allons créer un nouveau fichier action, qui se présentera comme suit : -:: +.. code-block:: bash - #On crée une nouvelle table + #On crée une nouvelle table actionstart = iptables -N fail2ban- #On bloque les connexions 2 fois sur 3 iptables -A fail2ban- -m statistic --mode random --probability .33 -j REJECT --reject-with icmp-host unreachable @@ -122,13 +122,13 @@ droits limités. Notre règle iptables consistera juste à rediriger les connexions entrantes sur le port 80 vers le port où l'on fait tourner socat. -:: +.. code-block:: bash sudo -u nobody socat tcp4-listen:6666,reuseaddr,fork exec:"cat /etc/apache2/banned.html" & et la règle iptables à mettre en place : -:: +.. code-block:: bash #On crée la règle sur la table de préroutage : actionstart = iptables -t nat -N fail2ban- @@ -142,7 +142,7 @@ et la règle iptables à mettre en place : et pour lancer l'action, là encore, on simule une perte de paquet pour ralentir le temps d'affichage de la page -:: +.. code-block:: bash actionban = iptables -t nat -I fail2ban- 1 -s -p tcp -m multiport --dports -m statistic --mode nth --every 3 -j REDIRECT --to-port 6666 iptables -I fail2ban- 1 -s -j DROP -- cgit v1.2.3