-
Notifications
You must be signed in to change notification settings - Fork 125
Policy #9
Comments
Notes:
|
I thought it'd be interesting to see this from the RBAC perspective. The more I think about it, I really like having clients referenced by identity (eg authorizing for them) and servers referenced by logical concept (eg service, deployment, pod, ...). I need to spend a bunch more time thinking about this, but it feels pretty flexible and makes sense to me at the moment at least. TrafficRoleThese are meant to live inside a namespace, akin to Role. This specific example shows how to do a Role that references a deployment, restricts by method and path (regex). kind: TrafficRole
apiVersion: v1beta1
metadata:
name: path-specific
namespace: default
rules:
- resources:
- name: foo-775b9cbd88-ntxsl
namespace: default
kind: Deployment
methods:
- GET
paths:
- '/authors/\d+' TrafficRoleBindingRoles are bound to different subjects. In this first example, a service account is granted access to the previous kind: TrafficRoleBinding
apiVersion: v1beta1
metadata:
name: account-specific
namespace: default
subjects:
- kind: ServiceAccount
name: foo-account
namespace: default
roleRef:
kind: TrafficRole
name: path-specific For another example, the subject is changed up to reference a deployment instead of a service account. kind: TrafficRoleBinding
apiVersion: v1beta1
metadata:
name: account-specific
namespace: default
subjects:
- kind: Deployment
name: bar
namespace: default
roleRef:
kind: TrafficRole
name: path-specific ClusterTrafficRoleAlongside TrafficRole's that are specific and live inside namespaces, it is valuable to define cluster wide roles that can be defaults. This example shows how the cluster can allow everything by default. Take notice of the kind: ClusterTrafficRole
apiVersion: v1beta1
metadata:
name: default-allow
rules:
- resources:
- kind: *
methods: ["*"]
paths: ["*"] ClusterTrafficRoleBindingThe accompanying binding for ClusterTrafficRoles. Kind is kind: ClusterTrafficRoleBinding
apiVersion: v1beta1
metadata:
name: default-allow
namespace: default
subjects:
- kind: *
roleRef:
kind: ClusterTrafficRole
name: default-allow |
Had the following 3 comments/suggestions which we can discuss tomorrow
|
@aanandr great questions! Let me try and give my answers inline. If anything is unclear I'm happy to jump on a call and talk it through =)
I believe that policy without identity (mTLS) is the same as NetworkPolicy. I'm sure there's something I'm missing there though!
It feels like this is another NetworkPolicy similarity. While SMI 100% should be able to simply define TCP (see TCPService in the current PR), the real benefit to having a service mesh is that you can apply policy above L3/4 and make it application aware. A demo for Kubecon probably doesn't need to tell the entire story, but the spec really should explain why this is better than just using NetworkPolicy.
Yup, that's what that is =) Make sure to check out #16 for some extra details! |
Following yesterdays call we discussed the possibility of changing the TLS spec to a higher level Policy spec. Rather than assigned identity, we would have a specification which controls which services are allowed to communicate.
Adding this here to start a discussion, the following example would define a policy which would allow service.a to communicate with service.b and service.c. All other communication would be denied. It is assumed that allow rules would have a higher priority than deny rules, however, this would be based on the concrete implementation.
Questions:
cc. @grampelberg
The text was updated successfully, but these errors were encountered: