-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Client-side encryption with presigned URLs #3066
Comments
I'm trying to understand this use case a bit more - so you are creating S3 presigned urls for PutObject and GetObject and providing those to a user who then performs their own client side encryption, and uses the presigned put object request to store it to your bucket. I'm not sure that requires the S3 Encryption client - users are free to encrypt/decrypt their objects using whatever libraries/keys they want and nothing need change in how you create the s3 get/put object presigned urls. |
That is exactly the use case. However I'm operating under an assumption that s3 does some sort of enveloping (an assumption informed by documentation), and I'd rather not have to reverse-engineer / re-impliment this enveloping. |
S3 doesn't do any of the enveloping, its all client side. But the envelop requires either a second get/put object request OR additional metadata headers - both of these I think would not work with presigned urls (eg: it would require you to know the details of the users envelop so that you could correctly presign either 1 or 2 urls to send them), so it may be better for users to BYO encryption (thus requiring you to know nothing about it). |
ah, I see. Is there a way to encrypt-while-uploading with a KMS key as you describe? One of the advantages to the encryption client is that I don't have to encrypt the whole thing in memory / on disk before upload, and it just does the encryption while it uploads. Right now I'm doing my own chunk-based loop with async, which is pretty detail oriented and manual. |
Presigned URLs are typically for GET but they can be used for presigned POST or PUT, but to do so, you have to supply the body in a separate request. That's why Alex was suggesting you bring your own encryption. I don't think this is possible to support. The only thing I could maybe think of is creating an encryption client with the :endpoint as your presigned url, setting :sigv4_signer to nil (undocumented and private option that we have) and maybe try doing a put object? Otherwise the logic you have is what is recommended. There are also service side encryption features you can use. |
@mullermp what you describe with Service side encryption would not fulfill my purpose. |
:endpoint is a public option but :sigv4_signer is not. Since the url is already signed, that's why I am suggesting to set that to nil to disable signing and see what happens. |
Yeah, its definitely worth trying the If it doesn't work, you could consider using the |
@mullermp I cannot locate @alextwoods I'll try it. the Ideally though I could also support using KMS keys (from a different AWS account than the s3 bucket, for clarity). Now that I know about the |
|
This issue is now closed. Comments on closed issues are hard for our team to see. |
Describe the feature
Identical to this request in the Java SDK: aws/aws-sdk-java-v2#464
I would like to be able to pass a presigned URL to the s3 encryption client and it will use the configured encryption materials to encrypt/decrypt the object.
Use Case
Want to use client-side encryption when giving presigned URLs to a frontend (CLI frontend in my case) so that my infrastructure has no ability to read the contents of the upload (the goal is only the uploader has this information).
Proposed Solution
Allow the encryption client to take a presigned URL in the
put_object
andget_object
methods.Other Information
No response
Acknowledgements
SDK version used
3.201.1
Environment details (OS name and version, etc.)
macOS Sonoma 14.5
The text was updated successfully, but these errors were encountered: