Badger: Support encryption at rest

Created on 20 Mar 2018  Â·  25Comments  Â·  Source: dgraph-io/badger

Hi,
Currently there is no authentication support. It will be a great feature to have.
We are using badger for developing a banking solution and data privacy is a requirement.
Kindly let me know if you can incorporate the security feature.

Regards,
Asim.

aresecurity exexpert kinfeature prioritP2 statuaccepted

Most helpful comment

This feature is planned for Q3 2019.

All 25 comments

I'd like to understand this use case in a bit more detail. Can you please shoot me a mail? My email id is manish, with company domain.

Doing this right would mean building encryption at rest. If other people need this feature, please feel free to upvote. We'll consider making this feature available as an enterprise extension.

@manishrjain - Github doesn't have a voting feature. I assume you are asking people to add a thumbs up reaction? Also, people have a harder time finding closed issues to even vote on. Granted, for those on GitHub, they might not consider it if it's an "enterprise extension".

+1 security at rest is exactly what I need.
The keys should be stored in the local key store. There are a few golang libs that do this for desktops and mobiles.
I use badget on mobile now and it's amazing

Is Encryption at Rest going through a Use case / Scoping stage ?

I am using badger in a prototype and Security at rest is critical for privacy reasons.

If a design RFP document is floating around let me know and i can comment

There's no spec yet.

Ok. Thanks for the feedback. I am working on government projects where
security at rest is mandatory and so can give requirements in general and
architecture approaches if you want.

Anyway .. let me know. Don't want to be pushy pushy :)

On Mon, 11 Jun 2018, 17:48 Manish R Jain, notifications@github.com wrote:

There's no spec yet.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/dgraph-io/badger/issues/443#issuecomment-396290909,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ATuCwu3FrKYPK34hd4SJgTfTvAswf4N0ks5t7pE3gaJpZM4SyS67
.

same req.
but i add a crypto / de-crypto layer over badger, so it work fine.

@tsingson
i was thinking of taking the same approach. Just do the encryption above Badger.
However, that means search will not work because the index is now encrypted ???

What i think has to happen is that the unencrypted data is indexed, and the encrypted data is stored.
SO when querying your hitting the clear data, and that index points to encrypted data.
Then higher app at your application layer all the records you get back you can decrypt.

If anyone has other ideas i would be happy to discuss...

@gedw99 I do not crypto the key. value be crypto only when key-value save to badger.
and a LRU / LFU cache layer over the crypto layer, so it's fast search ( index and shading for Concurrency access ) .

so, it's work stable in business field.

This seems like a valuable addition, a Transparent Data Encryption scheme would probably be the easiest to implement. Encrypting and decrypting data at the file read & write stages, this would solve the problem of someone having access to the file system and copying the database files from disk. The standard go encryption library could be used to implement it, it just a question of how to store the key.

Keep the key in the key store the OS provides ? Just like what VPN clients
do..

On Sun, 1 Jul 2018, 20:13 TandyCorp, notifications@github.com wrote:

This seems like a valuable addition, a Transparent Data Encryption scheme
would probably be the easiest to implement. Encrypting and decrypting data
at the file read & write stages, this would solve the problem of someone
having access to the file system and copying the database files from disk.
The standard go encryption library could be used to implement it, it just a
question of how to store the key.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/dgraph-io/badger/issues/443#issuecomment-401623323,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ATuCwobsJ2FNE-32a8NCuy2Wzwjx8zs0ks5uCRFhgaJpZM4SyS67
.

it just a question of how to store the key.

Keep the key in the key store the OS provides?

No, key management and generation should be caller concerns. If people want to make helpers for management, derivation, etc so be it. Sqlite encryption impls just take a key and rekey (see a Go wrapper I wrote here).

Also since this is pure Go, the crypto algo should be a sensible default but allow callers to provide their own crypto.Block builder.

We'll be working on adding Encryption at Rest in Badger as an open source feature soon. Badger is already providing SSI transactions and great performance, which are ideal for building banking solutions on top of Badger. So, adding encryption seems like a no-brainer.

Looks like RocksDB added that recently. So, we should be able to pick a few pointers from them, if possible: https://github.com/facebook/rocksdb/pull/2424

is this currently in progress/is there an ETA? would love to see this would make badger a perfect fit for a project of mine.

willing to put in work testing/helping develop the feature.

No ETA yet. Technically, it isn't too hard. But, we just have to introduce SSTable caching in Badger to achieve this -- because LSM tree won't work with mmap if encrypted.

If you're interested in contributing, maybe start with an LRU cache for SSTables.

gotcha, well i'll check in once i get to at rest encryption being the main blocker for my project.

Adding this to the possible improvements to be added after v2 has been released.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This issue was marked as stale and no activity has occurred since then, therefore it will now be closed. Please, reopen if the issue is still relevant.

This feature is planned for Q3 2019.

Hi @manishrjain any update on ETA? we'd love to get this sooner than later :)

@balajijinnah is currently working on this in #1020 which has been LGTMed today.

The change should go into master soon and into the next release

Hi all,

This has been implemented and released in BadgerDB v2.0.0, which is available for download (Release | Blog post) . Dgraph users will get encryption in v1.1.1 which is currently in RC (v1.1.1-rc2 announcement | Documentation)

Closing. Please reopen if needed

Thanks,

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jarifibrahim picture jarifibrahim  Â·  7Comments

vrealzhou picture vrealzhou  Â·  4Comments

jackmiller334 picture jackmiller334  Â·  7Comments

Stebalien picture Stebalien  Â·  5Comments

shengery picture shengery  Â·  6Comments