-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Add PKC JWKSet reloading to JWT authentication doc #88692
Add PKC JWKSet reloading to JWT authentication doc #88692
Conversation
Pinging @elastic/es-docs (Team:Docs) |
Pinging @elastic/es-security (Team:Security) |
…users. Also, do another pass over the JWKSet reloading section.
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.
Left some suggested changes, a few of which I took liberty with based on some information that I had trouble parsing. Let me know if I misstated anything. Happy to iterate further!
IMPORTANT: All other JWT realm validations are checked before a signature failure can trigger a | ||
PKC JWKS reload. Client authentication is strongly recommended. Narrow scoping of allowed algorithms, | ||
allowed issuer, allowed audiences, and clock skew are all strongly recommended too. That way only trusted | ||
client applications and realm-specific user JWT will be able to trigger PKC reload attempts. | ||
|
||
If multiple JWT authentication signature failures happen at the same time within an {es} node, reloads are | ||
combined to reduce the reloads sent externally. | ||
|
||
IMPORTANT: If JWT signature failures trigger PKC JWKS reloads in different {es} nodes, reload | ||
requests cannot be combined. | ||
|
||
IMPORTANT: If JWT signature failures trigger PKC JWKS reloads in the same {es} node, but at different | ||
times, separate reload requests will not be combined. |
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.
I think that we can reorder this information and split it into two parts to make it flow a bit better:
First part
All other JWT realm validations are checked before a signature failure can
trigger a PKC JWKS reload. If multiple JWT authentication signature failures
occur simultaneously with a single {es} node, reloads are combined to reduce
the reloads that are sent externally.Separate reload requests cannot be combined in these instances:
- If JWT signature failures trigger PKC JWKS reloads in different {es} nodes
- If JWT signature failures trigger PKC JWKS reloads in the same {es} node, but
at different times
Second part
This statement is confusing me a bit; I'm not entirely sure what it's referring to:
That way only trusted client applications and realm-specific user JWT will be able to trigger PKC reload attempts.
I'm going to take an educated guess and suggest:
[IMPORTANT]
Enabling client authentication is strongly recommended. Only trusted client applications and realm-specific JWT users can trigger PKC reload attempts. Additionally, configuring the following <<ref-jwt-settings,JWT security settings>> is recommended:
allowed_issuer
allowed_audiences
allowed_clock_skew
allowed_signature_algorithms
====
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.
LGTM.
If it helps, a more complete view of the order of how settings are used in the code is currently something like this below. Adding complete details would make things too complicated, so it is a balancing act to decide how much detail to put in. The 4 settings you listed above fall into 3-6, and in slightly different order. I don't know if that matters for that you want to achieve, so I will leave it up to you.
- client_authentication.type (with client_authentication.shared_secret, if type is shared_secret)
- jwt.cache.size (with jwt.cache.ttl and allowed_clock_skew, if cache is enabled)
- allowed_issuer
- allowed_audiences
- allowed_signature_algorithms
- allowed_clock_skew
- validate signature (with allowed_signature_algorithms, and one of pkc_jwkset_path, hmac_jwkset, or hmac_key)
- if-and-only-if JWT alg is RSA or EC, try reload (or wait if reload is in progress)
- if-and-only-if reload succeeds and new contents are different, revalidate signature
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.
Thanks @justincr-elastic -- I applied these changes in b5a9961.
Co-authored-by: Adam Locke <[email protected]>
Co-authored-by: Adam Locke <[email protected]>
Co-authored-by: Adam Locke <[email protected]>
Co-authored-by: Adam Locke <[email protected]>
@elasticmachine update branch |
@elasticmachine run elasticsearch-ci/part-1-fips |
@elasticmachine update branch |
@justincr-elastic, it seems that your changes in 8fe00f2 overwrote my changes in b5a9961. I'm unsure if that was intentional or if there was a GitHub collision 💥 Do you want me to reapply that commit? |
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.
LGTM 🦖 Thanks for iterating @justincr-elastic
💚 Backport successful
|
Doc changes for #88023
Doc previews are available for a short time after a build