So many vulnerabilities... How to set restrictions to allow only specific ip's to connect to my server?

Hi there,

First of all, when running the security scan, I get a HUGE list of weaknesses from low to high.
It will take ages to solve all of them. I already enabled the mod security…
After testing it with different software I found even more vulnerabilities.
Since it will take ages to read about how to solve all that and apply it, I want to restrict access to only some ip addresses. My local ones and some public ones. Now my nextcloud and whole server can be hacked in no-time. So blocking access seems the best solution for now.

So the question is: where and how can I set rules to allow only trusted ip’s for nextcloud or the server in general?

Thanks in advance

Now that I think about it, this might be impossible. My domain is trusted, so anyone can access it by going through the domain.

So unless there is a possibility to filter out ip’s that are coming from visitors using my domain, it’s impossible.

You could configure your webserver to allow access only for specific IPs.

google: “iptables tutorial”

your visitors using your domain name to resolve the ip address of your server. but they use the ip address given to them by their isp. and to filter everyone else out you have to know them in advance.

I will try that thanks

Yes, or deny all and allow some.

Configuring it in the server software seems like a good idea. And to prevent searching for ports/apps other than the webserver iptables should be set.

What software did you use to test?

You can use ConfigServer Security&Firewall (csf) to set blocks to your server.

lynis, debsecan and nikto

1 Like