-
Notifications
You must be signed in to change notification settings - Fork 125
Update naming and definition for access control #20
Conversation
@slack do these new names and structures make the access control side of this a little more obvious? @aanandr check out the IdentityBinding section, in particular @nicholasjackson this all fits together a little bit better, there were some ugly edge cases that I tripped over earlier today. WDYT? |
@stefanprodan check out how HTTPRoutes and TrafficTargets work together. The idea is to have a new object that works with HTTPRoutes to apply other types of policy across those routes (retries, timeouts and rate limits). Check out #19 to track the thinking there. Definitely needs some more thought first =) |
@grampelberg I think this is a lot better. I was thinking through the typical "client/server" mental model over the weekend, I think that's the thing that makes this hilariously slippery! The statement "clients have access to services" in SMI becomes "IdentityBindings have permission to TrafficTargets". Would changing Otherwise, this is a great improvement over Role-bits. LGTM. |
I thought about |
3a3c579
to
435f8b7
Compare
LGTM |
### ClusterTrafficTarget | ||
|
||
A `ClusterTrafficTarget` allows policy to be applied to targets that live in | ||
multiple namespaces. This is primarily useful to system wide endpoints such as |
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.
What does this mean? The target is a service. What does it mean to say that target resides in multiple namespaces?
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.
Think global allow policies, there would be multiple things serving traffic and they'd live in multiple namespaces.
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.
Thanks, that makes sense
*server* side of a connection. It is up to implementations to decide whether | ||
they would also like to enforce access control on the *client* side | ||
of the connection as well. | ||
This example uses the `HTTPRoutes` definition 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.
A few questions here
- How will we handle access definition to multiple such services? Would we create a separate ClusterTrafficTarget spec for each or is the matchexpression rich in terms of accepting lists/wildcards?
- What is the namespace parameter under "rules" for? So far rules were generic and didnt have any namespace associated with them
name: path-specific | ||
``` | ||
|
||
This example allows any unauthenticated client access to the rules defined in | ||
`path-specific`. | ||
the `path-specific` TrafficTarget. Groups are more flexible than just | ||
unauthenticated users. Kubernetes defines many groups by default, |
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.
Does such a group (similar to the system one used in this example) have to be created upfront? Would like to understand this a bit more
## RBAC | ||
Continuing with the Prometheus example from above, it is possible to have a | ||
IdentityBinding that grants a specific system service access to an endpoint on | ||
every pod in the cluster. |
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.
Would this be done by playing with the "matches" param a bit and providing an "access all" kind of option in HttpRoutes?
|
||
## Example Implementation | ||
|
||
TODO ... | ||
|
||
## Tradeoffs | ||
|
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.
-
I would like to understand how all this will be used by customers to define access policies for their service mesh. From my understanding it looks like the moment a Policy is defined and applied all communication between all services (both originating from within the cluster and from outside) and destined to the selected service (e.g. "foo" used here) will be blocked except for the ones allowed per the policy. This is a good design but i am also wondering how customers will handle situations where there are many services wanting to talk to a single service. We have a mechanism for talking "TO" multiple services. Do we need one for requests originating "FROM" multiple services and going to a single service?
-
If i want to restrict traffic originating from a Pod/Service and going to an endpoint outside the cluster how do i do that? For e.g., i may want the Pod to be able to access only specific endpoints in my network and residing outside the cluster. I think this has been called out as out of scope below - maybe the solution is something else but bringing up the point here because we are discussing access policies. Would we use Network Policies?
access control as it selects specific pods and not hostnames. Another object | ||
will need to be created to manage this use case. | ||
|
||
* Ingress policy - assuming clients present the correct identity, this *should* |
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.
Ingress Policy kind of touches upon the point i raised earlier
common use cases (filtering by hostname) and will need to be expanded to cover | ||
this use case. | ||
|
||
* Other types of policy - having policy around retries, timeouts and rate limits |
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.
Wouldnt retries and rate limiting also fall under traffic mgmt/routing?
|
||
* Non-HTTP traffic - this specification will need to be expanded to support | ||
traffic such as Kafka or MySQL. | ||
* Other types of identity - there is room to expand the `kind` accepted for |
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.
This will be very useful, for e.g. tying identity to cloud resident identity providers/services like AAD. But for now K8S service accounts is a good start.
This example grants the ability to access the routes in `path-specific` to any | ||
client providing the identity `bar` based on a ServiceAccount. | ||
This example grants the ability to access the `/metrics` route to any client | ||
providing the identity `bar`, based on a ServiceAccount. | ||
|
||
As access control is additive, it is important to provide definitions that allow | ||
non-authenticated traffic access. Imagine rolling a service mesh out |
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.
Cool. I think groups here are addressing the earlier comment i had for not enforcing mTLS for a service for all communication that it terminates
Access Control
specs
tomatches
. This feels like a slightly better word and is 1:1 with the new definition in HTTPRoutes.system:unauthenticated
).matchExpressions
to show a TrafficTarget that works for everything (or as close as possible).Traffic Spec
Host
header FQDN/port combination.