From 5374bb24917812f32e65003d1755843416d7672e Mon Sep 17 00:00:00 2001 From: "guillaume.emorine" Date: Mon, 8 Apr 2024 09:38:17 +0200 Subject: [PATCH] Actualiser sisr1/tp07/files_firewall/current_ruleset_partie_5.nft MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changement de la mise en forme, sera supprimé si le téléchargement du fichier ruine la mise en forme originale du code. --- .../current_ruleset_partie_5.nft | 56 ++++++++++--------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/sisr1/tp07/files_firewall/current_ruleset_partie_5.nft b/sisr1/tp07/files_firewall/current_ruleset_partie_5.nft index d3c7f21..4cc64e9 100644 --- a/sisr1/tp07/files_firewall/current_ruleset_partie_5.nft +++ b/sisr1/tp07/files_firewall/current_ruleset_partie_5.nft @@ -15,53 +15,57 @@ define iplan = 10.0.0.254 table ip ipfilter{ chain prerouting { - type filter hook prerouting priority filter; policy drop; + type filter hook prerouting priority filter; policy drop; ct state established, related accept icmp type echo-reply accept icmp type echo-request iif {$lanif} ip daddr $dmznet accept icmp type echo-request iif {$lanif} ip daddr {$iplan} accept - tcp dport 20 accept - tcp dport 21 accept - tcp dport {80, 443} ip saddr $lan-ntw accept + tcp dport 20 accept + tcp dport 21 accept + tcp dport {80, 443} ip saddr $lan-ntw accept tcp sport {80, 443} ip saddr $lan-ntw accept tcp dport 22 accept ip saddr $proxy tcp dport {80, 443} accept } + chain system_in { - type filter hook input priority filter; policy drop; + type filter hook input priority filter; policy drop; ct state established, related accept icmp type echo-reply accept icmp type echo-request iif {$lanif} accept - tcp dport 20 accept - tcp dport 21 accept - tcp dport {80, 443} accept - tcp dport 22 accept + tcp dport 20 accept + tcp dport 21 accept + tcp dport {80, 443} accept + tcp dport 22 accept ip saddr $proxy tcp dport {80, 443} accept } + chain routing { - type filter hook forward priority filter; policy drop; + type filter hook forward priority filter; policy drop; ct state established, related accept - icmp type echo-request iif {$lanif} oif {$dmzif} accept + icmp type echo-request iif {$lanif} oif {$dmzif} accept icmp type echo-reply iif {$dmzif} oif {$lanif} accept - tcp dport {80, 443} ip saddr $lan-ntw accept + tcp dport {80, 443} ip saddr $lan-ntw accept tcp sport {80, 443} ip saddr $lan-ntw accept } + chain system_out { - type filter hook output priority filter; policy drop; - ip daddr $dns accept - ip daddr $proxy tcp dport $proxyport accept + type filter hook output priority filter; policy drop; + ip daddr $dns accept + ip daddr $proxy tcp dport $proxyport accept icmp type echo-reply oif {$lanif} accept icmp type echo-request accept - tcp dport 20 accept + tcp dport 20 accept tcp sport 20 accept - tcp dport 21 accept + tcp dport 21 accept tcp sport 21 accept - tcp dport {80, 443} accept + tcp dport {80, 443} accept tcp sport {80, 443} accept tcp sport 22 accept } + chain postrouting { - type filter hook postrouting priority filter; policy drop; + type filter hook postrouting priority filter; policy drop; ct state established, related accept ip daddr $dns accept ip daddr $proxy tcp dport $proxyport accept @@ -69,21 +73,21 @@ table ip ipfilter{ icmp type echo-reply iif {$dmzif} oif {$lanif} accept icmp type echo-request iif {$lanif} oif {$dmzif} accept icmp type echo-request ip saddr $iplan oif $lanif accept - tcp dport 20 accept - tcp sport 20 accept - tcp dport 21 accept - tcp sport 21 accept - tcp dport {80, 443} accept + tcp dport 20 accept + tcp sport 20 accept + tcp dport 21 accept + tcp sport 21 accept + tcp dport {80, 443} accept tcp sport {80, 443} accept tcp sport 22 accept } chain pre_nat { - type nat hook prerouting priority filter; policy accept; + type nat hook prerouting priority filter; policy accept; } chain post_nat { - type nat hook postrouting priority filter; policy accept; + type nat hook postrouting priority filter; policy accept; ip saddr $lan-ntw oif $netif snat $firewall } }