Match main Redash's security in global redash - #76
Merged
Conversation
Global redash was missing the transport and header protections the main app gets from flask-talisman. This brings it up to at least the same level, so Global is never weaker than the main app. - Add a dedicated Talisman instance in security.py, configured from the same redash settings the main app reads. One set of env vars (REDASH_ENFORCE_HTTPS, REDASH_HSTS_*, REDASH_CONTENT_SECURITY_POLICY, ...) now hardens both apps the same way, instead of the two drifting apart. - This adds HTTPS + HSTS enforcement, X-Frame-Options, a Content-Security-Policy, a referrer policy, and Secure/HttpOnly session cookie flags. - Use a dedicated instance rather than the main app's, to keep the two apps decoupled, matching the existing separate csrf and limiter instances.
thiagogds
approved these changes
Jul 16, 2026
berinhard
reviewed
Jul 16, 2026
berinhard
left a comment
Collaborator
There was a problem hiding this comment.
Shouldn't we add a test to make sure both talisman configurations, Redash's and our global one, are using the very same values for every attr?
From their source code, it seems it would be an easy thing to test as every parameter gets mapped to an object's attribute.
berinhard
requested changes
Jul 16, 2026
Author
please find it updated in the latest commit, thank you! |
berinhard
approved these changes
Jul 22, 2026
berinhard
left a comment
Collaborator
There was a problem hiding this comment.
Sorry for the late review, but thanks for adding the tests 👍
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes https://github.com/metr-systems/backlog/issues/4942
AI Disclaimer: I did use claude opus to double check if global redash and main are on the same security level and to plan if anything is missing and also to assist
Summary
Global redash was missing the protections the main app gets from
flask-talisman. This brings it up to at least the same level.Code Strategy
security.py, configured from the same redash settings the main app reads. One set of env vars (REDASH_ENFORCE_HTTPS, REDASH_HSTS_*, REDASH_CONTENT_SECURITY_POLICY, ...) now hardens both apps the same way, instead of the two drifting apart.