-
Notifications
You must be signed in to change notification settings - Fork 747
OCPBUGS-71237: Persist console sessions across pod restarts #16911
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jhadvig
wants to merge
9
commits into
openshift:main
Choose a base branch
from
jhadvig:OCPBUGS-71237
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
8c83365
OCPBUGS-71237: Persist console sessions across pod restarts
jhadvig 9d72995
OCPBUGS-71237: Address security review findings
jhadvig e200791
OCPBUGS-71237: Add e2e test for session persistence
jhadvig 8afcc78
OCPBUGS-71237: Add access token recovery cookie for OpenShift auth
jhadvig ae77e5e
OCPBUGS-71237: Fix CI lint failures
jhadvig 5d9e366
OCPBUGS-71237: Handle missing session key files gracefully
jhadvig 07b0832
OCPBUGS-71237: Address CodeRabbit review findings
jhadvig 60c662a
OCPBUGS-71237: Support graceful cookie encryption key rotation
jhadvig aac1845
Fix formatting issues causing build failure
rhamilto File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
Repository: openshift/console
Length of output: 35701
Broken Authentication (CWE-613): Insufficient Session Expiration
Reachability: External · Exploitability: Moderate
Return an error when refresh-token revocation fails.
OAuthAuthorizeTokens().Deleteerrors are logged, but the handler still deletes the local session and returns204. A copied refresh-token cookie can remain valid. Return a failure response and add a test for this path.🤖 Prompt for AI Agents
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: openshift/console
Length of output: 20240
🏁 Script executed:
Repository: openshift/console
Length of output: 3274
Broken Authentication (CWE-613): Insufficient Session Expiration
Reachability: External
Clear the session when access-token revocation fails.
When
OAuthAccessTokens().Deletereturns an error,logoutreturns before refresh-token cleanup ando.sessions.DeleteSession. The refresh-token cookie and server-side session can then reachrefreshSession. Run cleanup on this failure path and preserve the revocation error separately.🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These seem like valid concerns, have you looked into them yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Length of output: 31672
🏁 Script executed:
Length of output: 1403
🏁 Script executed:
Length of output: 37782
@TheRealJon, yes. I reviewed the implementation, the session-store behavior, and the existing tests.Both findings identify valid defects:
If
OAuthAccessTokens().Deletefails,logoutreturns before it callsDeleteSessionandClearRecoveryCookie. The encrypted refresh-token cookie remains available.getLoginStatecan use it to refresh or restore the session.If
OAuthAuthorizeTokens().Deletefails, the remote refresh token can remain valid. The current handler logs the error and returns204.The first finding needs one correction. On a refresh-token revocation failure, the handler must not return before local cleanup. It must expire the local session, refresh-token cookie, and recovery cookie first. It should then return an error response to report that remote revocation failed.
The robust flow is:
204only if both remote revocations succeed.500after local cleanup if either remote revocation fails.There is no existing OpenShift logout test.
pkg/auth/oauth2/auth_test.goonly covers authenticator construction. The change should add failure-path tests that assert both the error response and local cookie/session cleanup.You are interacting with an AI system.