From e3e9c1a5f17c2e339f109628f3db4eba9af8a4ea Mon Sep 17 00:00:00 2001 From: Ralf Haferkamp Date: Wed, 3 Aug 2022 10:03:42 +0000 Subject: [PATCH] commit 6e848c72544c26adb63e49ae5bf79c90b649f9f6 Author: Ralf Haferkamp Date: Mon Jul 25 16:38:10 2022 +0200 Use mutex for lazy init function To avoid possible threading issues --- grpc_apis/ocis/messages/search/v0/grpc.md | 2 +- grpc_apis/ocis/messages/settings/v0/grpc.md | 2 +- grpc_apis/ocis/messages/store/v0/grpc.md | 2 +- grpc_apis/ocis/messages/thumbnails/v0/grpc.md | 2 +- grpc_apis/ocis/services/search/v0/grpc.md | 2 +- grpc_apis/ocis/services/settings/v0/grpc.md | 2 +- grpc_apis/ocis/services/store/v0/grpc.md | 2 +- grpc_apis/ocis/services/thumbnails/v0/grpc.md | 2 +- services/_includes/adoc/proxy_configvars.adoc | 40 +++++++++++++++++++ services/_includes/proxy-config-example.yaml | 6 +++ services/_includes/proxy_configvars.md | 5 +++ 11 files changed, 59 insertions(+), 8 deletions(-) diff --git a/grpc_apis/ocis/messages/search/v0/grpc.md b/grpc_apis/ocis/messages/search/v0/grpc.md index 289d1fbecfb..a1c9e73b085 100644 --- a/grpc_apis/ocis/messages/search/v0/grpc.md +++ b/grpc_apis/ocis/messages/search/v0/grpc.md @@ -1,7 +1,7 @@ --- title: "ocis.messages.search.v0" url: /grpc_apis/ocis_messages_search_v0 -date: 2022-08-03T08:13:48Z +date: 2022-08-03T10:02:17Z weight: 50 geekdocRepo: https://github.com/owncloud/ocis --- diff --git a/grpc_apis/ocis/messages/settings/v0/grpc.md b/grpc_apis/ocis/messages/settings/v0/grpc.md index 911323521bf..6ba15098f33 100644 --- a/grpc_apis/ocis/messages/settings/v0/grpc.md +++ b/grpc_apis/ocis/messages/settings/v0/grpc.md @@ -1,7 +1,7 @@ --- title: "ocis.messages.settings.v0" url: /grpc_apis/ocis_messages_settings_v0 -date: 2022-08-03T08:13:48Z +date: 2022-08-03T10:02:16Z weight: 50 geekdocRepo: https://github.com/owncloud/ocis --- diff --git a/grpc_apis/ocis/messages/store/v0/grpc.md b/grpc_apis/ocis/messages/store/v0/grpc.md index afe4ec14ba4..16ce52059f6 100644 --- a/grpc_apis/ocis/messages/store/v0/grpc.md +++ b/grpc_apis/ocis/messages/store/v0/grpc.md @@ -1,7 +1,7 @@ --- title: "ocis.messages.store.v0" url: /grpc_apis/ocis_messages_store_v0 -date: 2022-08-03T08:13:48Z +date: 2022-08-03T10:02:16Z weight: 50 geekdocRepo: https://github.com/owncloud/ocis --- diff --git a/grpc_apis/ocis/messages/thumbnails/v0/grpc.md b/grpc_apis/ocis/messages/thumbnails/v0/grpc.md index 63b3f2d137e..d2a8bbd31a3 100644 --- a/grpc_apis/ocis/messages/thumbnails/v0/grpc.md +++ b/grpc_apis/ocis/messages/thumbnails/v0/grpc.md @@ -1,7 +1,7 @@ --- title: "ocis.messages.thumbnails.v0" url: /grpc_apis/ocis_messages_thumbnails_v0 -date: 2022-08-03T08:13:48Z +date: 2022-08-03T10:02:16Z weight: 50 geekdocRepo: https://github.com/owncloud/ocis --- diff --git a/grpc_apis/ocis/services/search/v0/grpc.md b/grpc_apis/ocis/services/search/v0/grpc.md index 524900378ef..40f09d7f8c7 100644 --- a/grpc_apis/ocis/services/search/v0/grpc.md +++ b/grpc_apis/ocis/services/search/v0/grpc.md @@ -1,7 +1,7 @@ --- title: "ocis.services.search.v0" url: /grpc_apis/ocis_services_search_v0 -date: 2022-08-03T08:13:48Z +date: 2022-08-03T10:02:16Z weight: 50 geekdocRepo: https://github.com/owncloud/ocis --- diff --git a/grpc_apis/ocis/services/settings/v0/grpc.md b/grpc_apis/ocis/services/settings/v0/grpc.md index 663cdd2c4e3..c14bbca2d94 100644 --- a/grpc_apis/ocis/services/settings/v0/grpc.md +++ b/grpc_apis/ocis/services/settings/v0/grpc.md @@ -1,7 +1,7 @@ --- title: "ocis.services.settings.v0" url: /grpc_apis/ocis_services_settings_v0 -date: 2022-08-03T08:13:48Z +date: 2022-08-03T10:02:16Z weight: 50 geekdocRepo: https://github.com/owncloud/ocis --- diff --git a/grpc_apis/ocis/services/store/v0/grpc.md b/grpc_apis/ocis/services/store/v0/grpc.md index 08ef6ef63fa..74bbef0b11c 100644 --- a/grpc_apis/ocis/services/store/v0/grpc.md +++ b/grpc_apis/ocis/services/store/v0/grpc.md @@ -1,7 +1,7 @@ --- title: "ocis.services.store.v0" url: /grpc_apis/ocis_services_store_v0 -date: 2022-08-03T08:13:48Z +date: 2022-08-03T10:02:17Z weight: 50 geekdocRepo: https://github.com/owncloud/ocis --- diff --git a/grpc_apis/ocis/services/thumbnails/v0/grpc.md b/grpc_apis/ocis/services/thumbnails/v0/grpc.md index d249878b012..31e5bd92835 100644 --- a/grpc_apis/ocis/services/thumbnails/v0/grpc.md +++ b/grpc_apis/ocis/services/thumbnails/v0/grpc.md @@ -1,7 +1,7 @@ --- title: "ocis.services.thumbnails.v0" url: /grpc_apis/ocis_services_thumbnails_v0 -date: 2022-08-03T08:13:48Z +date: 2022-08-03T10:02:16Z weight: 50 geekdocRepo: https://github.com/owncloud/ocis --- diff --git a/services/_includes/adoc/proxy_configvars.adoc b/services/_includes/adoc/proxy_configvars.adoc index 49ed59b702d..e116844ec10 100644 --- a/services/_includes/adoc/proxy_configvars.adoc +++ b/services/_includes/adoc/proxy_configvars.adoc @@ -178,6 +178,14 @@ pass:[true] a| [subs=-attributes] Disable TLS certificate validation for connections to the IDP. Note that this is not recommended for production environments. +|`PROXY_OIDC_ACCESS_TOKEN_VERIFY_METHOD` +a| [subs=-attributes] ++string+ +a| [subs=-attributes] +pass:[jwt] +a| [subs=-attributes] +Sets how OIDC access tokens should be verified. Possible values are 'none' and 'jwt'. When using 'none', no special validation apart from using it for accessing the IPD's userinfo endpoint will be done. When using 'jwt', it tries to parse the access token as a jwt token and verifies the signature using the keys published on the IDP's 'jwks_uri'. + |`PROXY_OIDC_USERINFO_CACHE_SIZE` a| [subs=-attributes] +int+ @@ -194,6 +202,38 @@ pass:[10] a| [subs=-attributes] Max TTL in seconds for the OIDC user info cache. +|`PROXY_OIDC_JWKS_REFRESH_INTERVAL` +a| [subs=-attributes] ++uint64+ +a| [subs=-attributes] +pass:[60] +a| [subs=-attributes] +The interval for refreshing the JWKS (JSON Web Key Set) in minutes in the background via a new HTTP request to the IDP. + +|`PROXY_OIDC_JWKS_REFRESH_TIMEOUT` +a| [subs=-attributes] ++uint64+ +a| [subs=-attributes] +pass:[10] +a| [subs=-attributes] +The timeout in seconds for an outgoing JWKS request. + +|`PROXY_OIDC_JWKS_REFRESH_RATE_LIMIT` +a| [subs=-attributes] ++uint64+ +a| [subs=-attributes] +pass:[60] +a| [subs=-attributes] +Limits the rate in seconds at which refresh requests are performed for unknown keys. This is used to prevent malicious clients from imposing high network load on the IDP via ocis. + +|`PROXY_OIDC_JWKS_REFRESH_UNKNOWN_KID` +a| [subs=-attributes] ++bool+ +a| [subs=-attributes] +pass:[true] +a| [subs=-attributes] +If set to 'true', the JWKS refresh request will occur every time an unknown KEY ID (KID) is seen. Always set a 'refresh_limit' when enabling this. + |`OCIS_JWT_SECRET` + `PROXY_JWT_SECRET` a| [subs=-attributes] diff --git a/services/_includes/proxy-config-example.yaml b/services/_includes/proxy-config-example.yaml index 05e84cddc63..66cf10b9ad5 100644 --- a/services/_includes/proxy-config-example.yaml +++ b/services/_includes/proxy-config-example.yaml @@ -86,9 +86,15 @@ policies: oidc: issuer: https://localhost:9200 insecure: true + access_token_verify_method: jwt user_info_cache: size: 1024 ttl: 10 + jwks: + refresh_interval: 60 + refresh_timeout: 10 + refresh_limit: 60 + refresh_unknown_kid: true token_manager: jwt_secret: "" policy_selector: diff --git a/services/_includes/proxy_configvars.md b/services/_includes/proxy_configvars.md index 0d6950bf76d..a3a88256744 100644 --- a/services/_includes/proxy_configvars.md +++ b/services/_includes/proxy_configvars.md @@ -22,8 +22,13 @@ | REVA_GATEWAY | string | 127.0.0.1:9142 | The CS3 gateway endpoint.| | OCIS_URL
OCIS_OIDC_ISSUER
PROXY_OIDC_ISSUER | string | https://localhost:9200 | URL of the OIDC issuer. It defaults to URL of the builtin IDP.| | OCIS_INSECURE
PROXY_OIDC_INSECURE | bool | true | Disable TLS certificate validation for connections to the IDP. Note that this is not recommended for production environments.| +| PROXY_OIDC_ACCESS_TOKEN_VERIFY_METHOD | string | jwt | Sets how OIDC access tokens should be verified. Possible values are 'none' and 'jwt'. When using 'none', no special validation apart from using it for accessing the IPD's userinfo endpoint will be done. When using 'jwt', it tries to parse the access token as a jwt token and verifies the signature using the keys published on the IDP's 'jwks_uri'.| | PROXY_OIDC_USERINFO_CACHE_SIZE | int | 1024 | Cache size for OIDC user info.| | PROXY_OIDC_USERINFO_CACHE_TTL | int | 10 | Max TTL in seconds for the OIDC user info cache.| +| PROXY_OIDC_JWKS_REFRESH_INTERVAL | uint64 | 60 | The interval for refreshing the JWKS (JSON Web Key Set) in minutes in the background via a new HTTP request to the IDP.| +| PROXY_OIDC_JWKS_REFRESH_TIMEOUT | uint64 | 10 | The timeout in seconds for an outgoing JWKS request.| +| PROXY_OIDC_JWKS_REFRESH_RATE_LIMIT | uint64 | 60 | Limits the rate in seconds at which refresh requests are performed for unknown keys. This is used to prevent malicious clients from imposing high network load on the IDP via ocis.| +| PROXY_OIDC_JWKS_REFRESH_UNKNOWN_KID | bool | true | If set to 'true', the JWKS refresh request will occur every time an unknown KEY ID (KID) is seen. Always set a 'refresh_limit' when enabling this.| | OCIS_JWT_SECRET
PROXY_JWT_SECRET | string | | The secret to mint and validate JWT tokens.| | PROXY_ENABLE_PRESIGNEDURLS | bool | true | Allow OCS to get a signing key to sign requests.| | PROXY_ACCOUNT_BACKEND_TYPE | string | cs3 | Account backend the PROXY service should use. Currently only 'cs3' is possible here.|