Skip to content

CLDSRV-1000: Configure KMSs as a kms array and build a client for every entry - #6330

Merged
bert-e merged 4 commits into
development/9.6from
improvement/CLDSRV-1000-build-kms-client-per-definition
Oct 21, 2026
Merged

bert-e merged 4 commits into
development/9.6from
improvement/CLDSRV-1000-build-kms-client-per-definition

Conversation

@dvasilas

@dvasilas dvasilas commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Context (S3C-11459): Allow a deployment to configure multiple KMSs, one of them the default. Users select a KMS through the key ARN.

This PR makes cloudserver accept several KMS definitions and build a client for each.
Every operation still uses the default KMS: a key whose ARN names another configured KMS is refused, as an unknown ARN is today.


Changes:

  • The configuration format changes, with no compatibility for the old blocks.
    • KMS definitions become an array under the kms key. Federation and Zenko must render the array when they move to cloudserver 9.6.
    • A kmip or kmsAWS key or a kms object in the configuration stops cloudserver at start-up.
  • Environment variables:
    • S3KMS and S3BACKEND select the KMS only when there is no kms array, and the options are mem, file or scality, as today. With the array, S3KMS is ignored (S3BACKEND sets the other backends, but not the KMS).
    • S3KMS=kmip or S3KMS=aws without the array fails at start-up: neither can be configured from the environment alone. A KMIP KMS would have no provider name, so it could not encrypt before this change either, and an AWS KMS would have no endpoint or credentials.
    • The S3KMIP_* variables still apply to the default entry when it is a KMIP entry, with today's precedence: the entry's settings override them, and the entry can take its host from S3KMIP_HOSTS. They never apply to other entries.

The kms array replaces the kmip and kmsAWS blocks. It is optional: without it, S3KMS and S3BACKEND still select mem, file or scality, the KMSs that need no settings.

In this commit only the default entry gets a KMS client; the other entries are validated, and their clients are built in the next commit.

The default config.json drops its kmip and kmsAWS blocks and gets no kms array, so local runs and unit tests select the KMS through S3KMS or S3BACKEND. The kmsAWS block was a placeholder.

The S3KMIP_* environment variables still apply to the default entry when it is a kmip entry: its own settings override them, and it can take its host from S3KMIP_HOSTS. S3KMS=kmip without a kms array now fails at start-up; it could not encrypt anyway, as the key ARNs need a provider name. kmip-ft-tests, which took its provider name from the kmip block, now reads it from a kms entry in its own config file.
… next to the default

Keys naming the other KMSs are refused on PutObject and PutBucketEncryption.
@bert-e

bert-e commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Hello dvasilas,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Available options
name description privileged authored
/after_pull_request Wait for the given pull request id to be merged before continuing with the current one.
/bypass_author_approval Bypass the pull request author's approval ⭐
/bypass_build_status Bypass the build and test status ⭐
/bypass_commit_size Bypass the check on the size of the changeset TBA ⭐
/bypass_incompatible_branch Bypass the check on the source branch prefix ⭐
/bypass_jira_check Bypass the Jira issue check ⭐
/bypass_peer_approval Bypass the pull request peers' approval ⭐
/bypass_leader_approval Bypass the pull request leaders' approval ⭐
/bypass_source_branch_lineage Bypass the cross-branch contamination check ⭐
/approve Instruct Bert-E that the author has approved the pull request. ✍️
/create_pull_requests Allow the creation of integration pull requests.
/create_integration_branches Allow the creation of integration branches.
/no_octopus Prevent Wall-E from doing any octopus merge and use multiple consecutive merge instead
/unanimity Change review acceptance criteria from one reviewer at least to all reviewers
/wait Instruct Bert-E not to run until further notice.
Available commands
name description privileged
/help Print Bert-E's manual in the pull request.
/status Print Bert-E's current status in the pull request.
/clear Remove all comments from Bert-E from the history TBA
/retry Re-start a fresh build TBA
/build Re-start a fresh build TBA
/force_reset Delete integration branches & pull requests, and restart merge process from the beginning.
/reset Try to remove integration branches unless there are commits on them which do not appear on the source branch.

Status report is not available.

@bert-e

bert-e commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Incorrect fix version

The Fix Version/s in issue CLDSRV-1000 contains:

  • None

Considering where you are trying to merge, I ignored possible hotfix versions and I expected to find:

  • 9.6.0

Please check the Fix Version/s of CLDSRV-1000, or the target
branch of this pull request.

@dvasilas
dvasilas requested review from a team, delthas and francoisferrand October 15, 2026 11:30
@codecov

codecov Bot commented Oct 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.71429% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.38%. Comparing base (e7ee82d) to head (acd6437).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
lib/Config.js 87.50% 10 Missing ⚠️
lib/kms/wrapper.js 80.00% 5 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

Files with missing lines Coverage Δ
lib/kms/wrapper.js 82.62% <80.00%> (+8.22%) ⬆️
lib/Config.js 86.85% <87.50%> (+6.02%) ⬆️

... and 4 files with indirect coverage changes

@@                 Coverage Diff                 @@
##           development/9.6    #6330      +/-   ##
===================================================
+ Coverage            87.89%   88.38%   +0.48%     
===================================================
  Files                  206      206              
  Lines                14193    14221      +28     
===================================================
+ Hits                 12475    12569      +94     
+ Misses                1718     1652      -66     
Flag Coverage Δ
checksums-disabled-tests 35.46% <25.71%> (-0.20%) ⬇️
file-ft-tests 71.02% <25.71%> (-0.29%) ⬇️
file-ft-tests-null-compat 71.60% <25.71%> (-0.18%) ⬇️
kmip-ft-tests 27.90% <55.23%> (-0.33%) ⬇️
mongo-v0-ft-tests 72.27% <25.71%> (-0.36%) ⬇️
mongo-v1-ft-tests 72.25% <25.71%> (-0.30%) ⬇️
multiple-backend 36.25% <25.71%> (-0.20%) ⬇️
s3c-ft-tests-v0 66.24% <25.71%> (-0.14%) ⬇️
s3c-ft-tests-v0-null-compat 66.31% <25.71%> (-0.13%) ⬇️
s3c-ft-tests-v1 66.21% <25.71%> (-0.14%) ⬇️
sur-tests 36.81% <25.71%> (-0.20%) ⬇️
sur-tests-inflights 39.72% <25.71%> (-0.21%) ⬇️
unit 75.95% <85.71%> (+0.54%) ⬆️
utapi-v2-tests 35.41% <25.71%> (-0.20%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread lib/kms/wrapper.js
@bert-e

bert-e commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • 2 peers

Comment thread lib/kms/wrapper.js
// if type was extracted, it is a scality arnPrefix, it needs validation
// might throw if arn malformed or backend not available
// for any request (PUT or GET)
const error = validateKeyDetail(detail, availableBackends);

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.

Given scality/Arsenal#2738:

Suggested change
const error = validateKeyDetail(detail, availableBackends, key);

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.

I will do another cloudserver PR to bump Arsenal and make this change.
We will likely need to target cloudserver development/9.5 because it also uses Arsenal 8.6.

Comment thread lib/kms/wrapper.js
// otherwise prepend the current KMS client arnPrefix
if (isScalityKmsArn(configuredMasterKeyId)) {
const detail = extractDetailFromArn(configuredMasterKeyId);
const error = validateKeyDetail(detail, availableBackends);

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.

Same thing here:

Suggested change
const error = validateKeyDetail(detail, availableBackends, configuredMasterKeyId);

@dvasilas
dvasilas added this pull request to stack #6336 October 20, 2026 13:55
@dvasilas

Copy link
Copy Markdown
Contributor Author

/approve

@bert-e

bert-e commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

In the queue

The changeset has received all authorizations and has been added to the
relevant queue(s). The queue(s) will be merged in the target development
branch(es) as soon as builds have passed.

The changeset will be merged in:

  • ✔️ development/9.6

The following branches will NOT be impacted:

  • development/7.10
  • development/7.4
  • development/7.70
  • development/8.8
  • development/9.0
  • development/9.1
  • development/9.2
  • development/9.3
  • development/9.4
  • development/9.5

This pull request does not target the following hotfix branch(es) so they
will be left untouched:

  • hotfix/7.4.4
  • hotfix/7.70.73
  • hotfix/9.0.32
  • hotfix/7.10.27
  • hotfix/7.2.0
  • hotfix/7.10.15
  • hotfix/7.10.28
  • hotfix/7.10.3
  • hotfix/7.10.4
  • hotfix/7.4.8
  • hotfix/7.4.6
  • hotfix/7.4.10
  • hotfix/7.70.21
  • hotfix/6.4.7
  • hotfix/9.0.7
  • hotfix/9.3.13
  • hotfix/7.10.2
  • hotfix/7.10.30
  • hotfix/7.4.1
  • hotfix/7.70.45
  • hotfix/7.4.7
  • hotfix/7.4.9
  • hotfix/7.8.0
  • hotfix/7.70.51
  • hotfix/7.10.8
  • hotfix/7.10.1
  • hotfix/8.8.45
  • hotfix/7.4.3
  • hotfix/7.10.0
  • hotfix/7.70.11
  • hotfix/7.9.0
  • hotfix/9.2.24
  • hotfix/7.10.49
  • hotfix/9.2.36
  • hotfix/7.7.0
  • hotfix/7.4.2
  • hotfix/7.6.0
  • hotfix/7.4.5
  • hotfix/7.4.0

There is no action required on your side. You will be notified here once
the changeset has been merged. In the unlikely event that the changeset
fails permanently on the queue, a member of the admin team will
contact you to help resolve the matter.

IMPORTANT

Please do not attempt to modify this pull request.

  • Any commit you add on the source branch will trigger a new cycle after the
    current queue is merged.
  • Any commit you add on one of the integration branches will be lost.

If you need this pull request to be removed from the queue, please contact a
member of the admin team now.

The following options are set: approve

@bert-e

bert-e commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

I have successfully merged the changeset of this pull request
into targetted development branches:

  • ✔️ development/9.6

The following branches have NOT changed:

  • development/7.10
  • development/7.4
  • development/7.70
  • development/8.8
  • development/9.0
  • development/9.1
  • development/9.2
  • development/9.3
  • development/9.4
  • development/9.5

Please check the status of the associated issue CLDSRV-1000.

Goodbye dvasilas.

@bert-e
bert-e merged commit d5f78c7 into development/9.6 Oct 21, 2026
36 of 37 checks passed
@bert-e
bert-e deleted the improvement/CLDSRV-1000-build-kms-client-per-definition branch October 21, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants