Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Determine utility of encrypted DB fields #289

Open
brassy-endomorph opened this issue Mar 20, 2024 · 3 comments
Open

Determine utility of encrypted DB fields #289

brassy-endomorph opened this issue Mar 20, 2024 · 3 comments

Comments

@brassy-endomorph
Copy link
Collaborator

We need a threat model to determine whether row-level security like following makes sense

hushline/app.py

Lines 223 to 229 in 2c89aa6

@property
def email(self):
return decrypt_field(self._email)
@email.setter
def email(self, value):
self._email = encrypt_field(value)

My general suspicion is that the model we come up with will not have a meaningful increase in security by this feature and it only adds complexity. We likely want to significantly harden the database and server against exfiltration before we add this in. The app is the only thing interacting with the DB, and RCE is most likely to happen in the app itself (which has access to the decryption keys).

Blocked by #265

@glenn-sorrentino
Copy link
Member

Closing, as this encryption hasn't caused any issues, and we want to encrypt everything. A ticket for hardening the server against exfil should be created if this is a priority, but at-rest encryption is something I want to keep and use as broadly as possible.

@brassy-endomorph
Copy link
Collaborator Author

If you want DB encryption (beyond the drive's FDE), then we likely want to encrypt the whole database. I think this needs to remain open. "Hasn't caused problems yet" isn't sufficient reason to keep this, and the main threat of exfil will be the application process / user itself being compromised in which case it can just read the entire database, env vars, and config itself.

@rmlibre
Copy link
Contributor

rmlibre commented Jul 2, 2024

Encrypting the whole database is a good idea. It's also a good idea to encrypt fields that hold secrets. That way they don't linger around in RAM for longer than needed. Regardless of the practicality of attacks, it's best practice to wipe secrets & key material from memory ASAP.

rmlibre added a commit to rmlibre/hushline that referenced this issue Jul 16, 2024
Add pytest fixture parameterization to test under both dev & production
settings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants