Firewall logs

Currently reading
Firewall logs

291
89
NAS
DS920+, DS416slim
Operating system
  1. Windows
Mobile operating system
  1. Android
Where do you see firewall logs? In the log centre? I can't see anything relating to firewall in there, does this mean it has never blocked anything?

I got the impression NAS users were constantly under attack from hacking attempts so I feel like I'm missing something. If it's just the hacking, that's fine 👌
 
iptables or default Linux firewall doesn’t have logs (dropped, rejected, …) enabled by default (also in DSM).

When you like to use iptables logging feature, you need to be sure of what are you doing. Otherwise, you can block entire your system - it's a powerful firewall.
Because you are asking such a question, it will be more likely that you do not understand this domain. I'm not writing this to embarrass you. This domain is difficult to understand at all what you will find in these logs. Then there is another point of view - if such logs are improperly enabled, you can overwhelm your CPU. Be careful.

First:
default location for enabled iptables logs is: /var/log/messages
you can test, that there you can’t find these logs:
Bash:
cat /var/lo/messages | grep “ipt denied:”

You can understand how iptables works. Start here:
or here:

And if you still want to look at how to make logs, this will help you:

In any case (my approach):
you can mount DSM /var/log to your computer to be more flexible


A few recommendations:
1. MANDATORY - make a backup of the existing iptables:
Bash:
iptables-save > <path to your backup>

2. always test only one rule with logging

3. gradually add other log rules (or remove unnecessary ones)

4. at any time you can restore the backup of the iptables:
Bash:
iptables-restore > <path to your backup>

Here is a better option to start with:

For a forensic search purposes, it is more appropriate to use tcpdump, which you can also save in realtime to a defined file, which you can have mapped to Wireshark on your computer. Of course, you will only see the current status.

More about NAS security (related) you can find here:

about Docker containers security (related) here:
 
Thanks @jeyare

No offence taken re this being too complex for me - it most likely is. It seems odd though that you can set up the firewall etc very easily (and really it is mandatory) but then unless you have a phd in forensic computing there's no way to know if the firewall is actually working.... unless it's not and something bad happens.

This all looks like rainy week/end kind of project, so thanks for the links and info, will go through it all at an opportune moment.

--- unless there are packages/docker apps that manage it for you - will need to research....
 
unless it's not and something bad happens
NAS firewall must be the last possible instance.
More powerful must be the first line (router with integrated firewall or independent firewall) with defined policies for WAN (in/out) LAN (in/out) and router interfaces as well.
Then hardening of DNS handling (DNScrypt, DNSsec) to hide DNS records outside your infrastructure).
Reverse Proxy is also one of the security instance. With NPM you can limit inbound traffic better than just Country IP range (it’s really soft rule).


You need understand principles of the traffic, then you will understand IPTables, then you will exercise, then you will harden your infrastructure.

finally you will create an infrastructure that will be invisible from WAN.
inexperienced users who trust NAS gurus like this one link should consider whether they will continue to search for his recommendations. They are playing with fire. Because only an inexperienced user exposes his NAS to the Internet by this way.
 
OK lot's more reading to do there...

inexperienced users who trust NAS gurus like this one link should consider whether they will continue to search for his recommendations. Th

If you have the right ports closed off, and all user accounts have strong passwords and 2FA, is it really an issue to have your DSM open in this way?
 
If you have the right ports closed off, and all user accounts have strong passwords and 2FA, is it really an issue to have your DSM open in this way?

When is DSM exposed directly to WAN? :censored: all lights will be in red.
  • strong PSW for NAS and 2FA is great for the web interface. Other channels do not need 2FA.
  • An IP address can be traced through free DNS records unless it is shielded.

To be sure
I pointed out this particular user (11 days ago) that:
  • there are several exposed ports
  • including that such DSM settings contradict the Synology Security Advisory guidelines (and common professional approach).
  • in addition, I tried to point out that he has exposed services through which it is possible to identify the DSM system he is using accurately. Since then, it has been possible to exploit known vulnerabilities.
