Monday, May 8, 2017

Re: sqlite3 database encrytion for Django.

On Monday 08 May 2017 18:29:35 Antonis Christofides wrote:

> Assume Django is running as user 'django' and the db is "db.sqlite3".

>

> If you "chown django db.sqlite3" and "chmod 600 db.sqlite3", only user

> django can access it.

>

> What would you gain by encrypting it?

 

Three things:

1) If the file gets deleted, Django does not recreate it with that mode. Solvable by using a dedicated directory instead of the above.

2) root can't do anything with it nor can daemons that are compromised before switching to unprivileged user.

3) Additional layer in case martians invade earth and other things that should not happen. Not uncommon in high-security environments to defend against the unknown. See for example the requirements FIPS-140 places on access to cryptographic keys, even though we all put them in a directory mode 500 owned by root.

 

But I feel we're going off-topic now.

--

Melvyn Sopacua

No comments:

Post a Comment