Skip to content

[release-5.0] OCPBUGS-132619: Generate session-secret for all auth types - #1247

Open
openshift-cherrypick-robot wants to merge 2 commits into
openshift:release-5.0from
openshift-cherrypick-robot:cherry-pick-1204-to-release-5.0
Open

openshift-cherrypick-robot wants to merge 2 commits into
openshift:release-5.0from
openshift-cherrypick-robot:cherry-pick-1204-to-release-5.0

Conversation

@openshift-cherrypick-robot

Copy link
Copy Markdown

This is an automated cherry-pick of #1204

/assign jhadvig

jhadvig and others added 2 commits October 20, 2026 20:48
Previously the console-operator only generated session encryption keys
for OpenShift OAuth. This change generates session secrets for all auth
types (including OIDC and disabled) so that the console can persist
sessions across pod restarts regardless of the authentication method.

The session secret includes encryption (AES-256) and authentication
(HMAC-SHA256) keys, plus previous-generation keys for graceful rotation
during rolling updates. Key rotation preserves valid previous keys —
a malformed current key will not overwrite an existing valid previous
key.

The config builder now writes all four key file paths
(cookieEncryptionKeyFile, cookieAuthenticationKeyFile, and their
previous counterparts) into the console-config for both OpenShift and
OIDC auth types.
AuthConfig() is the single source of truth for session key paths.
Remove redundant fallback defaults from session() method and update
test expectations accordingly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification

This PR uses the pipeline controller for second-stage tests. Selection and triggering follow the repository configuration.

Use /test ? to list jobs and /pipeline help for commands.

@coderabbitai

coderabbitai Bot commented Oct 20, 2026

Copy link
Copy Markdown

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: Enterprise
  • Run ID: 0304d209-c55f-49a4-a990-221f932f942a

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 TheRealJon and jhadvig October 20, 2026 20:50
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@openshift-cherrypick-robot: Jira Issue OCPBUGS-71237 has been cloned as Jira Issue OCPBUGS-132619. Will retitle bug to link to clone.
/retitle [release-5.0] OCPBUGS-132619: Generate session-secret for all auth types

Details

In response to this:

This is an automated cherry-pick of #1204

/assign jhadvig

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.

@openshift-ci

openshift-ci Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: openshift-cherrypick-robot
Once this PR has been reviewed and has the lgtm label, please assign spadgett for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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 changed the title [release-5.0] OCPBUGS-71237: Generate session-secret for all auth types [release-5.0] OCPBUGS-132619: Generate session-secret for all auth types Oct 20, 2026
@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Oct 20, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@openshift-cherrypick-robot: This pull request references Jira Issue OCPBUGS-132619, which is invalid:

  • release note text must be set and not match the template OR release note type must be set to "Release Note Not Required". For more information you can reference the OpenShift Bug Process.

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

This is an automated cherry-pick of #1204

/assign jhadvig

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.

@jhadvig

jhadvig commented Oct 20, 2026

Copy link
Copy Markdown
Member

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Oct 20, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@jhadvig: This pull request references Jira Issue OCPBUGS-132619, which is valid. The bug has been moved to the POST state.

7 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)
  • release note text is set and does not match the template
  • dependent bug Jira Issue OCPBUGS-71237 is in the state Verified, which is one of the valid states (MODIFIED, ON_QA, VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA))
  • dependent Jira Issue OCPBUGS-71237 targets the "5.1.0" version, which is one of the valid target versions: 5.1.0
  • bug has dependents
Details

In response to this:

/jira refresh

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.

@jhadvig

jhadvig commented Oct 21, 2026

Copy link
Copy Markdown
Member

OCPBUGS-132619 Session Persistence - Verification Results

Tested on a live cluster (ci-ln-r0b2cgk-72292) built from this PR + console PR openshift/console#17407.

Test Description Result
Test 1 kubeadmin session persists through console pod restart ✅ PASSED
Test 2 htpasswd user session persists through console pod restart ✅ PASSED
Test 3 OAuth logout clears session, no ghost recovery ✅ PASSED
Test 4 Keycloak OIDC setup (realm, client, testuser) ✅ COMPLETED
Test 5 OIDC testuser session persists through console pod restart ✅ PASSED
Test 6 OIDC logout clears both console session and IdP session ✅ PASSED

Test details

  • Session persistence (Tests 1, 2, 5): Logged in, verified dashboard loads, deleted all console pods via oc delete pods -n openshift-console -l component=ui, waited for rollout, reloaded the page. Dashboard loaded without re-login in all cases.
  • Logout (Tests 3, 6): After clicking Log out, navigating back to the console URL redirected to the login page. No ghost session recovery. For OIDC (Test 6), logout also cleared the Keycloak IdP session (redirected to Keycloak login, not auto-logged in via SSO).
  • htpasswd setup (Test 2): Configured htpasswd IDP via oauth/cluster.
  • OIDC setup (Test 4): Deployed Keycloak on the cluster, configured authentication.config.openshift.io with type: OIDC, waited for kube-apiserver rollout across all 3 nodes.

All tests passed 👍

@jhadvig

jhadvig commented Oct 21, 2026

Copy link
Copy Markdown
Member

/verified by @jhadvig

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Oct 21, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

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

Details

In response to this:

/verified by @jhadvig

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.

@jhadvig

jhadvig commented Oct 21, 2026

Copy link
Copy Markdown
Member

/pipeline required

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e-aws-console
/test e2e-aws-operator
/test e2e-azure-ovn-upgrade
/test e2e-gcp-ovn

@jhadvig

jhadvig commented Oct 21, 2026

Copy link
Copy Markdown
Member

/retest

1 similar comment
@jhadvig

jhadvig commented Oct 22, 2026

Copy link
Copy Markdown
Member

/retest

@openshift-ci

openshift-ci Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

@openshift-cherrypick-robot: The following tests 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-operator 8077d70 link true /test e2e-aws-operator
ci/prow/e2e-azure-ovn-upgrade 8077d70 link true /test e2e-azure-ovn-upgrade
ci/prow/e2e-gcp-ovn 8077d70 link true /test e2e-gcp-ovn
ci/prow/e2e-aws-console 8077d70 link true /test e2e-aws-console

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants