-
Notifications
You must be signed in to change notification settings - Fork 177
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
Use deflate to compress authentication header payload in Dashboard cookie #1338
Conversation
…okie Signed-off-by: Nils Bandener <git@bndnr.de>
@nibix this approach looks promising to me. The example of compressing 14kb -> a little over 4kb sounds like it will relieve some of the pain for user's but not solve all cases. |
Hi @nibix, thank you for writing up this draft. As Craig mentioned this looks like a good start. Is there anything that will need to be done in order to checksum/verify the final cookie against the original? Is it possible to do this without having to transfer the uncompressed cookie for comparison? Or do we simply need to assume that the cookie is correct when it arrives? I don't know if this is a concern with this type of implementation but wanted to ask. |
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.
Nice, much closer to our end state! I think we might be able to have the auth header span multiple cookies to provide headroom.
While in draft, I would recommend documenting / stubbing out what kinds of scenario tests we should create.
@@ -104,7 +110,7 @@ export class SamlAuthentication extends AuthenticationType { | |||
cookie.authType === AuthType.SAML && | |||
cookie.username && | |||
cookie.expiryTime && | |||
cookie.credentials?.authHeaderValue | |||
(cookie.credentials?.authHeaderValue || cookie.credentials?.authHeaderValueCompressed) |
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.
What would you think about inserting a cookie splitter that could provide head room of these requests?
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.
Would be an option, but we cannot do this inside this code. From this code, we can only write exactly one cookie.
I believe we should just assume that the cookie is correct when it is arrives. Additionally, the deflate compression algorithm already stores a checksum at the end of the data, thus we already have a certain validation. Additionally, of course, the JWT also has a signature which would become invalid when something goes wrong in the round trip. |
Superseded by #1352 |
Description
First shot at a compression-based solution for #1311 . More a RFC on the approach than a final pull request. Covers so far only SAML. OIDC will come when we have the concept straight.
Uses deflate compression to compress the main payload of the Dashboards security cookie when SAML auth is active. This might help with issues in environments where users have big amounts of roles or attributes. Such users can have trouble with logging into Dashboards because the security cookie - which carries this information encoded in a JWT - gets too big.
The deflated value is written into the attribute authHeaderValueCompressed inside the cookie. This allows us to tell new cookies apart from cookies written with an earlier version and to support both.
Issues and Limitations
Category
Why these changes are required?
Allow users with many roles to authenticate with SAML in Dashboards.
What is the old behavior before changes and new behavior after changes?
Such users could not log in into Dashboards.
Issues Resolved
Testing
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.