eventing icon indicating copy to clipboard operation
eventing copied to clipboard

block the use of external URLs from eventing Destinations

Open duglin opened this issue 4 years ago • 21 comments

Problem

We're running Knative in a managed environment where the eventing infrastructure is something that will be hidden from the user and is really there to drive traffic to the hosted KnServices. In this environment, if we allow the user to specify external URLs for the destinations of the Eventing components (e.g. Sink in an adapter) then we'd get into a situation where people can setup the KnEventing infrastructure to route traffic to something outside of the cluster. So, if the infrastructure is meant to be cost free the user would then have a loop-hole to free cloud eventing infrastructure.

We'd like an operator option to generate an error if any Destination resulted in a URI that is not local to the cluster. Default would be to not enforce such restrictions.

Persona: Operators

Exit Criteria Enable the flag and specify some internet facing URI as a Destination - should result in an error while trying to create the eventing resource with that Destination.

duglin avatar Mar 07 '20 00:03 duglin

@duglin A cluster operator could implement this (and other optional validations) as an additional ValidatingWebhookConfiguration and webhook pod. Would that be sufficient?

grantr avatar Mar 09 '20 23:03 grantr

@grantr as a last resort yes we may have to do something like that, but I’d prefer if there was a more standard option available so that any one who needed this restriction didn’t have to reinvent the wheel.

duglin avatar Mar 10 '20 00:03 duglin

Seems like you could just write a super simple function that just takes the incoming event and calls the external URL? seems like it's semi complex feature that's extremely straightforward to bypass, what am I missing?

vaikas avatar Mar 11 '20 00:03 vaikas

I see, because they'd still be paying for the function invocation?

vaikas avatar Mar 11 '20 00:03 vaikas

Blocking that will do nothing because I can make an addressable crd that hosts an external url and trigger just sees an object ref to a thing that has an address.

Maybe a better solution would be to force your cluster to use an istio mesh?

n3wscott avatar Mar 11 '20 00:03 n3wscott

I see, because they'd still be paying for the function invocation?

Yup. The issue isn't about blocking all outbound connections, it's blocking outbound connections from the eventing infrastructure.

... I can make an addressable CRD...

If I'm following... nope, you can't. In our managed environment people can't create random CRDs.

duglin avatar Mar 11 '20 02:03 duglin

@duglin is this still a priority for you? Do you have anybody that has spare cycles to pick this up?

lberk avatar Jul 13 '20 20:07 lberk

we do still want it - but other work items are taking priority right now. If someone else wants to jump in.... :-)

duglin avatar Jul 13 '20 21:07 duglin

@lionelvillard FYI

duglin avatar Sep 13 '20 22:09 duglin

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Reopen the issue with /reopen. Mark the issue as fresh by adding the comment /remove-lifecycle stale.

github-actions[bot] avatar Dec 13 '20 01:12 github-actions[bot]

/remove-lifecycle stale

duglin avatar Dec 13 '20 11:12 duglin

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Reopen the issue with /reopen. Mark the issue as fresh by adding the comment /remove-lifecycle stale.

github-actions[bot] avatar Mar 14 '21 01:03 github-actions[bot]

/remove-lifecycle stale

duglin avatar Mar 14 '21 03:03 duglin

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Reopen the issue with /reopen. Mark the issue as fresh by adding the comment /remove-lifecycle stale.

github-actions[bot] avatar Jun 29 '21 01:06 github-actions[bot]

/remove-lifecycle stale

lionelvillard avatar Jul 15 '21 00:07 lionelvillard

@duglin what about disabling uri in the destination?

lionelvillard avatar Jul 15 '21 00:07 lionelvillard

@lionelvillard how do you see that being enabled? Flag and then a webhook rejecting its usage if enabled? If so, seems reasonable. We'd need to check to make sure it only rejects absolute URIs, right?

duglin avatar Jul 15 '21 03:07 duglin

yes and yes.

lionelvillard avatar Jul 15 '21 13:07 lionelvillard

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Reopen the issue with /reopen. Mark the issue as fresh by adding the comment /remove-lifecycle stale.

github-actions[bot] avatar Oct 17 '21 01:10 github-actions[bot]

/remove-lifecycle stale

lionelvillard avatar Oct 18 '21 14:10 lionelvillard

/triage accepted

pierDipi avatar Dec 13 '21 08:12 pierDipi