Skip to content

Add documentation for jwt_clock_skew_tolerance_seconds setting that resolves authentication errors#3251

Merged
cwillum merged 6 commits intomainfrom
fix#3220-clock-skew-fail-to-auth
Mar 28, 2023
Merged

Add documentation for jwt_clock_skew_tolerance_seconds setting that resolves authentication errors#3251
cwillum merged 6 commits intomainfrom
fix#3220-clock-skew-fail-to-auth

Conversation

@cwillum
Copy link
Contributor

@cwillum cwillum commented Mar 7, 2023

Description

Security added a new setting to be used for JWT, SAML, and OIDC backend configurations when there is a disparity between clock time between the validation servers and the token causes authentication to fail.

Issues Resolved

Added new documentation to JWT, SAML, and OIDC backend documentation for the new jwt_clock_skew_tolerance_seconds setting.

Fixes #3220

Checklist

  • By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and subject to the Developers Certificate of Origin.
    For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: cwillum <cwmmoore@amazon.com>
@cwillum cwillum added In progress Issue/PR: The issue or PR is in progress. backport 2.0 PR: Backport label for v2.0.x security backport 2.1 PR: Backport label for 2.1 backport 2.2 PR: Backport label for 2.2 backport 2.3 PR: Backport label for 2.3 backport 2.4 PR: Backport label for 2.4 backport 2.5 PR: Backport label for 2.5 backport 2.6 PR: Backport label for 2.6 labels Mar 7, 2023
@cwillum cwillum requested a review from a team as a code owner March 7, 2023 02:49
@cwillum cwillum self-assigned this Mar 7, 2023
cwillum added 2 commits March 7, 2023 10:07
Signed-off-by: cwillum <cwmmoore@amazon.com>
Signed-off-by: cwillum <cwmmoore@amazon.com>
@cwillum
Copy link
Contributor Author

cwillum commented Mar 7, 2023

@cwperks Can you check me on this, language, accuracy, and what else you might see? Thanks.
I considered adding something to troubleshooting, as well. But I think the enhancement to add a default would make that redundant, and twice redundant with the new information about this in the backend configurations.

Copy link
Member

@cwperks cwperks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cwillum This change looks good to me. I left a minor comment on the choice of using the term validation server, but the wording looks good in general.


## Time disparity compensation for JSON Web Token validation

Occasionally you may find that the clock times between the validation server and the OpenSearch node are not perfectly synchronized. When this is the case, even by a few seconds, the system that either issues or receives a JWT may try to validate `nbf` (not before) and `exp` (expiration) claims and fail to authenticate the user due to the time disparity.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have been referring to the system that generates the JWTs as the Authentication server. Upon successful Authentication it generates the token and gives it back to the authenticated user who can then bear the token for subsequent requests. What do you think about authentication server instead of validation server?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm with you on that. Thanks. (authentication server)

Signed-off-by: cwillum <cwmmoore@amazon.com>
Copy link
Contributor Author

@cwillum cwillum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @cwperks


## Time disparity compensation for JSON Web Token validation

Occasionally you may find that the clock times between the validation server and the OpenSearch node are not perfectly synchronized. When this is the case, even by a few seconds, the system that either issues or receives a JWT may try to validate `nbf` (not before) and `exp` (expiration) claims and fail to authenticate the user due to the time disparity.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm with you on that. Thanks. (authentication server)

@cwillum
Copy link
Contributor Author

cwillum commented Mar 17, 2023

Waiting for availability on doc team review.

@cwillum cwillum added Doc review PR: Doc review in progress and removed In progress Issue/PR: The issue or PR is in progress. labels Mar 17, 2023
Copy link

@JeffHuss JeffHuss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@cwillum
Copy link
Contributor Author

cwillum commented Mar 27, 2023

Waiting for availability on doc team review.

@carolxob carolxob self-requested a review March 27, 2023 16:01
Copy link
Contributor

@carolxob carolxob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a few very minor suggestions.

Copy link
Contributor

@hdhalter hdhalter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! A couple of minor suggestions.

