Skip to content

feat:Add Dual Layer Server-Side Encryption via DSSE-KMS#62539

Open
cuppett wants to merge 4 commits into
nextcloud:masterfrom
cuppett:feature/sse-dsse-kms
Open

feat:Add Dual Layer Server-Side Encryption via DSSE-KMS#62539
cuppett wants to merge 4 commits into
nextcloud:masterfrom
cuppett:feature/sse-dsse-kms

Conversation

@cuppett

@cuppett cuppett commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Extends the SSE-KMS support merged in #57623 with AWS DSSE-KMS, and replaces the two
booleans that PR introduced (sse_c_key, sse_kms_enabled) with a single sse mode
argument ('' / sse-s3 / sse-c / sse-kms / sse-kms-dsse), since a third mode
couldn't be added to that config shape without either a second mutually-exclusive
boolean or a discriminator.

  • New sse objectstore argument selects the encryption mode explicitly. sse_c_key
    and sse_kms_enabled remain as deprecated aliases — existing configs keep working
    unchanged, resolved by the same precedence Nextcloud 34 already shipped (SSE-C wins
    if both are set), but the fallback is now logged instead of silent.
  • Adds sse_kms_encryption_context and sse_kms_bucket_key, the two SSE-KMS features
    that make it useful for the multi-tenant case feat(objectstore): Add AWS SSE-KMS encryption support for S3 storage #57623 described (encryption context
    for kms:EncryptionContext policy conditions on a shared bucket; bucket keys for
    KMS request cost reduction).
  • Corrects SSE-C's status: it's deprecated since Nextcloud 34 — Amazon S3 disabled
    SSE-C by default for new buckets in April 2026, which we hit directly during live
    testing against a fresh bucket. Adds a SetupCheck (Settings → Overview) so this is
    actually visible to admins, not just a log line.
  • A docs PR is already open covering the original SSE-KMS/SSE-C-deprecation baseline
    from feat(objectstore): Add AWS SSE-KMS encryption support for S3 storage #57623: docs: document S3 SSE-KMS support and deprecate SSE-C documentation#15375. It predates the sse argument, DSSE-KMS,
    encryption context, and bucket keys added here, so it'll need a follow-up once this
    merges.

Tested against a real AWS bucket + KMS key (all sse modes, cross-mode reads, SSE-C
negative-read path, multipart under DSSE) and against MinIO for the non-AWS regression
path.

TODO

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

cuppett added 3 commits July 25, 2026 09:24
Follow-up to nextcloud#57623 (SSE-KMS). Adds a single `sse` objectstore argument
(none/sse-s3/sse-c/sse-kms/sse-kms-dsse) so DSSE-KMS, encryption context,
and S3 Bucket Keys can be configured without ambiguous or silently
conflicting combinations of booleans. `sse_c_key` and `sse_kms_enabled`
remain as deprecated aliases so existing configs keep working unchanged.

Assisted-by: ClaudeCode:claude-opus-5
Signed-off-by: Stephen Cuppett <steve@cuppett.com>
…t exception

Conflicting sse* arguments now resolve deterministically instead of
throwing: sse_c_key + sse_kms_enabled both set falls back to SSE-C,
matching the behaviour already released in Nextcloud 34, and an
explicit sse argument always overrides the deprecated keys. Every
resolution is recorded and logged once via getConnection(), including
a warning on any SSE-C usage, so the fallback is no longer silent.

sse_kms_bucket_key with sse-kms-dsse also moves from a hard exception
to a warning: verified against a live bucket that S3 accepts the
request and simply does not apply the bucket key, rather than
rejecting it as AWS's own documentation suggests.

Adds a live test suite (S3EncryptionModesLiveTest) exercising the
full sse mode matrix and cross-mode reads against a real AWS bucket
and KMS key, and extends the offline S3ServerSideEncryptionTest with
precedence, warning, and logger-emission coverage.

Assisted-by: ClaudeCode:claude-opus-5
Signed-off-by: Stephen Cuppett <steve@cuppett.com>
The SSE-C deprecation warning added in the previous commit hedged that
upstream hadn't announced a deprecation. That was wrong: SSE-C is
deprecated since Nextcloud 34 because Amazon S3 disabled SSE-C by
default for new buckets in April 2026 (independently reproduced against
a live bucket). Corrects the warning text and a comment that had denied
the deprecation, and adds the admin-facing signal that was missing: a
SetupCheck surfaced in Settings > Overview, following the same
version+reason phrasing convention used elsewhere for deprecated
config values (e.g. FilenameValidator, PhpOutdated).

Assisted-by: ClaudeCode:claude-opus-5
Signed-off-by: Stephen Cuppett <steve@cuppett.com>
@cuppett
cuppett requested a review from a team as a code owner July 25, 2026 16:39
@cuppett
cuppett requested review from Altahrim, leftybournes, provokateurin and salmart-dev and removed request for a team July 25, 2026 16:39
@cuppett cuppett modified the milestone: Nextcloud 35 Jul 25, 2026
@cuppett cuppett changed the title Feature/sse dsse kms feat:Add Dual Layer Server-Side Encryption via DSSE-KMS Jul 25, 2026
Signed-off-by: Stephen Cuppett <steve@cuppett.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant