[Feat] Add optional SSE-KMS support for S3 uploads in Companion#6239
[Feat] Add optional SSE-KMS support for S3 uploads in Companion#6239dsantanu wants to merge 9 commits intotransloadit:mainfrom
Conversation
…SE-KMS support for S3 uploads in Companion
…S3_SSE_KMS_KEY_ID
…_AWS_SSE_KMS_KEY_ID to match with existing COMPANION_AWS_BUCKET naming
🦋 Changeset detectedLatest commit: 2603292 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
mifi
left a comment
There was a problem hiding this comment.
Thanks for your PR!
Similar to the acl option, I think this should be implemented also for the s3 controller
And I think we should support it in both standalone and middleware mode, see
Thanks! In our setup, the That said, I understand the point about consistency with I’ll update the PR, adding the same in -S |
|
As my original use case was the remote-provider upload path, which is why I first implemented this in In our setup the
and wire it through standalone config as well. I’ve updated the PR to move this to config-based handling and add support in the s3 controller too. This is implemented consistently for both the uploader path and the s3 controller path, and is exposed in standalone config similarly to |
sure np! I'll stand by. |
|
hi! any further update on this PR? |
|
still waiting for that PR, which is waiting for another pr and release first |
Summary
This PR adds optional SSE-KMS support for Companion S3 uploads.
When enabled, Companion includes
ServerSideEncryption: 'aws:kms'in the S3 upload params, and optionallySSEKMSKeyIdwhen a specific KMS key is configured.Why
Some AWS environments enforce encryption requirements through Service Control Policies (SCPs) and deny
s3:PutObjectunless the request explicitly uses SSE-KMS.In those environments, remote provider uploads handled by Companion can fail with
AccessDeniedunless the S3 upload request includes the required SSE-KMS parameters.This change makes that behavior configurable without affecting existing users by default.
Changes
In
packages/@uppy/companion/src/server/Uploader.js:ServerSideEncryption: 'aws:kms'SSEKMSKeyIdusing environment variables:
COMPANION_ENABLE_AWS_SSE_KMS=trueCOMPANION_AWS_SSE_KMS_KEY_ID=<kms-key-id-or-arn>(optional)Behavior
COMPANION_ENABLE_AWS_SSE_KMS=true, Companion sends SSE-KMS on S3 uploadsCOMPANION_AWS_SSE_KMS_KEY_IDis also set, Companion includes the explicit KMS key id/ARNExample
COMPANION_AWS_SSE_KMS_KEY_IDis optional. If it is omitted, S3 bucket default SSE-KMS configuration can still be used.Notes
This PR only adds optional SSE-KMS support for the Companion S3 upload path. It does not change key-generation behavior or any app-specific upload routing.