30 lines
773 B
Text
30 lines
773 B
Text
|
|
#!/usr/sbin/nft -f
|
||
|
|
# Géré par Ansible (rôle durcissement) — ne pas modifier à la main.
|
||
|
|
# Politique : tout est refusé en entrée sauf loopback, trafic déjà établi,
|
||
|
|
# ICMP, et les ports {{ durcissement_ports_ouverts | join(', ') }}.
|
||
|
|
|
||
|
|
flush ruleset
|
||
|
|
|
||
|
|
table inet filter {
|
||
|
|
chain input {
|
||
|
|
type filter hook input priority 0; policy drop;
|
||
|
|
|
||
|
|
iif lo accept
|
||
|
|
ct state established,related accept
|
||
|
|
ct state invalid drop
|
||
|
|
|
||
|
|
ip protocol icmp accept
|
||
|
|
meta l4proto ipv6-icmp accept
|
||
|
|
|
||
|
|
tcp dport { {{ durcissement_ports_ouverts | join(', ') }} } accept
|
||
|
|
}
|
||
|
|
|
||
|
|
chain forward {
|
||
|
|
type filter hook forward priority 0; policy drop;
|
||
|
|
}
|
||
|
|
|
||
|
|
chain output {
|
||
|
|
type filter hook output priority 0; policy accept;
|
||
|
|
}
|
||
|
|
}
|