This is a two part question, maybe I should do different threads but I’ll put them in one for now.
I’ll post my firewall if necessary but maybe we can treat this as more of a general knowledge question. Currently my firewall is basically the MikroTik default rules from an RB3011 plus some additional drop rules from inbound DNS requests and inbound SNMP requests. I’m running a CCR with multi VLANs, basically a small business is run from this router in a residential environment.
First, I have some port forwarding done to access my NAS remotely so some computers can sync in the background as my employees and myself are off site. Twice now my NAS has reported failed login attempts and it has blocked the IP addresses. So, this is good that they are blocked since they were not legitimate logins. My question is would any of the various firewall rules that are floating around for adding addresses to block lists on the router have worked in this case? Presumably, a bot or someone discovered the open port and tried to login so they presumably had one connection through my router and then multiple login attempts to the NAS within a minute triggering the NAS security. Just wondering if I can add rules to my firewall to help negate these types of attacks. I wouldn’t think so since the port is open but I hope I’m wrong.
Second, I’ve read a lot of threads about firewalls and it seems a number of people say the default rules are fine in most cases, others add a lot of rules for automatic blocking of addresses like the rules below. Others say why bother with stuff like this since the default firewall rules drop them anyway. Just looking for feedback if stuff like below could help with my NAS question or if stuff like below is of any value. When I had the rules below as part of my router they blocked a lot of addresses and the address list grew fairly large over time. But was it necessary? Or, do default rules block (drop) this type of traffic anyway.
Note, the below isn’t an entire firewall, just a section of my old rules.
add action=add-src-to-address-list address-list="port scanners" \
address-list-timeout=2w chain=input comment="Port scanners to list " \
protocol=tcp psd=21,3s,3,1
add action=add-src-to-address-list address-list="port scanners" \
address-list-timeout=2w chain=input comment="NMAP FIN Stealth scan" \
protocol=tcp tcp-flags=fin,!syn,!rst,!psh,!ack,!urg
add action=add-src-to-address-list address-list="port scanners" \
address-list-timeout=2w chain=input comment="SYN/FIN scan" protocol=tcp \
tcp-flags=fin,syn
add action=add-src-to-address-list address-list="port scanners" \
address-list-timeout=2w chain=input comment="SYN/RST scan" protocol=tcp \
tcp-flags=syn,rst
add action=add-src-to-address-list address-list="port scanners" \
address-list-timeout=2w chain=input comment="FIN/PSH/URG scan" protocol=tcp \
tcp-flags=fin,psh,urg,!syn,!rst,!ack
add action=add-src-to-address-list address-list="port scanners" \
address-list-timeout=2w chain=input comment="ALL/ALL scan" protocol=tcp \
tcp-flags=fin,syn,rst,psh,ack,urg
add action=add-src-to-address-list address-list="port scanners" \
address-list-timeout=2w chain=input comment="NMAP NULL scan" protocol=tcp \
tcp-flags=!fin,!syn,!rst,!psh,!ack,!urg
add action=drop chain=input comment="dropping port scanners" src-address-list=\
"port scanners"
add action=add-src-to-address-list address-list=trying_to_rdp \
address-list-timeout=1d chain=input comment="list IP's who try rdp" \
dst-port=3389 protocol=tcp
add action=add-src-to-address-list address-list=trying_to_login \
address-list-timeout=1d chain=input comment=\
"list IP's who try remote login" dst-port=20-23 protocol=tcp
add action=drop chain=input comment="Drop ssh brute forcers" dst-port=22 \
protocol=tcp src-address-list=ssh-blacklist
add action=add-src-to-address-list address-list=ssh-blacklist \
address-list-timeout=1w3d chain=input connection-state=new dst-port=22 \
protocol=tcp src-address-list=ssh_stage3
add action=add-src-to-address-list address-list=ssh_stage3 \
address-list-timeout=1h chain=input connection-state=new dst-port=22 \
protocol=tcp src-address-list=ssh_stage2
add action=add-src-to-address-list address-list=ssh_stage2 \
address-list-timeout=1h chain=input connection-state=new dst-port=22 \
protocol=tcp src-address-list=ssh_stage1
add action=add-src-to-address-list address-list=ssh_stage1 \
address-list-timeout=1h chain=input connection-state=new dst-port=22 \
protocol=tcp
add action=accept chain=input comment="allow ssh" disabled=yes dst-port=22 \
protocol=tcp
add action=drop chain=forward comment="drop ssh brute downstream" dst-port=22 \
protocol=tcp src-address-list=ssh-blacklist
add action=drop chain=input comment="drop ftp brute forcers" dst-port=21 \
protocol=tcp src-address-list=ftp_blacklist
add action=accept chain=output content="530 Login incorrect" dst-limit=\
1/1m,9,dst-address/1m protocol=tcp
add action=add-dst-to-address-list address-list=ftp_blacklist \
address-list-timeout=3h chain=output content="530 Login incorrect" \
protocol=tcp
add action=drop chain=input comment=\
"Drop Input AS it should have been allowed by now"
add action=accept chain=Forward