MongoEngine / MongoEngine/mongoengine

Field level encryption support

Open
#1,739 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
4.3k
Forks
1.2k
Avg merge
4h 41m
Merged PRs (30d)
11

Description

Hi,

We're interested in adding field level encryption for documents, ideally just as a new keyword argument passed into the field definition, with an encryption key provided as an argument to the document.

Field definition:

from mongoengine import Document
class MyDocument(Document):

    ENCRYPT_KEY = 'mysupersecretkey'
    foo = StringField()
    bar = StringField(encrypt=True)

I'm happy to take a look at this, looking at the google group history, it doesn't appear a solution has been proposed before. Before I got started, just wanted to confirm this is something that makes sense to work on? I'm also very open to changing the argument names etc!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named; start by locating the StringField and Document implementations referenced in the proposal and tracing their persistence behavior. Establish the encryption and key-handling requirements, then verify that fields marked with encrypt=True are stored encrypted and can be recovered correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
mongodb, python
Domain
databases, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.