Skip to content

feat(s3): add blockedEncryptionTypes field to s3.Bucket#37047

Merged
mergify[bot] merged 15 commits intoaws:mainfrom
ysthakur:blocked-encryption-types
Mar 19, 2026
Merged

feat(s3): add blockedEncryptionTypes field to s3.Bucket#37047
mergify[bot] merged 15 commits intoaws:mainfrom
ysthakur:blocked-encryption-types

Conversation

@ysthakur
Copy link
Copy Markdown
Contributor

@ysthakur ysthakur commented Feb 21, 2026

Issue

Closes #36988.

Reason for this change

S3 recently added a new BlockedEncryptionTypes field to server-side encryption rules (docs). This field allows users to explicitly block or unblock SSE-C encryption on their bucket.

Users should be able to set this field through CDK. This will become especially important when SSE-C starts being blocked by default in April (blog post).

Description of changes

Added a blockedEncryptionTypes field to the L2 s3.Bucket construct.

  • If blockedEncryptionTypes is not set, behavior is same as before. No default blockedEncryptionTypes value will be chosen (this is important, we want to let S3 choose what default to apply).
  • If blockedEncryptionTypes is set and encryptionType is BucketEncryption.UNENCRYPTED, a server-side encryption configuration will be added with just blockedEncryptionTypes
    • This happens even if bucketKeyEnabled is explicitly set. Please confirm that this is behavior you want. I went with it because bucketKeyEnabled is already ignored when encryptionType is BucketEncryption.UNENCRYPTED.

Describe any new or updated permissions being added

N/A

Description of how you validated changes

Ran unit tests, added integ tests.

  • Verified that the MySsecBlockedBucket bucket has SSE-C blocked (and no default server-side encryption type explicitly set)
  • Verified that the MyKmsBucket bucket has no encryption types blocked

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions bot added beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 labels Feb 21, 2026
* Encryption types that should be blocked for this bucket. Use `NONE` to allow all
* encryption types.
*
* @default - Amazon S3 determines which encryption types to block.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this isn't a particularly helpful comment, but I wrote this because the default is going to change soon. Right now, no encryption types are blocked by default, but in April, SSE-C will start being blocked by default. When that happens, we can update this to say @default - SSE-C is blocked by default.

An alternative is to say @default - no encryption types are blocked, but SSE-C will start being blocked in April 2026, but putting times in doc comments feels wrong.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any documentation for this at the moment? Like a link we can add here so the users can see which types will be blocked by default by S3? IF there is, you could add a

@see <LINK TO OFFICIAL DOC>

@ysthakur ysthakur marked this pull request as draft February 21, 2026 01:31
@ysthakur ysthakur marked this pull request as ready for review February 21, 2026 01:38
@ysthakur
Copy link
Copy Markdown
Contributor Author

Any idea why the PR Linter workflow is failing with "Bad credentials"?

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 21, 2026

⚠️ Experimental Feature: This security report is currently in experimental phase. Results may include false positives and the rules are being actively refined.
This security report is NOT a review blocker. Please try merge from main to avoid findings unrelated to the PR.


TestsPassed ✅SkippedFailed
Security Guardian Results24 ran24 passed
TestResult
No test annotations available

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 21, 2026

⚠️ Experimental Feature: This security report is currently in experimental phase. Results may include false positives and the rules are being actively refined.
This security report is NOT a review blocker. Please try merge from main to avoid findings unrelated to the PR.


TestsPassed ✅SkippedFailed
Security Guardian Results with resolved templates24 ran24 passed
TestResult
No test annotations available

Copy link
Copy Markdown
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This review is outdated)

@ysthakur ysthakur changed the title feat(aws-s3): Add blockedEncryptionTypes field to s3.Bucket feat(s3): add blockedEncryptionTypes field to s3.Bucket Feb 23, 2026
@aws-cdk-automation aws-cdk-automation dismissed their stale review February 23, 2026 16:33

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

Copy link
Copy Markdown

@nikhil1699 nikhil1699 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !

@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Mar 2, 2026
@mergify mergify bot dismissed alvazjor’s stale review March 18, 2026 17:45

Pull request has been modified.

