Skip to content
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

Update session storage to use Redis backend #137

Merged
merged 17 commits into from
Nov 1, 2024

Conversation

markdboyd
Copy link
Contributor

Changes proposed in this pull request:

Related to https://github.com/cloud-gov/private/issues/2015

We have an issue where sessions are sometimes too large to be stored in a cookie. To work around this issue, we are adding Redis to store session data server-side, which should allow session data of any arbitrary size. The flask-session package has a nice diagram to explain how server-side sessions work:

Flow diagram showing how a Flask server using the flask-session package retrieves session data from backend storage

This PR

  • Adds flask-session package to allow storing session data in backend storage
  • Updates Docker configuration to be more reliable for local testing
  • Adds Redis service to local Docker configuration for testing

Things to check

  • For any logging statements, is there any chance that they could be logging sensitive data?
  • Are log statements using a logging library with a logging level set? Setting a logging level means that log statements "below" that level will not be written to the output. For example, if the logging level is set to INFO and debugging statements are written with log.debug or similar, then they won't be written to the otput, which can prevent unintentional leaks of sensitive data.

Security considerations

Nothing about the actual security of how the proxy authenticates users is changing, the storage of the session data is just changing from a cookie in the browser to a cookie in the browser that references data stored in a backend. It is theoretically more secure for actual session data to reside in a backend that cannot be intercepted at the browser level.

@markdboyd markdboyd requested a review from a team as a code owner October 31, 2024 21:26
@markdboyd markdboyd merged commit 722ec25 into main Nov 1, 2024
1 check passed
@markdboyd markdboyd deleted the update-session-storage-redis branch November 1, 2024 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants