-
Notifications
You must be signed in to change notification settings - Fork 216
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
Check validity times in default auth policies #4786
Check validity times in default auth policies #4786
Conversation
Converting this to draft - looks like it introduces a major performance regression, I guess from the construction of a fresh verifier on every request. Have reduced the repetitions on the longer perf tests to confirm that. I'll see if we can extract the validity periods more cheaply, directly from the serialised DER. If that doesn't work, I'll look at using the existing verifier cache (used for sig auth) for cert auth as well. |
expiry_times_in_auth_policies@60301 aka 20230112.18 vs main ewma over 20 builds from 59639 to 60249 Click to see tablemain
expiry_times_in_auth_policies
|
Added a cache, and looks like the performance issue is resolved. Will give this another few runs. |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
Perf impact is still larger than expected, especially the 5% hit on JWT auth. Returning to Draft status while this is investigated. Perhaps the construction of |
A final thought to explore tomorrow: Is the slowdown simply because the JWT has increased in size? |
Yup, thanks to @achamayou for confirming this in #4821 - just increasing the size of the JWT to include time claims, with no change on the C++ side, causes a ~6% slowdown in the |
…full object conversion" This reverts commit 71f873c.
Resolves #4785.
We avoid using the untrusted host time in most framework code, as the threat model permits it to be manipulated by a malicious host. This leads to surprising permissiveness in some of our crypto validation, for instance accepting JWTs and certs which are expired. Using the untrusted host time here isn't a significant change in a malicious host's power - it allows them to DoS a caller by advancing the node's perception of time such that the caller's authentication is expired, but they cannot target this at a single user (affects the whole node), and they can likely build a more-targeted DoS already (by selectively dropping traffic). It is however a breaking change to the behaviour of these auth policies, which may now return auth errors for test info that they previously accepted.
TODO: