You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it would be really cool if i could store a secret key in my Stitch Data integration and then have this tap decrypt files transparently
from the official AWS ruby SDK: [1] (edited for clarity)
# just a random secret for now, but you get the idea
require 'openssl'
key = OpenSSL::PKey::RSA.new(1024)
# encryption client
s3 = Aws::S3::Encryption::Client.new(encryption_key: key)
# round-trip an object, encrypted/decrypted locally
s3.put_object(bucket:'aws-sdk', key:'hipaa.csv', body:'lots,of,health,data')
s3.get_object(bucket:'aws-sdk', key:'hipaa.csv').body.read
#=> 'lots,of,health,data'
# reading encrypted object without the encryption client
# results in the getting the cipher text
Aws::S3::Client.new.get_object(bucket:'aws-sdk', key:'hipaa.csv').body.read
#=> "... cipher text ..."
There is apparently a port of this to Python [1] but its example is significantly less clear, so I won't mention it, even though it's probably what you would want to use since taps are written in python.
Key things:
(at least in Rubyland) it decrypts the file in a streaming manner, which I imagine is a requirement for taps (you don't want to pull the whole file locally just to read it)
we don't want to involve AWS KMS. We just want to store a secret at https://app.stitchdata.com in the integration configuration
Hi @seamusabshere, that's an interesting idea! If you want to make the changes locally, test, and submit a PR, we would consider merging it and adding the corresponding field on the integration's settings page.
I arrived here because I'm actually interested in adding support for KMS encryption on the target side, for target-s3-csv. I think it's a great addition if both can support server-side encryption. I'll post back here if I have updates on that front.
I imagine the code to accomplish both is very similar, and would be great if the settings/config needed on both side are similar or identical.
UPDATE:
After further research, I've found that KMS decryption occurs transparently as long as the user has access to the applied KMS key. In that case, we probably can accomplish KMS integration without any change to this tap (feel free to correct me if that doesn't seem correct).
it would be really cool if i could store a secret key in my Stitch Data integration and then have this tap decrypt files transparently
from the official AWS ruby SDK: [1] (edited for clarity)
There is apparently a port of this to Python [1] but its example is significantly less clear, so I won't mention it, even though it's probably what you would want to use since taps are written in python.
Key things:
[1] https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/S3/Encryption.html
[2] https://github.com/boldfield/s3-encryption (see issue boldfield/s3-encryption#9 for a slight clarification)
The text was updated successfully, but these errors were encountered: