I've searched for documents on securing a database to prevent cyber threats and also comply to new regulations. I found an interesting one by IBM.
https://www.ibm.com/topics/database-security
Berkley's one is particularly interesting as a checklist on what to do, or not.
https://security.berkeley.edu/education-awareness/database-hardening-best-practices
Actually, all cloud providers have similar documents (Google, Microsoft, Amazon, ...) This is all good theories, but on a smaller scale and on a smaller budget, using web hosting kind of forces the developer to do things that are not supposed to be done, ever. For example:
- Isolate the database from the website (front end), not the same server.
- Do not hardcode the database access into the website source code.
- Log database actions, but not in the database's own space.
These are all things that need to be done when you purchase a website hosting account. Perhaps that this is a non-issue if 49% of breaches are because of a human error (stats mentioned in the IBM document), and the rest is perhaps because of zero-day exploits and corrupt employees.
To complexify things, another web hosting account can be purchased from another company so the database is really on a different server, and an HTTPS interface can then be designed as a proxy and a firewall to protect the database. A bad actor might crack the website (front end) account, find out that the database account is on a different account, then try to crack it too. So, only a matter of time for someone with motivation (and money rewards).
So, what do you think? What should be done to protect a database on a shared hosting account?