Existe uma solução alternativa usando a extensão iptables "LOG". De man 8 iptables-extensions
:
This is a "non-terminating target", i.e. rule traversal continues at the next rule. So if you want to LOG the packets you refuse, use two separate rules with the same matching criteria, first using target LOG then DROP (or REJECT).
Em fantoches:
firewall { '100 log insecure outgoing HTTP traffic':
chain => 'OUTPUT',
dport => 80,
proto => tcp,
jump => 'LOG',
} ->
firewall { '101 drop insecure outgoing HTTP traffic':
chain => 'OUTPUT',
dport => 80,
proto => tcp,
action => reject,
}
Ou simples iptables
:
$ sudo iptables --list-rules OUTPUT | grep ^-A
-A OUTPUT -p tcp -m multiport --dports 80 -m comment --comment "100 log insecure outgoing HTTP traffic" -j LOG
-A OUTPUT -p tcp -m multiport --dports 80 -m comment --comment "101 drop insecure outgoing HTTP traffic" -j REJECT --reject-with icmp-port-unreachable
Não super clean, mas pelo menos é simples.