feature(translator): expose OIDC oauth cookie samesite configuration#6289
feature(translator): expose OIDC oauth cookie samesite configuration#6289arkodg merged 6 commits intoenvoyproxy:mainfrom
Conversation
|
Hi @vibe thanks for working on this! Would it make sense to set default to These cookies are just trivial implementation details of the Envoy OAuth2 filter, so I’d prefer not to expose them through the API. Some related discussions and issues: |
Hey @zhaohuabing , totally understand wanting to keep the API small, that being said in practice SameSite often needs to vary per-deployment (and sometimes per-cookie) to keep OIDC flows working while still giving users/developers the option to harden where they can. This PR is a result of a production need in our organization, where we currently use an In theory we should definitely default to Open to any thoughts! Thanks for reviewing |
|
Just read through the links you provided, would it be reasonable to have a middle ground of keeping bearer token, id token, and refresh token as configurable? Though I haven't thought through the implications of not leaving the rest as configurable, especially since it's low hanging fruit. |
|
@vibe I talked with @arkodg offline - the SameSite setting is actually useful for iframe use cases. |
|
Also worth discussing here is should the defaults be changed from Disabled to Strict ? |
|
@zhaohuabing I personally do not have a use case for different @arkodg - As far as I'm concerned, defaulting to |
Strict is better, but it could be a break change for iframe use cases. We need to add this to the release note if we decide to change default to Strict. |
api/v1alpha1/oidc_types.go
Outdated
There was a problem hiding this comment.
prefer if this API looked more like the existing API
Attributes map[string]string `json:"attributes,omitempty"`
There was a problem hiding this comment.
nvm its a limitation of the upstream API which only supports SameSite
https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/filters/http/oauth2/v3/oauth.proto#envoy-v3-api-msg-extensions-filters-http-oauth2-v3-cookieconfigs
Gateway API fields call in cookieConfig https://gateway-api.sigs.k8s.io/reference/spec/#cookieconfig
lets go with CookieConfig *OIDCCookieConfig ?
api/v1alpha1/oidc_types.go
Outdated
There was a problem hiding this comment.
as discussed lets default to Strict and we can add this as a breaking change note in the relase notes
There was a problem hiding this comment.
Updated default to Strict
There was a problem hiding this comment.
thanks can you also update the comment/ doc string, it says Disabled is the default
d2717c3 to
3bcd93c
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6289 +/- ##
==========================================
- Coverage 70.67% 70.67% -0.01%
==========================================
Files 220 220
Lines 36954 36998 +44
==========================================
+ Hits 26116 26147 +31
- Misses 9304 9314 +10
- Partials 1534 1537 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Hi @vibe let's just use a single config and not expose cookies details. |
Thanks for clarifying, updated! @zhaohuabing |
|
thanks @vibe, overall LGTM, some minor comments
|
|
@arkodg nice catch, updated! |
|
@vibe can you run |
|
@arkodg running For what it's worth I can manually add it to the out file, but please advise. |
Signed-off-by: vibe <francoc137@icloud.com>
…egenerate manifests Signed-off-by: vibe <francoc137@icloud.com>
Signed-off-by: vibe <francoc137@icloud.com>
Signed-off-by: vibe <francoc137@icloud.com>
Signed-off-by: vibe <francoc137@icloud.com>
|
@arkodg love it, generated 👍 |
|
@arkodg Are e2e tests stable? The output log is massive, so mostly asking if there's a possibility of flakiness considering the other conformance-tests passed, before I jump in to review the logs. |
|
@vibe its flaky, you can ignore it |
Signed-off-by: Arko Dasgupta <arkodg@users.noreply.github.com>
Revisits envoyproxy#6289 which had set SameSite=Strict. This may cause some issues for specific flows I had misinterpresented the meaning of `Disabled` earlier, it means `Unset`, and is separate from `Samsite=None` Signed-off-by: Arko Dasgupta <arko@tetrate.io>
* default on SameSite attribute unset for Oauth2 cookies Revisits #6289 which had set SameSite=Strict. This may cause some issues for specific flows I had misinterpresented the meaning of `Disabled` earlier, it means `Unset`, and is separate from `Samsite=None` Signed-off-by: Arko Dasgupta <arko@tetrate.io> * gen Signed-off-by: Arko Dasgupta <arko@tetrate.io> * more gen Signed-off-by: Arko Dasgupta <arko@tetrate.io> * lint Signed-off-by: Arko Dasgupta <arko@tetrate.io> --------- Signed-off-by: Arko Dasgupta <arko@tetrate.io>
Envoy added support for
SameSiteconfiguration on all oidc cookies. Currently in order to override cookies, you need an elaborateEnvoyPatchPolicy, for a better experience we should provide and map dev-friendly values.Which issue(s) this PR fixes:
Fixes #5229
Release Notes: Yes