Hi everyone!
After migrating from fw3 to fw4, I need to add custom log filters so they can be parsed by my ELK stack easily.
To do so, I've read this doc and I realized that not all chain
are taken into account (or I misread the doc).
For example, I'd like to customize the drop_from_wan
to log dropped packets coming from my WAN:
...
config include
option type 'nftables'
option path '/etc/test.nft'
option position 'chain-post'
option chain 'drop_from_wan'
Running fw4 does not show any reference to test.nft
:
root@router-1:/etc# fw4 print | grep test
Section @rule[0] (WAN -> DEVICE | Allow SSH) is disabled, ignoring section
Section @rule[2] (WAN -> DEVICE | Allow Ping) is disabled, ignoring section
...
Section @rule[88] (CELL -> SERVICES | Allow dlna 8200) is disabled, ignoring section
root@router-1:/etc#
Whereas if I choose the chain input_wan
:
...
config include
option type 'nftables'
option path '/etc/test.nft'
option position 'chain-post'
option chain 'input_wan'
fw4 shows something:
root@router-1:/etc# fw4 print | grep test
Section @rule[0] (WAN -> DEVICE | Allow SSH) is disabled, ignoring section
Section @rule[2] (WAN -> DEVICE | Allow Ping) is disabled, ignoring section
...
Section @rule[88] (CELL -> SERVICES | Allow dlna 8200) is disabled, ignoring section
include "/etc/test.nft"
The position
begins with chain-*
so I should be good.
Am I missing something? Or is there any easier solution?
Thanks!
P.S: I don't know if a FR is already opened for that, but it would be great to add a customization for log prefix in the /etc/config/firewall
configuration