8000 fix: using resourceVersion instead of data for secret hashing by shawkins · Pull Request #55795 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

fix: using resourceVersion instead of data for secret hashing - #55795

Open
shawkins wants to merge 1 commit into
keycloak:mainfrom
shawkins:iss55543
Open

shawkins wants to merge 1 commit into
keycloak:mainfrom
shawkins:iss55543

Conversation

@shawkins
@shawkins shawkins commented Dec 3, 2026 •
Copy link
Copy Markdown
Contributor

closes: #55543

This will trigger a rollout when the operator is upgraded, but that is not something we have added to the notes previously.

An upgrade note could be added about the potential for more frequent rollouts / application of oidc clients and / or For those that want to prevent those additional events, we could also consider adding support for a Secret annotation that directs the operator to use sha-256 instead - it's also possible to consider tls secrets safe to hash.

Other alternatives:

  • a separate secret to hold the hash or salts - adds a good bit of complexity and potentially another dependent resource
  • an annotation on the Secret to hold a salt - the operator does not own the Secrets, we had prior issues with the operator making modifications to them triggering additional issues in customer environments

Copilot AI 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.

🟡 Changes recommended

The existing Secret-watch test contradicts the new resourceVersion behavior and will fail, while controller-level tests are missing for OIDC hash safety and decoded credential propagation.

2 open issues
What changed in this PR

Addresses #55543 by replacing Secret-data-derived digests with resource-version-based hashes in the Keycloak Operator.

Changes:

  • Tracks Secret changes using metadata rather than credential contents.
  • Computes OIDC status hashes before inlining credentials.
  • Adds hashing tests and documents metadata-triggered rollouts.
File Description
operator/​src/​test/​java/​org/​keycloak/​operator/​testsuite/​unit/​WatchedResourcesTest.java Tests Secret hash independence from data.
operator/​src/​main/​java/​org/​keycloak/​operator/​Utils.java Hashes Secret names and resource versions.
operator/​src/​main/​java/​org/​keycloak/​operator/​controllers/​KeycloakSAMLClientController.java Adapts to the prepared-client result.
operator/​src/​main/​java/​org/​keycloak/​operator/​controllers/​KeycloakOIDCClientController.java Hashes before inserting Secret values.
operator/​src/​main/​java/​org/​keycloak/​operator/​controllers/​KeycloakClientBaseController.java Supports controller-provided status hashes.
docs/​guides/​operator/​advanced-configuration.adoc Documents rollouts on Secret metadata updates.

Review effort: Balanced

closes: keycloak#55543

Signed-off-by: Steve Hawkins <shawkins@redhat.com>
@shawkins
shawkins marked this pull request as ready for review December 3, 2026 20:13
@shawkins
shawkins requested review from a team as code owners December 3, 2026 20:13
Copilot AI balanced review requested due to automatic review settings December 3, 2026 20:13
Copilot AI 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.

🟢 Approval recommended

No active review issues are reported for the change from Secret-content hashing to identity- and resource-version-based hashing.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

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.

[CVE-2026-136451] Operator publishes Secret-derived digests in StatefulSet annotations and OIDC client status

2 participants

0