-
Notifications
You must be signed in to change notification settings - Fork 124
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
ONYX-14324 - authn-jwt - enhance public key delivery mechanisms #2437
Conversation
a260705
to
2ea3511
Compare
9b4be9c
to
374288c
Compare
[//]: # "2. Design documents should not be updated after implementation" | ||
[//]: # "3. Design decisions should be made before writing this document, and as such this document should not include options / choices" | ||
|
||
|
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.
Multiple consecutive blank lines
bfe6313
to
1437409
Compare
|
||
```bash | ||
conjur variable set -i conjur/authn-jwt/myUnreachableVendor/public-keys \ | ||
"{ \"type\":\"jwks\", \"value\": $(curl https://www.googleapis.com/oauth2/v3/certs) }" |
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.
Line length
23c302c
to
a82e16d
Compare
a82e16d
to
e7cc563
Compare
|
||
| **Error message** | **Description** | | ||
|-------------------|-----------------| | ||
| Signing key configuration is invalid: JSON parsing error from JSON gem | When the variable value is not a valid JSON | |
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.
Line length
| **Error message** | **Description** | | ||
|-------------------|-----------------| | ||
| Signing key configuration is invalid: JSON parsing error from JSON gem | When the variable value is not a valid JSON | | ||
| Signing key configuration is invalid: `public-keys` `type` field value is missing or empty | When type field absent or has empty value | |
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.
Line length
|-------------------|-----------------| | ||
| Signing key configuration is invalid: JSON parsing error from JSON gem | When the variable value is not a valid JSON | | ||
| Signing key configuration is invalid: `public-keys` `type` field value is missing or empty | When type field absent or has empty value | | ||
| Signing key configuration is invalid: `public-keys` `type` field value {} is wrong | When type field value is no `jwks` | |
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.
Line length
| Signing key configuration is invalid: JSON parsing error from JSON gem | When the variable value is not a valid JSON | | ||
| Signing key configuration is invalid: `public-keys` `type` field value is missing or empty | When type field absent or has empty value | | ||
| Signing key configuration is invalid: `public-keys` `type` field value {} is wrong | When type field value is no `jwks` | | ||
| Signing key configuration is invalid: `public-keys` `value` field is missing or empty | When value field absent or has empty value | |
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.
Line length
| S1 | 3 SP | | ||
| S2 | 2 SP | | ||
| S3 | 3 SP (without integration tests) | | ||
| S4 | 2 SP (considering spike code [cyberark/conjur#2447](https://github.com/cyberark/conjur/pull/2447)) | |
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.
Line length
|
||
* `public-keys` - a variable contains static JWKS value for the case where Conjur | ||
is unable to reach server hosts jwks/provider-uri. | ||
<details> |
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.
Inline HTML
supported. More types can be supported in future. | ||
* `value` - the value of JWKS as is it's returned from unreachable jwks/provider-uri | ||
endpoint. | ||
<details><summary>JSON example</summary> |
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.
Inline HTML
supported. More types can be supported in future. | ||
* `value` - the value of JWKS as is it's returned from unreachable jwks/provider-uri | ||
endpoint. | ||
<details><summary>JSON example</summary> |
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.
Inline HTML
2eaa2e5
to
5cfcd06
Compare
* `ca-cert` - a variable contains certificates bundle with additional CA certificates | ||
conjur will trust when it | ||
approaches jwks/provider uri. | ||
<details> |
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.
Inline HTML
|
||
The `ca-cert` variable format is a certificate bundle contains one or more certificates | ||
in pem ([rfc7468](https://datatracker.ietf.org/doc/html/rfc7468)) format. | ||
<details><summary>Bundle example</summary> |
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.
Inline HTML
|
||
The `ca-cert` variable format is a certificate bundle contains one or more certificates | ||
in pem ([rfc7468](https://datatracker.ietf.org/doc/html/rfc7468)) format. | ||
<details><summary>Bundle example</summary> |
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.
Inline HTML
requirements. | ||
|
||
1. Create abstraction layer for relevant Conjur variables from authenticator's BL | ||
<details><div> |
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.
Inline HTML
requirements. | ||
|
||
1. Create abstraction layer for relevant Conjur variables from authenticator's BL | ||
<details><div> |
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.
Inline HTML
* `signing_key`: String - returns `public-keys` variable value | ||
* `ca_cert`: `OpenSSL::X509::Store`<br> | ||
Store creation example | ||
```ruby |
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.
Fenced code blocks should be surrounded by blank lines
</div></details> | ||
|
||
1. Add new properties to `SigningKeySettings` class | ||
<details><div> |
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.
Inline HTML
</div></details> | ||
|
||
1. Add new properties to `SigningKeySettings` class | ||
<details><div> |
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.
Inline HTML
Add new properties to the `SigningKeySettings` class: | ||
|
||
* `signing_key`: String - returns `public-keys` variable value | ||
* `ca_cert`: `OpenSSL::X509::Store`<br> |
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.
Inline HTML
Store creation example | ||
```ruby | ||
ca_cert = OpenSSL::X509::Store.new | ||
::Conjur::CertUtils.add_chained_cert(ca_cert, <VARIABLE_VALUE>) |
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.
Inline HTML
|
||
1. Use additional CA certificates during keys fetching in both `jwks-uri` and `provider-uri` | ||
use cases | ||
<details><div> |
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.
Inline HTML
|
||
1. Use additional CA certificates during keys fetching in both `jwks-uri` and `provider-uri` | ||
use cases | ||
<details><div> |
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.
Inline HTML
|
||
1. Refactor cache layer related to `FetchProviderUriSigningKey` and `FetchJwksUriSigningKey` | ||
classes | ||
<details><div> |
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.
Inline HTML
|
||
1. Refactor cache layer related to `FetchProviderUriSigningKey` and `FetchJwksUriSigningKey` | ||
classes | ||
<details><div> |
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.
Inline HTML
|
||
1. Create new `FetchStaticSigningKey` class parses the `public-keys` variable value | ||
and returns a valid JWKS structure | ||
<details><div> |
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.
Inline HTML
public-keys configuration, and non-functional - decoupling variables from main BL | ||
requirements. | ||
|
||
1. <a name="s1"></a>Create abstraction layer for relevant Conjur variables from |
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.
Inline HTML
|
||
</div></details> | ||
|
||
1. <a name="s2"></a>Add new properties to `SigningKeySettings` class |
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.
Inline HTML
Fallback scenario: to support `ca-cert` variable only for `jwks-uri` variable. | ||
</div></details> | ||
|
||
1. <a name="s4"></a>Refactor cache layer related to `FetchProviderUriSigningKey` |
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.
Inline HTML
![image](fetch-more-keys-stage-4.png) | ||
</div></details> | ||
|
||
1. <a name="s5"></a>Create new `FetchStaticSigningKey` class parses the `public-keys` |
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.
Inline HTML
5d77a25
to
959b682
Compare
|
||
| **Error message** | **Description** | | ||
|-------------------|-----------------| | ||
| Signing key configuration is invalid: only one of `jwks-uri`, `provider-uri`, `public-keys` variables can be define simultaneously | When more than one variable is defined | |
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.
Line length
| **Error message** | **Description** | | ||
|-------------------|-----------------| | ||
| Signing key configuration is invalid: only one of `jwks-uri`, `provider-uri`, `public-keys` variables can be define simultaneously | When more than one variable is defined | | ||
| Signing key configuration is invalid: `ca-cert` variable can be defined only with `jwks-uri` variables | When `ca-cert` variable defined with `provider-uri` or `public-keys` variables | |
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.
Line length
|-------------------|-----------------| | ||
| Signing key configuration is invalid: only one of `jwks-uri`, `provider-uri`, `public-keys` variables can be define simultaneously | When more than one variable is defined | | ||
| Signing key configuration is invalid: `ca-cert` variable can be defined only with `jwks-uri` variables | When `ca-cert` variable defined with `provider-uri` or `public-keys` variables | | ||
| Signing key configuration is invalid: missing `issuer` variable | When `public-keys` variable is defined but `issuer` is not | |
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.
Line length
| Signing key configuration is invalid: only one of `jwks-uri`, `provider-uri`, `public-keys` variables can be define simultaneously | When more than one variable is defined | | ||
| Signing key configuration is invalid: `ca-cert` variable can be defined only with `jwks-uri` variables | When `ca-cert` variable defined with `provider-uri` or `public-keys` variables | | ||
| Signing key configuration is invalid: missing `issuer` variable | When `public-keys` variable is defined but `issuer` is not | | ||
| Signing key configuration is invalid: {variable-name} variable is defined but empty | When variables permutation is valid but one of it is empty | |
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.
Line length
|
||
</div></details> | ||
|
||
1. <a name="s3"></a>Use additional CA certificates during keys fetching in `jwks-uri` |
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.
Inline HTML
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
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
Create table of contents for authn-jwt related designs
13ea316
959b682
to
13ea316
Compare
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.
LGTM2
|[Enforced claims and claim aliases](token_schema.md)|July 18, 2021| | ||
|[`aud` claim support](aud_claim_support.md)|July 29, 2021| | ||
|[Complex token support](complex_token.md)|October 27, 2021| | ||
|[Enhance signing key delivery mechanisms](authn-jwt-fetch-more-keys.md)|December 27, 2021| |
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.
Line length
| Signing key configuration is invalid: `public-keys` `value` field is missing or empty | When value field absent or has empty value | | ||
</div></details> | ||
|
||
1. <a name="s6"></a>Strict JWKS structure input validation |
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.
Inline HTML
</div></details> | ||
|
||
1. <a name="s6"></a>Strict JWKS structure input validation | ||
<details><div> |
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.
Inline HTML
</div></details> | ||
|
||
1. <a name="s6"></a>Strict JWKS structure input validation | ||
<details><div> |
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.
Inline HTML
* `value` - the value of JWKS as is it's returned from unreachable jwks/provider-uri | ||
endpoint. | ||
<details><summary>JSON example</summary> | ||
For example (based on https://www.googleapis.com/oauth2/v3/certs): |
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.
Bare URL used
Code Climate has analyzed commit 13ea316 and detected 48 issues on this pull request. Here's the issue category breakdown:
The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 91.0% (0.0% change). View more on Code Climate. |
What this does PR do?
Introduces design for two new configuration variables of JWT authenticator.
Connected Issue/Story
ONYX-14324
Changelog
CHANGELOG update
Test coverage
changes, or
Documentation
README
s) were updated in this PRBehavior
Security