I am wondering what the best approach should be in relation to handling logging of items within iptables. For example, I have a rule such as the following:
$IPT -A BADTCP -p tcp -m tcp --tcp-flags ACK,FIN FIN -m limit --limit 5/min --limit-burst 5 -j LOG --log-prefix "Denied ACK-FIN Scan: " --log-ip-options --log-tcp-sequence --log-tcp-options --log-level 7
$IPT -A BADTCP -p tcp -m tcp --tcp-flags ACK,FIN FIN -j DROP
I was curious if it is better to have the following part of the rule
-m limit --limit 5/min --limit-burst 5 -j LOG --log-prefix "Denied ACK-FIN Scan: " --log-ip-options --log-tcp-sequence --log-tcp-options --log-level 7
included within the chain or if it should be sent to a different chain such as a LOGDROP chain?
Is it possible to have something like the following rules?
$IPT -A BADTCP -p tcp -m tcp --tcp-flags ACK,FIN FIN -m limit --limit 5/min --limit-burst 5 -j LOG --log-prefix "Denied ACK-FIN Scan: "
$IPT -A BADTCP -p tcp -m tcp --tcp-flags ACK,FIN FIN -j LOGDROP
$IPT -A LOGDROP -p TCP --log-ip-options --log-tcp-sequence --log-tcp-options --log-level 7
$IPT -A LOGDROP -j DROP
Thank you in advance for your help with this.