Hi, I just want to know your thought about my firewall rules, just to be sure I'm doing well or there's something I might improve. It's about my home router, a hEX POE with sfp port for WAN and all the eth ports bridged together in "LAN Bridge"
Thanks in advance.
Notes:
- the address list "blacklist" is the list of IPs blocked with the brute force login prevent rules
- the address list "allowed_to_router" it's my lan and VPN network
- the address list "bogon" is the list of IPs or network blocks that shouldn't exist on the Internet
Here the firewall rules:
/ip firewall filter
add action=drop chain=input comment="Block Blacklist addresses IPs" src-address-list=\
blacklist
add action=drop chain=input comment="Drop invalid" connection-state=invalid
add action=fasttrack-connection chain=forward comment="Fasttrack" connection-state=\
established,related hw-offload=yes
add action=accept chain=input comment="Accept established,related,untracked" \
connection-state=established,related,untracked
add action=accept chain=input comment="Accept input connections from LAN" in-interface=\
"LAN Bridge"
add action=jump chain=input comment="Brute force login prevent" dst-port=21-23,1723 \
jump-target="Brute force login prevent" protocol=tcp
add action=accept chain=input comment="Accept ICMP" protocol=icmp
add action=accept chain=input comment="Allow SSTP connections" dst-port=443 protocol=tcp
add action=accept chain=input comment="Allow L2TP/IPsec connections" disabled=yes dst-port=\
1701,500,4500 protocol=udp
add action=accept chain=input comment="Allow Mikrotik Discovery" dst-port=5678 protocol=udp \
src-address-list=allowed_to_router
add action=accept chain=input comment="Allow Winbox connections" dst-port=8291 protocol=tcp
add action=accept chain=input comment="Allow SNMP connections" dst-port=161 protocol=udp
add action=accept chain=input comment="Allow Mikrotik Web interface" dst-port=80 protocol=\
tcp src-address-list=allowed_to_router
add action=accept chain=input comment="Allow Mikrotik API" dst-port=8728,8729 protocol=tcp
add action=drop chain=input comment="Drop all not coming from LAN" log-prefix=DROP \
src-address-list=!allowed_to_router
add action=drop chain=forward comment="Drop to bogon list" dst-address-list=bogons log=yes \
log-prefix=BOGONS
add action=accept chain=forward comment="Accept established,related, untracked" \
connection-state=established,related,untracked
add action=drop chain=forward comment="Drop invalid" connection-state=invalid
add action=drop chain=forward comment="Drop all from WAN not DSTNATed" \
connection-nat-state=!dstnat connection-state=new in-interface="sfp1 - WAN"
add action=add-src-to-address-list address-list=blacklist address-list-timeout=none-static \
chain="Brute force login prevent" comment="Block login error 3rd Attemp" \
connection-state=new dst-port=21-23,1723 log=yes protocol=tcp src-address-list=\
login_attemp_stage2
add action=add-src-to-address-list address-list=login_attemp_stage2 address-list-timeout=5m \
chain="Brute force login prevent" comment="Log login error 2st Attemp" connection-state=\
new dst-port=21-23,1723 protocol=tcp src-address-list=login_attemp_stage1
add action=add-src-to-address-list address-list=login_attemp_stage1 address-list-timeout=5m \
chain="Brute force login prevent" comment="Log login error 1st Attemp" connection-state=\
new dst-port=21-23,1723 protocol=tcp src-address-list=!login_attemp_stage2
add action=accept chain="Brute force login prevent" comment="Accept 21-23 TCP connections" \
dst-port=21-23,1723 protocol=tcp