Skip to content
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

CFP: Support basic-auth/oauth2/mTLS for north-south traffic (GatewayAPI/Ingress) #23797

Open
chancez opened this issue Feb 16, 2023 · 31 comments
Labels
area/servicemesh GH issues or PRs regarding servicemesh feature/k8s-gateway-api kind/cfp kind/feature This introduces new functionality. pinned These issues are not marked stale by our issue bot. sig/agent Cilium agent related.

Comments

@chancez
Copy link
Contributor

chancez commented Feb 16, 2023

Cilium Feature Proposal

Describe the feature you'd like

I'd like to be able to expose my applications with various forms of authentication. For example, I want to expose hubble-relay outside of my cluster.

Various authentication mechanisms work better for various situations. Generally all 3 mentioned should be relatively standard APIs for configuration. One thing that would be really nice, is to be able to configure different authentication mechanisms based on different rules. For example, mTLS/client-certs if the request is coming from a certain IP range, and basic-auth/oauth2 if a specific user-agent is set.

(Optional) Describe your proposed solution

I would like these to be expose in GatewayAPI, but Ingress is fine too.

@chancez chancez added the kind/feature This introduces new functionality. label Feb 16, 2023
@artyom-p
Copy link

Planning to migrate from aws-cni + istio to cilium, we have external auth middleware on istios ingressgateway which redirects user to our keykloak instance, at the moment absence of this feature is one of the blockers for migration.

@youngnick
Copy link
Contributor

@artyom-p, could you point me to any documentation about that middleware? The work to design something to do this for Gateway API is still pretty early, so the more concrete examples we have, the better.

I agree these should be exposed in Gateway API, currently Policy Attachment is the way to do this, because noone is sure of the right way to describe the config.

tl;dr Upstream Gateway API design work needs to happen before we can implement this for Gateway API. I'd prefer to wait for that than to add a whole bunch of annotations to Ingress (annotations are sticky and unstructured, which is a bad combination for supportability.)

@artyom-p
Copy link

Thats not related to Gateway API, its a feature of Istio/Envoy itself, just a middleware. You can check example here.

@chancez
Copy link
Contributor Author

chancez commented Feb 22, 2023

Yeah, that filter would be pretty useful. It's pretty common to avoid double proxying with an auth proxy, and using the auth proxy to act more as an authentication/authorization API. This is often used with oauth2-proxy/authelia. I agree adding support for that would be very useful for a lot of users.

@youngnick
Copy link
Contributor

Ah, okay, that's using the ext_auth support, I agree that's very useful, thanks.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not
had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions bot added the stale The stale bot thinks this issue is old. Add "pinned" label to prevent this from becoming stale. label Apr 29, 2023
@github-actions
Copy link

This issue has not seen any activity since it was marked stale.
Closing.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 14, 2023
@chancez chancez reopened this May 15, 2023
@chancez chancez added pinned These issues are not marked stale by our issue bot. and removed stale The stale bot thinks this issue is old. Add "pinned" label to prevent this from becoming stale. labels May 15, 2023
@laibe
Copy link

laibe commented May 26, 2023

would be very much interested in this feature as well!

@squeed squeed added the sig/agent Cilium agent related. label May 26, 2023
@toms-place
Copy link

+1 for this feature! (:

@jbgcarnes
Copy link

Very interested as well.

@rauanmayemir
Copy link
Contributor

Now that cilium supports running envoy in a separate DS, it would make sense to include more built-in extensions like ext_authz, etc.

@Jamison1
Copy link

Jamison1 commented Jul 13, 2023

I am looking for this as well.

Upstream GatewayAPI has an issue tracker for auth. Its listed as backlog due to needing help on it.

As it may be some time before upstream GatewayAPI is resolved, maybe something simple can be enabled in the meantime.

@from-nibly
Copy link

Also a blocker for us to move to cilium ingress.

@unusualfor
Copy link

This is preventing us to fully move to Cilium as well

@liyihuang
Copy link
Contributor

Is it possible to have the field under network policy's HTTP for jwt authz when the gateway API does not have the API? network policy can also be used between backend services, that's useful when the backend svc using jwt to do the authz

@EternalDeiwos
Copy link

EternalDeiwos commented Sep 22, 2023

There was an excellent proposal in kubernetes-sigs/gateway-api#532 that would have allowed for authentication/authorization to be delegated to some external service like OPA. Ideally Ingress, Gateway (global auth) and HTTPRoute could each have something like this.

@Jamison1
Copy link

Here is an example of GatewayAPI auth using an API key as a reference as it seems the Kubernetes upstream is still listed as help needed.

@gsharma-jiggzy
Copy link

Not sure if anyone looked at the Envoy Gateway (https://gateway.envoyproxy.io/latest/user/oidc/) but it has a concept called a security policy for oidc in the next release. It would be great if the security policy would be implemented in a similar manner.

@kevin-shelaga
Copy link

+1 to this feature!

@lukapetrovic-git
Copy link

definite +1 for this!

@abctaylor
Copy link

+1

2 similar comments
@aldycool
Copy link

+1

@svilcu
Copy link

svilcu commented May 23, 2024

+1

@aanm aanm added the kind/cfp label Jun 20, 2024
@simonostendorf
Copy link

This is needed to switch to cilium service mesh.

@ormandj
Copy link

ormandj commented Aug 2, 2024

For the mTLS side: https://gateway-api.sigs.k8s.io/geps/gep-91/

@youngnick
Copy link
Contributor

Auth for north-south Gateway API connections is still being discussed, it looks likely that we'll try and push something forward in Gateway API 1.3, which will start once Gateway 1.2 is out (around Kubecon NA 2024 in mid-November).

Just wanted to let everyone know that this issue is not forgotten, we definitely want to get to it, but we need to work with upstream on doing it the right way.

@youngnick
Copy link
Contributor

Oh, I should note that GEP-91 that @ormandj mentioned above is for specifying a client certificate, but it really only guarantees that the client certificate is signed by the specified CA, it can't handle any authorization based on the contents of the certificate or JWT or anything - that will require something else (which is what we're going to work on soon).

@ormandj
Copy link

ormandj commented Aug 14, 2024

@youngnick good point - this has been a major sticking point for us with moving towards Gateway API for everything; how to not just authenticate clients but handle authorization based on their identity.

As a temporary solution, you can create and manage a CA per role and generate client certificates this way, but the management overhead isn't ideal. It'd be nice if there was something available like this, at least as a temporary stop-gap until the more correct/full-featured implementation was in place.

sholdee added a commit to sholdee/home-ops that referenced this issue Oct 22, 2024
@zviratko
Copy link

It would be great if one could add a header containing the client certificate DN (and possibly the CA chain that authenticated it). That way many applications can be extended to consume this (as long as that header can be trusted that is).

@AlexanderSarson
Copy link

+1

@youngnick
Copy link
Contributor

The Gateway API Auth GEP is scheduled to be worked on as part of the v1.3 release, see kubernetes-sigs/gateway-api#1494 for the details.

Once this GEP has moved to Experimental, we will add support for it in Cilium. I can't guarantee that will happen in the Cilium 1.17 timeframe, but we will definitely add it once it's in upstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/servicemesh GH issues or PRs regarding servicemesh feature/k8s-gateway-api kind/cfp kind/feature This introduces new functionality. pinned These issues are not marked stale by our issue bot. sig/agent Cilium agent related.
Projects
None yet
Development

No branches or pull requests