The payload of a JSON web token contains the so-called [JWT Claims](https://self-issued.info/docs/draft-ietf-oauth-json-web-token.html#RegisteredClaimName). A claim can be any piece of information about the user that the application that created the token has verified.
The payload of a JSON Web Token contains the so-called [JWT Claims](https://self-issued.info/docs/draft-ietf-oauth-json-web-token.html#RegisteredClaimName). A claim can be any piece of information about the user that the application that created the token has verified.

The specification defines a set of standard claims with reserved names ("registered claims"). These include, for example, the token issuer, the expiration date, or the creation date.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you say 'these include...' do you need to say, 'for example'? Could you just say, 'The standard claims include the token issuer, the expiration date...' or are they examples of reserved names?

Copy link
Contributor Author

@cwillum cwillum Mar 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are just examples of the many registered claims that exist. I have rewritten this statement in the hopes of bestowing the claim with a richness of clarity.

Signed-off-by: cwillum <cwmmoore@amazon.com>
Copy link
Contributor

@natebower natebower left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cwillum Please confirm that JWT is defined on first appearance in each file and that only the acronym is used thereafter. If the first use of an acronym is in a heading, retain the acronym in the heading, and then write out the term in the following body text, followed by the acronym in parentheses. Let me know if you have any questions. Thanks!

Signed-off-by: cwillum <cwmmoore@amazon.com>
@cwillum cwillum removed the Doc review PR: Doc review in progress label Mar 28, 2023
@cwillum cwillum merged commit 15d324d into main Mar 28, 2023
@cwillum cwillum deleted the fix#3220-clock-skew-fail-to-auth branch March 28, 2023 20:48
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 28, 2023
…esolves authentication errors (#3251)

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

---------

Signed-off-by: cwillum <cwmmoore@amazon.com>
(cherry picked from commit 15d324d)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 28, 2023
…esolves authentication errors (#3251)

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

---------

Signed-off-by: cwillum <cwmmoore@amazon.com>
(cherry picked from commit 15d324d)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 28, 2023
…esolves authentication errors (#3251)

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

---------

Signed-off-by: cwillum <cwmmoore@amazon.com>
(cherry picked from commit 15d324d)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 28, 2023
…esolves authentication errors (#3251)

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

---------

Signed-off-by: cwillum <cwmmoore@amazon.com>
(cherry picked from commit 15d324d)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 28, 2023
…esolves authentication errors (#3251)

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

---------

Signed-off-by: cwillum <cwmmoore@amazon.com>
(cherry picked from commit 15d324d)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 28, 2023
…esolves authentication errors (#3251)

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

---------

Signed-off-by: cwillum <cwmmoore@amazon.com>
(cherry picked from commit 15d324d)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 28, 2023
…esolves authentication errors (#3251)

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

---------

Signed-off-by: cwillum <cwmmoore@amazon.com>
(cherry picked from commit 15d324d)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
cwillum pushed a commit that referenced this pull request Mar 28, 2023
…esolves authentication errors (#3251) (#3607)

* fix#3220 auth fail from clock skew



* fix#3220 auth fail from clock skew



* fix#3220 auth fail from clock skew



* fix#3220 auth fail from clock skew



* fix#3220 auth fail from clock skew



* fix#3220 auth fail from clock skew



---------


(cherry picked from commit 15d324d)

Signed-off-by: cwillum <cwmmoore@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
cwillum pushed a commit that referenced this pull request Mar 28, 2023
…esolves authentication errors (#3251) (#3606)

* fix#3220 auth fail from clock skew



* fix#3220 auth fail from clock skew



* fix#3220 auth fail from clock skew



* fix#3220 auth fail from clock skew



* fix#3220 auth fail from clock skew



* fix#3220 auth fail from clock skew



---------


(cherry picked from commit 15d324d)

Signed-off-by: cwillum <cwmmoore@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
cwillum pushed a commit that referenced this pull request Mar 28, 2023
…esolves authentication errors (#3251) (#3605)

* fix#3220 auth fail from clock skew



* fix#3220 auth fail from clock skew



* fix#3220 auth fail from clock skew



* fix#3220 auth fail from clock skew



* fix#3220 auth fail from clock skew



* fix#3220 auth fail from clock skew



---------


(cherry picked from commit 15d324d)

Signed-off-by: cwillum <cwmmoore@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
cwillum pushed a commit that referenced this pull request Mar 28, 2023
…esolves authentication errors (#3251) (#3604)

* fix#3220 auth fail from clock skew



* fix#3220 auth fail from clock skew



* fix#3220 auth fail from clock skew



* fix#3220 auth fail from clock skew



* fix#3220 auth fail from clock skew



* fix#3220 auth fail from clock skew



---------


(cherry picked from commit 15d324d)

Signed-off-by: cwillum <cwmmoore@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
cwillum pushed a commit that referenced this pull request Mar 28, 2023
…esolves authentication errors (#3251) (#3603)

* fix#3220 auth fail from clock skew



* fix#3220 auth fail from clock skew



* fix#3220 auth fail from clock skew



* fix#3220 auth fail from clock skew



* fix#3220 auth fail from clock skew



* fix#3220 auth fail from clock skew



---------


(cherry picked from commit 15d324d)

Signed-off-by: cwillum <cwmmoore@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
cwillum pushed a commit that referenced this pull request Mar 28, 2023
…esolves authentication errors (#3251) (#3602)

* fix#3220 auth fail from clock skew



* fix#3220 auth fail from clock skew



* fix#3220 auth fail from clock skew



* fix#3220 auth fail from clock skew



* fix#3220 auth fail from clock skew



* fix#3220 auth fail from clock skew



---------


(cherry picked from commit 15d324d)

Signed-off-by: cwillum <cwmmoore@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
cwillum pushed a commit that referenced this pull request Mar 28, 2023
…esolves authentication errors (#3251) (#3601)

* fix#3220 auth fail from clock skew



* fix#3220 auth fail from clock skew



* fix#3220 auth fail from clock skew



* fix#3220 auth fail from clock skew



* fix#3220 auth fail from clock skew



* fix#3220 auth fail from clock skew



---------


(cherry picked from commit 15d324d)

Signed-off-by: cwillum <cwmmoore@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
vagimeli pushed a commit that referenced this pull request May 4, 2023
…esolves authentication errors (#3251)

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

---------

Signed-off-by: cwillum <cwmmoore@amazon.com>
vagimeli added a commit that referenced this pull request May 4, 2023
…g that resolves authentication errors (#3251)"

This reverts commit d9bf5dc.
harshavamsi pushed a commit to harshavamsi/documentation-website that referenced this pull request Oct 31, 2023
…esolves authentication errors (opensearch-project#3251)

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

* fix#3220 auth fail from clock skew

Signed-off-by: cwillum <cwmmoore@amazon.com>

---------

Signed-off-by: cwillum <cwmmoore@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 2.0 PR: Backport label for v2.0.x backport 2.1 PR: Backport label for 2.1 backport 2.2 PR: Backport label for 2.2 backport 2.3 PR: Backport label for 2.3 backport 2.4 PR: Backport label for 2.4 backport 2.5 PR: Backport label for 2.5 backport 2.6 PR: Backport label for 2.6

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DOC]Update JWT, SAML, and OIDC backend documentation with skew tolerance parameter for correct authc validation

6 participants