Now, anyone could access my tomcat via IP address. Therefore I would like to restrict it by allowing only specific IPs to access my tomcat in windows 10 firewall.
I tried to add the following inbound firewall rule, but still anyone could access my tomcat.
- Profile: All (Domain, Private, Public)
- Enabled: Yes
- Action: Allow the connection
- Override: No
- Program: Any
- Local Address: Any
- Remote Address: x.x.x.x (The allowed IPs)
- Protocol: TCP
- Local Port: 8080
- Remote Port: Any
- Authorized Users: Any
- Authorized Computers: Any
- Authorized Local Principals: Any
- Local User Owner: Any
- Application Package: Any
After some studying and testing, I suspect that one of the existing inbound firewall rule on javaw.exe take precedence over my tomcat firewall rule, which allow anyone to access my tomcat.
- Profile: Private
- Enabled: Yes
- Action: Allow the connection
- Override: No
- Program: javaw.exe
- Local Address: Any
- Remote Address: Any
- Protocol: TCP and UDP
- Local Port: Any
- Remote Port: Any
- Authorized Users: Any
- Authorized Computers: Any
- Authorized Local Principals: Any
- Local User Owner: Any
- Application Package: Any
Do I need to allow javaw.exe connection in firewall for running Tomcat? Are there any ways to enable both tomcat and javaw.exe firewall rules such that I still can restrict specific IPs to access my tomcat?
I knew that I could restrict access by setting RemoteAddrValve in tomcat server.xml, but still according to tomcat security consideration, it is better to set multiple lines of defense. Therefore I still would like to add a firewall rule in the network layer to restrict the tomcat connection. Please help, thanks!