@alvazjor alvazjor added the pr/needs-integration-tests-deployment Requires the PR to deploy the integration test snapshots. label Mar 19, 2026
@alvazjor alvazjor temporarily deployed to deployment-integ-test March 19, 2026 10:08 — with GitHub Actions Inactive
@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Mar 19, 2026
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Mar 19, 2026

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Mar 19, 2026

Merge Queue Status

  • Entered queue2026-03-19 11:29 UTC · Rule: default-squash
  • Checks started · in-place · dashboard
  • 🟠 Running checks
  • ⏳ Merge · ETA: 2026-03-19 16:34 UTC 🚀
Required conditions to merge
Required conditions to stay in the queue
  • -closed [📌 queue requirement]
  • -conflict [📌 queue requirement]
  • -draft [📌 queue requirement]
  • any of [📌 queue -> configuration change requirements]:
    • -mergify-configuration-changed
    • check-success = Configuration changed
  • any of [📌 queue requirement]:
    • check-neutral = Mergify Merge Protections
    • check-skipped = Mergify Merge Protections
    • check-success = Mergify Merge Protections
  • any of [🔀 queue conditions]:
    • all of [📌 queue conditions of queue default-squash]:
      • #approved-reviews-by >= 1 [🛡 GitHub branch protection]
      • #approved-reviews-by>=1
      • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
      • #changes-requested-reviews-by=0
      • -approved-reviews-by~=author
      • -closed
      • -label~=(blocked|do-not-merge|no-squash|priority-pr)
      • -merged
      • -title~=(WIP|wip)
      • base!=release
      • check-success=build
      • check-success=validate-pr
      • any of:
        • -label~=pr/needs-integration-tests-deployment
        • check-success=Deploy integration test snapshots (requires pr/needs-integration-tests-deployment label)
      • any of [🛡 GitHub branch protection]:
        • check-success = validate-pr
        • check-neutral = validate-pr
        • check-skipped = validate-pr
      • any of [🛡 GitHub branch protection]:
        • check-success = build
        • check-neutral = build
        • check-skipped = build
    • all of [📌 queue conditions of queue default-merge]:
      • label~=no-squash
      • #approved-reviews-by >= 1 [🛡 GitHub branch protection]
      • #approved-reviews-by>=1
      • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
      • #changes-requested-reviews-by=0
      • -approved-reviews-by~=author
      • -closed
      • -label~=(blocked|do-not-merge)
      • -merged
      • -title~=(WIP|wip)
      • check-success=build
      • check-success=validate-pr
      • any of:
        • -label~=pr/needs-integration-tests-deployment
        • check-success=Deploy integration test snapshots (requires pr/needs-integration-tests-deployment label)
      • any of [🛡 GitHub branch protection]:
        • check-success = validate-pr
        • check-neutral = validate-pr
        • check-skipped = validate-pr
      • any of [🛡 GitHub branch protection]:
        • check-success = build
        • check-neutral = build
        • check-skipped = build
    • all of [📌 queue conditions of queue priority-squash]:
      • label~=priority-pr
      • #approved-reviews-by >= 1 [🛡 GitHub branch protection]
      • #approved-reviews-by>=1
      • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
      • #changes-requested-reviews-by=0
      • -approved-reviews-by~=author
      • -closed
      • -label~=(blocked|do-not-merge|no-squash)
      • -merged
      • -title~=(WIP|wip)
      • base!=release
      • check-success=build
      • check-success=validate-pr
      • any of:
        • -label~=pr/needs-integration-tests-deployment
        • check-success=Deploy integration test snapshots (requires pr/needs-integration-tests-deployment label)
      • any of [🛡 GitHub branch protection]:
        • check-success = validate-pr
        • check-neutral = validate-pr
        • check-skipped = validate-pr
      • any of [🛡 GitHub branch protection]:
        • check-success = build
        • check-neutral = build
        • check-skipped = build

@mergify mergify bot requested a deployment to deployment-integ-test March 19, 2026 16:04 Waiting
@alvazjor alvazjor removed the pr/needs-integration-tests-deployment Requires the PR to deploy the integration test snapshots. label Mar 19, 2026
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Mar 19, 2026

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 262e8a7 into aws:main Mar 19, 2026
28 of 30 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 19, 2026
@ysthakur ysthakur deleted the blocked-encryption-types branch March 23, 2026 01:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(aws-s3): Add blockedEncryptionTypes field to L2 s3.Bucket construct

5 participants