I am hosting the same website in two locations:

  1. A public location https://mysite.com (AWS hosted)
  2. A location on a LAN with local DNS https://mysite.local.

mysite.com is a service which targets users with very poor connectivity and mysite.local is a clone of the same service. My goal is that the local version can serve as a transparent backup when connectivity to mysite.com is poor.

So my user navigates to mysite.com in Chrome. Usually, the content is served from AppCache. In script, it checks if mysite.local is available. If so, if the connection to it is secure. If so, I use mysite.local as the backend for the session (including writing private user data). If not, I attempt to use the public mysite.com.

I'm planning to use openssl to self-sign a CA certificate and use that to produce a certificate for mysite.local. The web server (nginx) accepts only HTTPS requests and uses that cert. I provide steps for my user to add the public key from my CA certificate into their list of trusted CAs. They trust me and have no problem doing this.

I'm aware that an attacker on another LAN network could setup a local DNS and make their own mysite.local, but it would be difficult for them to get a trusted certificate for that domain on my user's device.

Am I putting my user's data at risk with this sort of configuration? How can I improve it?

  • Have you considered putting both machines into a DMZ and cluster them? – Lithilion Dec 5 '18 at 5:49
  • @Lithilion I don't really understand what value that would add. To clarify - mysite.com is hosted in AWS. mysite.local is the only resouce available on the LAN and it is not accessible from outside the LAN (the machine hosting mysite.local is actually the WiFi hotspot providing the LAN). My understanding of a DMZ is that it would protect from external attacks but has no bearing on security within the network. Thanks for the suggestion though! – Kenn Dec 5 '18 at 6:21
  • If a server is in a DMZ, the LAN traffic has to pass the/a firewall/router connecting the DMZ and the LAN. Thats your enhanced security. – Lithilion Dec 5 '18 at 9:48
  • @Lithilion How will a firewall improve TLS security? Furthermore, nothing stops you from having iptables rules in front of nginx. I don't agree on that a DMZ would make any difference with regards to the question that's being asked - which is about TLS. A firewall does not magically imrpove security. – vidarlo Dec 6 '18 at 6:19
  • @vidarlo I edited the question a bit to clarify that I don't particularly care about protecting my server from the network, but rather keeping my user safe when they move to a different LAN. I had a bit of garbage in the question which was maybe confusing the issue. – Kenn Dec 6 '18 at 6:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.