Skip to content

[release-4.22] CNTRLPLANE-4024: feat(azure): support managed HSM for KMS encryption - #9437

Merged
openshift-merge-bot[bot] merged 8 commits into
openshift:release-4.22from
hlipsig:cherry-pick-CNTRLPLANE-4025-to-release-4.22
Sep 3, 2026
Merged

openshift-merge-bot[bot] merged 8 commits into
openshift:release-4.22from
hlipsig:cherry-pick-CNTRLPLANE-4025-to-release-4.22

Conversation

@hlipsig

@hlipsig hlipsig commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Backport the complete contents of #9199 to release-4.22, following the release-5.0 backport in #9376.

This adds Azure Managed HSM support for KMS encryption across the API, generated CRDs and clients, CLI, HyperShift Operator, Control Plane Operator, key rotation, documentation, and setup tooling.

Manual conflict resolution

Release-4.22 predates several main-branch API and controller refactors, so conflicts were resolved by retaining the release branch architecture while applying the Managed HSM behavior:

  • Regenerated feature-gated and install CRDs against the release-4.22 API set.
  • Kept the release-4.22 managed-identity KMS construction path while propagating keyVaultType.
  • Added the Managed HSM release-version validation to the pre-framework reconciliation flow.
  • Ported the Managed HSM Azure KMS provider tests to the release-4.22 provider constructor.
  • Preserved release-4.22 feature-gate and envtest files that do not exist on this branch.

Validation

  • UPDATE=true make test
  • make verify generation, update, staticcheck, formatting, and vet targets
  • PYENV_VERSION=3.10.0 PULL_BASE_SHA=upstream/release-4.22 make -j verify-parallel
  • make verify-git-clean
  • Targeted Azure utility, secret encryption, KAS/KMS, re-encryption, and Azure CLI package tests

References

hlipsig and others added 8 commits August 27, 2026 13:09
- Add AzureKMSKeyVaultType to AzureKMSSpec with backward-compatible immutability validation
- Support Public, US Government, China, German, and Bleu Azure clouds
- Accept Managed HSM encryption key URLs and regenerate feature-gated API manifests

Signed-off-by: Hilliary Lipsig <hlipsig@redhat.com>
Commit-Message-Assisted-by: Claude (via Claude Code)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Regenerate install CRDs and validation suites for Managed HSM and sovereign clouds
- Cover immutable vault type transitions and all supported Azure key URL suffixes
- Update the AzureKMSSpec client and vendored HyperShift API types

Signed-off-by: Hilliary Lipsig <hlipsig@redhat.com>
Commit-Message-Assisted-by: Claude (via Claude Code)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Propagate the detected vault type into AzureKMSSpec during cluster creation
- Expose all supported Azure cloud environments in CLI help
- Document Key Vault and Managed HSM encryption key URL formats

Signed-off-by: Hilliary Lipsig <hlipsig@redhat.com>
Commit-Message-Assisted-by: Claude (via Claude Code)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Resolve Key Vault and Managed HSM endpoints across all supported Azure clouds
- Preserve legacy Key Vault fingerprints while distinguishing Managed HSM keys
- Gate Managed HSM on OpenShift 4.22 without masking release resolution failures

Signed-off-by: Hilliary Lipsig <hlipsig@redhat.com>
Commit-Message-Assisted-by: Claude (via Claude Code)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Pass Managed HSM mode to both active and backup Azure KMS provider sidecars
- Use one immutable vault type for active, backup, and rotation target keys
- Preserve legacy Key Vault provider names while distinguishing Managed HSM providers

Signed-off-by: Hilliary Lipsig <hlipsig@redhat.com>
Commit-Message-Assisted-by: Claude (via Claude Code)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Describe supported Azure KMS services, clouds, and minimum OpenShift version
- Regenerate the API reference and aggregated documentation

Signed-off-by: Hilliary Lipsig <hlipsig@redhat.com>
Commit-Message-Assisted-by: Claude (via Claude Code)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Regenerate feature-gated and install CRDs against the release-4.22 API
set after resolving the backport conflicts.

Signed-off-by: Hilliary Lipsig <hlipsig@redhat.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Port the Managed HSM sidecar flag and provider identity tests to the
release-4.22 Azure KMS provider API.

Signed-off-by: Hilliary Lipsig <hlipsig@redhat.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 27, 2026
@openshift-ci-robot

openshift-ci-robot commented Aug 27, 2026 •

Copy link
Copy Markdown

@hlipsig: This pull request references CNTRLPLANE-4025 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the epic to target either version "4.22.0." or "openshift-4.22.0.", but it targets "openshift-5.0" instead.

Details

In response to this:

Summary

Backport the complete contents of #9199 to release-4.22, following the release-5.0 backport in #9376.

This adds Azure Managed HSM support for KMS encryption across the API, generated CRDs and clients, CLI, HyperShift Operator, Control Plane Operator, key rotation, documentation, and setup tooling.

Manual conflict resolution

Release-4.22 predates several main-branch API and controller refactors, so conflicts were resolved by retaining the release branch architecture while applying the Managed HSM behavior:

  • Regenerated feature-gated and install CRDs against the release-4.22 API set.
  • Kept the release-4.22 managed-identity KMS construction path while propagating keyVaultType.
  • Added the Managed HSM release-version validation to the pre-framework reconciliation flow.
  • Ported the Managed HSM Azure KMS provider tests to the release-4.22 provider constructor.
  • Preserved release-4.22 feature-gate and envtest files that do not exist on this branch.

Validation

  • UPDATE=true make test
  • make verify generation, update, staticcheck, formatting, and vet targets
  • PYENV_VERSION=3.10.0 PULL_BASE_SHA=upstream/release-4.22 make -j verify-parallel
  • make verify-git-clean
  • Targeted Azure utility, secret encryption, KAS/KMS, re-encryption, and Azure CLI package tests

References

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: a95bef34-8b4a-4985-92b2-21f3003403e7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@openshift-ci
openshift-ci Bot requested review from jparrill and muraee August 27, 2026 22:45
@openshift-ci openshift-ci Bot added area/api Indicates the PR includes changes for the API area/cli Indicates the PR includes changes for CLI area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release area/documentation Indicates the PR includes changes for documentation area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release area/platform/azure PR/issue for Azure (AzurePlatform) platform and removed do-not-merge/needs-area labels Aug 27, 2026
@codecov

codecov Bot commented Aug 27, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.65854% with 35 lines in your changes missing coverage. Please review.
✅ Project coverage is 36.71%. Comparing base (2f5225b) to head (ad40fdd).
⚠️ Report is 9 commits behind head on release-4.22.

Files with missing lines Patch % Lines
support/azureutil/azureutil.go 83.75% 12 Missing and 1 partial ⚠️
...trollers/hostedcluster/hostedcluster_controller.go 58.62% 11 Missing and 1 partial ⚠️
cmd/infra/azure/create.go 0.00% 2 Missing ⚠️
cmd/infra/azure/destroy.go 0.00% 2 Missing ⚠️
...controllers/hostedcontrolplane/v2/kas/kms/azure.go 90.47% 2 Missing ⚠️
...goperator/controllers/reencryption/reencryption.go 88.23% 2 Missing ⚠️
cmd/cluster/azure/create.go 0.00% 1 Missing ⚠️
...ostedcontrolplane/hostedcontrolplane_controller.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff                @@
##           release-4.22    #9437      +/-   ##
================================================
+ Coverage         36.53%   36.71%   +0.18%     
================================================
  Files               777      777              
  Lines             95363    95484     +121     
================================================
+ Hits              34840    35061     +221     
+ Misses            57682    57580     -102     
- Partials           2841     2843       +2     
Files with missing lines Coverage Δ
...rator/controllers/hostedcontrolplane/v2/kas/kms.go 49.19% <100.00%> (+3.22%) ⬆️
support/secretencryption/fingerprint.go 95.65% <100.00%> (+0.41%) ⬆️
support/secretencryption/keystatus.go 75.75% <100.00%> (ø)
cmd/cluster/azure/create.go 46.62% <0.00%> (-0.10%) ⬇️
...ostedcontrolplane/hostedcontrolplane_controller.go 36.34% <0.00%> (ø)
cmd/infra/azure/create.go 8.33% <0.00%> (ø)
cmd/infra/azure/destroy.go 22.04% <0.00%> (ø)
...controllers/hostedcontrolplane/v2/kas/kms/azure.go 70.15% <90.47%> (+63.29%) ⬆️
...goperator/controllers/reencryption/reencryption.go 72.16% <88.23%> (+2.82%) ⬆️
...trollers/hostedcluster/hostedcluster_controller.go 43.85% <58.62%> (+0.10%) ⬆️
... and 1 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bryan-cox

bryan-cox commented Aug 31, 2026 •

Copy link
Copy Markdown
Member

/retitle [release-4.22] CNTRLPLANE-4024: feat(azure): support managed HSM for KMS encryption

@openshift-ci openshift-ci Bot changed the title [release-4.22] CNTRLPLANE-4025: feat(azure): support managed HSM for KMS encryption [release-4.22] CNTRLPLANE-4024: feat(azure): support managed HSM for KMS encryption Aug 31, 2026
@openshift-ci-robot

openshift-ci-robot commented Aug 31, 2026 •

Copy link
Copy Markdown

@hlipsig: This pull request references CNTRLPLANE-4024 which is a valid jira issue.

Details

In response to this:

Summary

Backport the complete contents of #9199 to release-4.22, following the release-5.0 backport in #9376.

