Field level encryption #905
butterz21217
started this conversation in
Ideas
Replies: 1 comment
-
Hello. Yes, it's seems a good feature to add into Dynamoid. It can have API similar to Rails' (see https://guides.rubyonrails.org/active_record_encryption.html). By the way doesn't a custom type/adapter solve the issue with callbacks and persisting methods that don't run them? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
First of all, love this gem. We use it all the time in our projects, makes working with DynamoDB much easier.
In recent times, we've had more and more uses for encrypting PII that we need to store in our databases. So far the cleanest solution I've managed to come up with looks a little like this:
As you can see, what's happening here is that I'm taking advantage of the
alias
property so that consumers of the model need only think about interacting withsuper_secret
, but in the DB the encrypted attribute is stored againstsuper_secret_cipher_text
(this probably isn't necessary, but reminds me when I look in the DB that I'm seeing encrypted data).This is all fine as long as other developers don't use methods on the model that skips the callbacks (e.g. upsert), otherwise data could end up being stored in plain text.
What I'd love to see in Dynamoid is an option where you can specify a field to be encrypted, and the dynamoid config takes an encryption method and decryption method. e.g.
Would love some feedback on how others are handling encrypted data with Dynamoid, and if something like this is going to be considered a feature in the future.
Beta Was this translation helpful? Give feedback.
All reactions