feat(objectstore): Add AWS SSE-KMS encryption support for S3 storage#57623
feat(objectstore): Add AWS SSE-KMS encryption support for S3 storage#57623cuppett wants to merge 1 commit intonextcloud:masterfrom
Conversation
0f7fb85 to
ef987d4
Compare
4e657a9 to
f734731
Compare
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
Add support for Server-Side Encryption with AWS Key Management Service (SSE-KMS) for S3 object storage. This allows Nextcloud to encrypt data at rest in S3 using AWS-managed keys. Key features: - New config options: sse_kms_enabled and sse_kms_key_id - Backward compatible with existing SSE-C (customer-provided keys) - SSE-C takes precedence when both SSE-C and SSE-KMS are configured Implementation details: - Added getServerSideEncryptionParameters() method to centralize encryption parameter logic for both SSE-C and SSE-KMS - Updated multipart uploads to use unified encryption parameters - Added comprehensive PHPUnit tests for SSE-KMS scenarios - Tested with AWS bucket and KMS keys in us-east-1 region Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com> Signed-off-by: Stephen Cuppett <steve@cuppett.com>
2f60d61 to
fe1c9c5
Compare
|
@icewind1991 Can this be reviewed or merged? This allows Nextcloud to drive which KMS key is used for server-side encryption (within S3). An AWS S3 bucket can be configured with a default key and mandatory encryption; however, this allows multiple nextcloud instances/tenants (potentially under different IAM user/roles) to share the same bucket with different prefixes and logical isolation with permission to different keys. |
|
Also note, while preserved functionality here, AWS will remove SSE-C on April 6, 2026. We can do a separate PR to remove this (in some version) and then the existing logic can be refactored out: |
Summary
Add support for Server-Side Encryption with AWS Key Management Service (SSE-KMS) for S3 object storage. This allows Nextcloud to encrypt data at rest in S3 using AWS-managed keys.
Key Features
sse_kms_enabledandsse_kms_key_idImplementation Details
getServerSideEncryptionParameters()method to centralize encryption parameter logic for both SSE-C and SSE-KMSS3SSEKMSTest.php) for SSE-KMS scenariosConfiguration Example
Testing
Manual Testing
Validated both SSE-KMS and SSE-C encryption with comprehensive file upload/download tests:
SSE-KMS Testing:
SSE-C Backward Compatibility Testing:
PHPUnit Tests
Files Changed
🤖 Generated with Claude Code