This adds Azure Managed HSM support for KMS encryption across the API, generated CRDs and clients, CLI, HyperShift Operator, Control Plane Operator, key rotation, documentation, and setup tooling.

Manual conflict resolution

Release-4.22 predates several main-branch API and controller refactors, so conflicts were resolved by retaining the release branch architecture while applying the Managed HSM behavior:

  • Regenerated feature-gated and install CRDs against the release-4.22 API set.
  • Kept the release-4.22 managed-identity KMS construction path while propagating keyVaultType.
  • Added the Managed HSM release-version validation to the pre-framework reconciliation flow.
  • Ported the Managed HSM Azure KMS provider tests to the release-4.22 provider constructor.
  • Preserved release-4.22 feature-gate and envtest files that do not exist on this branch.

Validation

  • UPDATE=true make test
  • make verify generation, update, staticcheck, formatting, and vet targets
  • PYENV_VERSION=3.10.0 PULL_BASE_SHA=upstream/release-4.22 make -j verify-parallel
  • make verify-git-clean
  • Targeted Azure utility, secret encryption, KAS/KMS, re-encryption, and Azure CLI package tests

References

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@bryan-cox

Copy link
Copy Markdown
Member

/pipeline required

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aks-4-21
/test e2e-aws-4-21
/test e2e-aks
/test e2e-aws
/test e2e-aws-upgrade-hypershift-operator
/test e2e-azure-aks-external-oidc
/test e2e-azure-self-managed
/test e2e-kubevirt-aws-ovn-reduced
/test e2e-v2-aws

@bryan-cox bryan-cox left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/approve

@jparrill jparrill left a comment •

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.

/approve

EDIT: Ohh yeah it needs an API Approver, then let me tag it with LGTM and then Joel could take a look

@jparrill

jparrill commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Sep 1, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Tests from second stage were triggered manually. Pipeline can be controlled only manually, until HEAD changes. Use command to trigger second stage.

@everettraven everettraven left a comment

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.

Non-blocking note.

Other than that, this LGTM from an API perspective.

/approve for api

// AzureKMSSpec defines metadata about the configuration of the Azure KMS Secret Encryption provider using Azure Key Vault or Managed HSM.
//
// +kubebuilder:validation:XValidation:rule="!has(self.backupKey) || self.backupKey.keyVaultName == self.activeKey.keyVaultName",message="backupKey.keyVaultName must match activeKey.keyVaultName; both keys must reside in the same Key Vault"
// +kubebuilder:validation:XValidation:rule="(has(self.keyVaultType) ? self.keyVaultType : 'KeyVault') == (has(oldSelf.keyVaultType) ? oldSelf.keyVaultType : 'KeyVault')",message="keyVaultType is immutable"

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.

As a note, this rule is only enforceable if the parent field for this type - which appears to be optional - is not removed first.

If the parent field is removed, an end-user can re-apply a different configuration, circumventing this immutability constraint.

In order for true immutability, these types of rules need to be enforced at the highest parent field in the tree that is a required field.

I won't block on this as this has already merged previously, but we should at least make a note of needing to resolve this if we want true immutability here.

@openshift-ci

openshift-ci Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bryan-cox, everettraven, hlipsig, jparrill

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 1, 2026
@hlipsig

hlipsig commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

/verified by @hlipsig

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Sep 1, 2026
@hlipsig

hlipsig commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

/retest

@openshift-ci-robot

Copy link
Copy Markdown

@hlipsig: This PR has been marked as verified by @hlipsig.

Details

In response to this:

/verified by @hlipsig

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@hlipsig

hlipsig commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

/retest

1 similar comment
@hlipsig

hlipsig commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

/retest

@csrwng

csrwng commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

/override ci/prow/e2e-aws-upgrade-hypershift-operator

@openshift-ci

openshift-ci Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

@csrwng: Overrode contexts on behalf of csrwng: ci/prow/e2e-aws-upgrade-hypershift-operator

Details

In response to this:

/override ci/prow/e2e-aws-upgrade-hypershift-operator

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-ci

openshift-ci Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

@hlipsig: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-upgrade-hypershift-operator ad40fdd link true /test e2e-aws-upgrade-hypershift-operator

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@csrwng

csrwng commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

/label backport-risk-assessed

@openshift-ci openshift-ci Bot added the backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. label Sep 3, 2026
@csrwng csrwng added the jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. label Sep 3, 2026
@openshift-merge-bot
openshift-merge-bot Bot merged commit 3004374 into openshift:release-4.22 Sep 3, 2026
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/api Indicates the PR includes changes for the API area/cli Indicates the PR includes changes for CLI area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release area/documentation Indicates the PR includes changes for documentation area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release area/platform/azure PR/issue for Azure (AzurePlatform) platform backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants