Que pensez-vous de mon IPTABLES -L

bonjour a tous

a la base j’utilise guarddog mais j’aimerais m’en passer donc,
je suis en train d’apprendre IPTABLES et j’ai regarder le beau tuto de ricardo dans T&A
j’ai quelques questions (evidement !! :slight_smile: ) en premier :
j’aimerais savoir ce que vous penser de mon IPTABLE -L
car au demarrage j’ai une ligne du style iptable : bad rules

y voyer-vous des erreurs ou autres ou il n’y a rien a dire … merci :

IPTABLES -L

Chain INPUT (policy DROP)
target     prot opt source               destination         
fail2ban-ssh  tcp  --  anywhere             anywhere            multiport dports ssh
ACCEPT     all  --  anywhere             anywhere           
ACCEPT     all  --  192.168.1.23         192.168.1.255       
logaborted  tcp  --  anywhere             anywhere            state RELATED,ESTABLISHED tcp flags:RST/RST
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
ACCEPT     icmp --  anywhere             anywhere            icmp destination-unreachable
ACCEPT     icmp --  anywhere             anywhere            icmp time-exceeded
ACCEPT     icmp --  anywhere             anywhere            icmp parameter-problem
nicfilt    all  --  anywhere             anywhere           
srcfilt    all  --  anywhere             anywhere           

Chain FORWARD (policy DROP)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
ACCEPT     icmp --  anywhere             anywhere            icmp destination-unreachable
ACCEPT     icmp --  anywhere             anywhere            icmp time-exceeded
ACCEPT     icmp --  anywhere             anywhere            icmp parameter-problem
srcfilt    all  --  anywhere             anywhere           

Chain OUTPUT (policy DROP)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere           
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
ACCEPT     icmp --  anywhere             anywhere            icmp destination-unreachable
ACCEPT     icmp --  anywhere             anywhere            icmp time-exceeded
ACCEPT     icmp --  anywhere             anywhere            icmp parameter-problem
s1         all  --  anywhere             anywhere           

Chain f0to1 (3 references)
target     prot opt source               destination         
ACCEPT     tcp  --  anywhere             anywhere            tcp spts:1024:65535 dpt:www state NEW
ACCEPT     tcp  --  anywhere             anywhere            tcp spts:1024:65535 dpt:http-alt state NEW
ACCEPT     tcp  --  anywhere             anywhere            tcp spts:1024:65535 dpt:8008 state NEW
ACCEPT     tcp  --  anywhere             anywhere            tcp spts:1024:65535 dpt:8000 state NEW
ACCEPT     tcp  --  anywhere             anywhere            tcp spts:1024:65535 dpt:8888 state NEW
ACCEPT     tcp  --  anywhere             anywhere            tcp spts:1024:65535 dpt:https state NEW
ACCEPT     tcp  --  anywhere             anywhere            tcp spts:1024:65535 dpt:ftp state NEW
ACCEPT     udp  --  anywhere             anywhere            udp spts:1024:65535 dpt:icpv2
logdrop    all  --  anywhere             anywhere           

Chain f1to0 (1 references)
target     prot opt source               destination         
ACCEPT     tcp  --  anywhere             anywhere            tcp spts:1024:5999 dpt:xmpp-client state NEW
ACCEPT     tcp  --  anywhere             anywhere            tcp spts:1024:5999 dpt:5223 state NEW
ACCEPT     tcp  --  anywhere             anywhere            tcp spts:1024:5999 dpt:smtp state NEW
ACCEPT     tcp  --  anywhere             anywhere            tcp spts:1024:5999 dpt:www state NEW
ACCEPT     tcp  --  anywhere             anywhere            tcp spts:1024:5999 dpt:http-alt state NEW
ACCEPT     tcp  --  anywhere             anywhere            tcp spts:1024:5999 dpt:8008 state NEW
ACCEPT     tcp  --  anywhere             anywhere            tcp spts:1024:5999 dpt:8000 state NEW
ACCEPT     tcp  --  anywhere             anywhere            tcp spts:1024:5999 dpt:8888 state NEW
ACCEPT     tcp  --  anywhere             anywhere            tcp spts:1024:5999 dpt:pop3s state NEW
ACCEPT     tcp  --  anywhere             anywhere            tcp spts:1024:5999 dpt:888 state NEW
ACCEPT     tcp  --  anywhere             anywhere            tcp spts:1024:5999 dpts:6660:6669 state NEW
ACCEPT     icmp --  anywhere             anywhere            icmp source-quench
ACCEPT     tcp  --  anywhere             anywhere            tcp spts:1024:5999 dpt:ssmtp state NEW
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:domain state NEW
ACCEPT     udp  --  anywhere             anywhere            udp dpt:domain
ACCEPT     udp  --  anywhere             anywhere            udp spts:1024:65535 dpt:icpv2
ACCEPT     tcp  --  anywhere             anywhere            tcp spts:1024:5999 dpt:pop3 state NEW
ACCEPT     tcp  --  anywhere             anywhere            tcp spts:1024:5999 dpt:msnp state NEW
ACCEPT     tcp  --  anywhere             anywhere            tcp spts:1024:5999 dpt:https state NEW
ACCEPT     tcp  --  anywhere             anywhere            tcp spts:1024:5999 dpt:ftp state NEW
logdrop    all  --  anywhere             anywhere           

