Is it possible to setup my web server such that only certain sources can access and the public from internet has no access? i am thinking that we could just not publish our web server URL/IP to our upstream public DNS. And we give the static IP of our web server to the authorized sources to access. Of then, we will have to turn on firewall rules to allow only those sources in to our web server network. Is this thought feasible? thanks
First point: Once your server is on-line, it will be found (even without any DNS name) by robots scanning all possible IP numbers.
There are several possibilities to restrict access to your web server, including:
- Protect the web server with username and password (basic autentification)
- Configure the web server such that only trusted IP numbers (or IP number ranges) are allowed to access it
The manual of your web server should tell you how to do this. I recommend to do this directly in the web server configuration; using the firewall in addition is also feasible (but keep in mind what you have done and what you have to do when you want to change the rules).
How about adding basic credentials to your webserver? So it's only accessible to people who have the credentials.
Or maybe you can consider to use client side SSL certificate so only authorized user can access your webserver. At least you won't messing up with the network or firewall configurations, in case there will be some issue regarding it. This tutorial seems like a good start about it.