Not to mention that this user takes on the role of a well-known educator in using NAS systems for newbies. Unfortunately, it seems that the king is naked.

Take this example as an illustration - because it is really dangerous to leave the DSM system exposed directly to the Internet - without a VPN, ... and all recommendations written in this forum.
 
Last edited by a moderator:
If you have the right ports closed off, and all user accounts have strong passwords and 2FA, is it really an issue to have your DSM open in this way?
Approach this Q from the other perspective, ie as a potential hacker; what do I already know about @jeyare 's potential target above?

  • I know that there is a real machine at that IP address.
  • There is a web server running on port 5001 at that address.
  • The web server is an Nginx server (http headers). What known recent vulnerabilities can I try against Nginx webservers?
  • I know that this machine is a Synology NAS, and not, say, an IP camera or a netgear router or an HP server.
  • I know that this Synology NAS is running at least DSM v7 (the user interface tell me this). What recent vulns have been disclosed re DSM7?
  • I know the model is a Syno DS1621+ (he's told me on the log in page)
  • As there's a Synology DS1621+ NAS w/ DSM7.x at that IP address, I'll speculate that there are other services running on other ports at that IP address. A mail server? A DNS server (eg BIND - as used by Syno DNS package)? I bet he's running a few docker containers behind that IP...lets have a look for recent known vulns in common docker packages, eg NextCloud / pihole / Sonarr etc etc...
  • Now that I've found an IP with a specific machine and OS version behind it, I can point all my automated vuln scripts at that IP address for more targetting exploration & see what comes up.
  • I can also bombard that IP address with thousands of brute force login attempts in case he hasn't got 2fa turned on, or auto blocking enabled. Even if he has, I can burn through some of his bandwidth & CPU cycles by bombarding him until I get bored and move on.

...you get the point. As vulnerabilities in common OS software are being disclosed all the time, you are giving the hacker a huge head start by exposing so much to the public internet.

If you put all this behind a VPN, all that a hacker's scan would show up is an open VPN port at a given IP address. No hint of what machine, OS or other services are there. Just a VPN port. I only have to worry about newly discovered vulns in that 1 package - the VPN server - rather than the multitude of services I may be running as per above.
 
I know that this Synology NAS is running at least DSM v7 (the user interface tell me this). What recent vulns have been disclosed re DSM7?

even worse, you can get more information by SSDP call:
  • NAS LAN IP address + Port (or fqdn) ... just imagine
  • UUID useful for some kind of attack
  • the exact DSM version & build number running on the NAS. Then 3rd party can use an attack by known vulnerabilities related to the build discovered.

Final stage:
NEVER, NEVER, NEVER expose directly/unshielded your NAS to WAN.
 
here I have summarized the keyholes in the DSM native settings, including how to avoid them:
I tried to explain this to Synology Product Security Incident Response Team (PSIRT) over a year ago.
Result: disinterested
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Similar threads

Hello! Yes I did indeed find the problem, there are some special firewall rules that you need to make for...
Replies
4
Views
887
  • Question
OOOps running SRM 1.3.1 Update 6
Replies
1
Views
930
You are right. I think I'm getting this error because I can't allow cloudflared.
Replies
2
Views
1,274
All 3 NAS's are set that way.... FIREWALL AND NOTIFICATIONS ARE CHECKED I have in the past seen and...
Replies
2
Views
1,114
  • Question
Generically you would. 1. Allow specific IPs/Ports from your local LAN 2. Allow specific IP/Port for VPN...
Replies
5
Views
5,319
QuickConnect Relay uses a client connection created from the NAS outbound to the Synology servers. This...
Replies
2
Views
3,716
Morning lads I'm having some issues with with an IP camera I recently bought (Reolink e1 pro), I've...
Replies
0
Views
1,424

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Trending threads

Back
Top