Chain fail2ban-ssh (1 references)
target     prot opt source               destination         
RETURN     all  --  anywhere             anywhere           

Chain logaborted (1 references)
target     prot opt source               destination         
logaborted2  all  --  anywhere             anywhere            limit: avg 1/sec burst 10
LOG        all  --  anywhere             anywhere            limit: avg 2/min burst 1 LOG level warning prefix `LIMITED '

Chain logaborted2 (1 references)
target     prot opt source               destination         
LOG        all  --  anywhere             anywhere            LOG level warning tcp-sequence tcp-options ip-options prefix `ABORTED '
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED

Chain logdrop (4 references)
target     prot opt source               destination         
logdrop2   all  --  anywhere             anywhere            limit: avg 1/sec burst 10
LOG        all  --  anywhere             anywhere            limit: avg 2/min burst 1 LOG level warning prefix `LIMITED '
DROP       all  --  anywhere             anywhere           

Chain logdrop2 (1 references)
target     prot opt source               destination         
LOG        all  --  anywhere             anywhere            LOG level warning tcp-sequence tcp-options ip-options prefix `DROPPED '
DROP       all  --  anywhere             anywhere           

Chain logreject (0 references)
target     prot opt source               destination         
logreject2  all  --  anywhere             anywhere            limit: avg 1/sec burst 10
LOG        all  --  anywhere             anywhere            limit: avg 2/min burst 1 LOG level warning prefix `LIMITED '
REJECT     tcp  --  anywhere             anywhere            reject-with tcp-reset
REJECT     udp  --  anywhere             anywhere            reject-with icmp-port-unreachable
DROP       all  --  anywhere             anywhere           

Chain logreject2 (1 references)
target     prot opt source               destination         
LOG        all  --  anywhere             anywhere            LOG level warning tcp-sequence tcp-options ip-options prefix `REJECTED '
REJECT     tcp  --  anywhere             anywhere            reject-with tcp-reset
REJECT     udp  --  anywhere             anywhere            reject-with icmp-port-unreachable
DROP       all  --  anywhere             anywhere           

Chain nicfilt (1 references)
target     prot opt source               destination         
RETURN     all  --  anywhere             anywhere           
RETURN     all  --  anywhere             anywhere           
RETURN     all  --  anywhere             anywhere           
logdrop    all  --  anywhere             anywhere           

Chain s0 (1 references)
target     prot opt source               destination         
f0to1      all  --  anywhere             192.168.1.23       
f0to1      all  --  anywhere             192.168.1.255       
f0to1      all  --  anywhere             localhost           
logdrop    all  --  anywhere             anywhere           

Chain s1 (1 references)
target     prot opt source               destination         
f1to0      all  --  anywhere             anywhere           

Chain srcfilt (2 references)
target     prot opt source               destination         
s0         all  --  anywhere             anywhere      

Salut
On ne peut dire d’une liste de règles qu’elles sont pertinentes (ou pas) que si elles correspondent à ce que tu souhaites réellement mettre en place, il n’y a pas de bonnes ou mauvaises règles.
Il faudrait que tu décrives ton environnement, que tu dises avec des phrases tout ce que tu veux interdire/autoriser, ta stratégie de sécurité en fait, et que tu mettes à côté ton script avec toutes tes règles, plutôt.
Si ça matche = c’est bon.
Si ça matche pas = faut corriger
Pour le bad rule, il se peut qu’il y ait une erreur de syntaxe dans le script, et que la ligne en question ne soit tout simplement pas interprétée, donc à ce moment là elle n’apparaîtra même pas dans le iptables -L
:006

moi j’ai un truc à dire.

tout le monde parle d’iptables, mais comme IPV6 est activé presque par defaut sur debian personne ne parle jamais d’IP6TABLES.

à la maison c’est pas trop grave car peu de box sont ‘aware’ là dessus mais pour les entreprises et serveurs dédiés faisez gaffe. ça sert à rien de blinder ipv4 si une passoire est disponible en IPV6.

voila c’etait pour dire quelque chose, de toute façon j’ai pas lu le code posté par notre ami ça me gonfle de lire 400 lignes de code sans même une ligne pour qu’il explique ou il veut en venir.

sinon pour iptables poste plutot tes lignes de conf et pas le resultat.

++

bon week end

et merki pour les :006 :006 :006 :006 :006

:038 :041 :023 :005 :008 :114 :030 :007

et si ipv6 est désactiver dans le kernel la logique dit pas besoin dans iptable nan ?

merci pour vos reponses , j’y vois plus claire !!

j’ai trouver ceci comme complement tres instructif : linuxhomenetworking.com/wiki … g_iptables

[quote]sans même une ligne pour qu’il explique ou il veut en venir.
[/quote]

c’etait tout bêtement ma premiere question , je voulais simplement savoir si dans le ce iptables -L on pouvais voir quelque chose ressortir qui ne serais pas bon …mais j’ai bien compris :slight_smile: le .conf est mieux (je le posterais dans le prochain message) (merci de la patience que vous avez) :mrgreen: :mrgreen: :016

je ne met pas encore en resolu , j’aurais d’autres questions qui serons plus explicite :wink: