fix(kms): Duplicate KMS startup metadata labels across multiple KMS blocks#6627
Draft
anilvpatel wants to merge 3 commits into
Draft
fix(kms): Duplicate KMS startup metadata labels across multiple KMS blocks#6627anilvpatel wants to merge 3 commits into
anilvpatel wants to merge 3 commits into
Conversation
…e differentiation
ChandraSGadde
approved these changes
Apr 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Fixes incorrect duplicate KMS metadata in Boundary server startup output when multiple KMS blocks of the same provider are configured (for example, Azure Key Vault root, worker-auth, and recovery blocks).
Address Issue: #4236
Description:
During startup, the Boundary controllers and workers write a few log lines which include the names of the keys that are in use. When using more than one block of the same provider (expect AEAD) with different purpose. There is a bug that will only output the name of the last configured key, instead of all names.
For controller config:
run
boundary server -config controller.hclExample output from my controller:
Root-Cause:
Boundary passed shared startup info containers (b.InfoKeys and b.Info) directly into configutil.ConfigureWrapper() for every configured KMS block.
For providers like Azure Key Vault, multiple KMS blocks emit the same display labels, such as: Azure Environment, Azure Vault Name, Azure Key Name. go-secure-stdlib/configutil/kms.go
Because
b.Infois a map, later KMS blocks overwrote earlier values for the same label, while b.InfoKeys continued appending duplicate keys. This caused startup output to print the same label multiple times, all resolving to the last configured value.This was a startup info rendering bug only. It did not affect KMS purpose assignment or runtime wrapper usage.
Solution:
Collect KMS metadata per wrapper in temporary local structures, then merge it into b.InfoKeys / b.Info after all KMS blocks have been processed.
When duplicate display labels are detected, qualify them with KMS purpose (and ordinal when the same purpose appears multiple times ex: downstream-worker-auth), so the printed keys remain unique.
For example:
[Root] Azure Key Name
[Worker-Auth] Azure Key Name
[Recovery] Azure Key Name
This keeps startup output accurate without changing runtime KMS behavior.

Scope:
This fix is provider-agnostic and applies to any KMS wrapper type that emits repeated display labels across multiple configured KMS blocks.
Why not fix upstream in configutil?
This was fixed in Boundary rather than configutil because duplicate resolution is a cross-block display concern. configutil only has per-wrapper context, while Boundary has the full set of configured KMS blocks, purposes, and repeated-purpose counts needed to generate stable, unique startup labels.
Tests
Added regression coverage for: