1

I'm building a website with very sensitive data stored in my database. Losing any of it is not an option, and that's why I'm thinking to do an incremental backup every hour or so. I work on it alone, so I use only one database super-user (am I wrong?). However, I'm not sure even how my database could be damaged. Let's assume that from SQL Injection i'm 100% safe, and that DELETE/UPDATE queries are never performed (that is, by me). So, what else should I worry from? I need to know because I couldn't find explanation, and because only then I'd know if I should backup off-site or on the same server, because if the only option is that my server itself is hacked somehow, what point would it be in saving another backup on it?

  • Answer varies based on architecture, deployment, etc. Perform a proper threat modelling. Don't backup on same server just in case disaster strikes or HDD decides to crash and you don't have RAID. Think of Hot Replication and read about RPO and RTO which are metrics to be considered when thinking of BCP / availability. – Krishna Pandey Dec 13 '17 at 6:16
3

Short answer: hardware failure, programming error, operator error, malevolent actor (all sorts of attacks and "hacking").

Slightly longer answer: The moment you care about your data (anytime other than a testing environment), you should backup your database regularly and keep the backups in a safe location (not the same machine, maybe not even the same datacenter if you want resiliency in the face of network outages). Also be careful to not overwrite your backups with new ones, you don't want to propagate bad data into your backups.

Once you've done all that, you need monitoring that your backups happened properly, verification of your backups, and recovery testing (where you try to restore your backups to make sure your process works).

Hacking is kind of the least of your concerns, the most common problems are programmer/operator error and hardware failure.

  • Thanks for the answer. However my biggest fear is hackers hacking into my server file system or to my database ( I can't think of how though, but I'm sure there are ways unfortunately). And also, should I use third party backup services such as Rackspace, or maybe set up another database instance on amazon aws and programmatically back up to it? – sermonion x Dec 13 '17 at 1:31
  • @sermonionx I thought this was supposed to be "very sensitive data". Remember that there's no such thing as "the cloud" - it's just somebody else's computer. How much do you trust somebody else to keep your data safe? – Simon B Dec 13 '17 at 11:21
  • Why yes, it's very sensitive data. However, losing it is not an option, since it wouldn't be less worse than having it stolen. As for the moment, I can't afford my own data center so I have to store it on amazon or azure or such. I must have backups on another machines so yes, I'm afraid of backup exposure, but what can I do? – sermonion x Dec 13 '17 at 11:38
  • Depending on how sensitive this is, you can either rely on the cloud's security features to prevent access to your backup, or encrypt them. The same applies to the database host, use all the security features available for authentication/authorization and even encryption-at-rest if you can. But again, if losing your data is not an option, you're more likely to lose it due to the other factors mentioned so keep them in mind as well. – Marc Dec 13 '17 at 11:57
  • Thanks. You see, what I have in mind is encrypting certain data before it enters any database, and the key will be hard-coded on my app server script. Is it likely that my script files will be hacked as well? And is it a safe approach, considering that if I lose the script file (or simply the key) somehow, my data would be unrestorable. – sermonion x Dec 13 '17 at 14:52

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.