You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue tracks the requirements and design for the security of the data plane. @evankanderson assigning to you as I know you were looking at the various aspects of this.
We started a doc here, but I don't think I was able to get anyone else to add their requirements. We also have some interesting internal requirements which I'll try to synthesize into public form, though they may boil down to "custom admission control may be needed here".
For data plane access control, I see four options:
Limit access by using DNS -- restrict who can resolve the DNS name of the channel, possibly including a nonce in the actual expected hostname to reduce ability to guess at the endpoint. Cons: probably technically infeasible with kubernetes or other off the shelf resolvers (DNS does not have strong mechanisms for authenticating DNS clients). A name resolution leak (i.e. by passing results from one container to another) is an access control compromise. Feels like this is building a house of cards.
Limit access by using IP level controls, i.e. kubernetes NetworkPolicy. Pros: probably widely available via CNI providers: Calico/Canal, Weave, kube-router, Cilium, or Romana support NetworkPolicy. No need for service mesh installation. Cons: No fine-grained support for distinguishing below the IP level (hostname, path). May be difficult to support cross-cluster integrations. Encryption support dependent on CNI provider (maybe only Calico, Weave?)
Embrace the use of Istio/service mesh, and use layer-7 access control and policy to control access. Pros: Supports fine-grained control (path-level and hostname-level) access control. Supports access control based on application-level identity which should work from off-cluster. Support for encryption provided by the service mesh. Cons: Requires running Istio in sidecar mode, which adds cold-start latency for Serving. Adds a hard dependency on Istio.
Implement access control in application software. Cons: Requires all application software to implement access control: via shared libraries in multiple languages, or via sidecar (see item 3 for sidecar approach). Introduces versioning and possible security issues when libraries are inconsistently applied. Still needs a mechanism to push access control policy to all participating nodes. This basically ignores the problem and pushes it on developers rather than solving it.
Options 2 and 3 seem the most feasible. One possible additional option (suggested by @Harwayne) was to have an abstract access control interface which would determine the concrete source/destination which should be allowed and then multiple implementations of the access control interface for different option 2 or option 3 providers.
Note that doing this would either require that we think carefully about IP-level segregation of channel ingresses (and possibly also sinks) or that running in option 2 mode would be only a partial security solution.
This needs to be broken down into smaller steps. It may be worth using a Project to track this. Some sample stories/steps:
List of minimal "allowable" sharing cases.
Implementation of TLS between data plane components.
Peer-to-peer authentication technology between data plane components (recommend OAuth?)
Decision about how to perform authz between data plane components (i.e. which identity can send events). Possibly define new objects to describe the allowed connections.
Those comments veer into the detailed design bit. To enable the point-to-point auth, we are proposing to use the workload identity/service account and JWTs. In addition to the sub and aud claims, receivers will need a configuration back to the issuer (iss) to verify the token.
It is easy to map cluster generated tokens that are automatically refreshed at half their expiry period.
Implementations like the AAD Pod Identity referenced above allow those identities to be identities that can be used off cluster or for other managed services within a cloud provider. This allows for verifiable cross cluster communication.
Would requiring a CNI implementation with encryption support be acceptable for on-cluster networking?
Not sure, I don't know how an encrypted CNI would work in terms of controlling keys, certs etc.
TLS provides privacy and authentication, under the strict control of each endpoint - the connected entities establish trust and private comms with each other and don't have to trust anyone else. I guess Tokens would fill the authentication need, and a encrypted CNI could provide privacy, but now everybody has to trust the CNI implementation.
For off-cluster networking, TLS encryption (or equivalent, e.g. IPSec) would seem to be required.
I'm still getting my head around the on/off-cluster distinction, but I don't yet see why the security requirements are any different. The cluster is a shared network, potentially anyone with a credit card can get on it. Of course there are safeguards, like the real internet, but can you trust them?
Would requiring a CNI implementation with encryption support be acceptable for on-cluster networking?
Not sure, I don't know how an encrypted CNI would work in terms of controlling keys, certs etc.
An encrypted CNI establishes network encryption between Kubernetes Nodes (which are all assumed to be on a flat-topology (directly reachable by IP) network. The key distribution and encryption is handled by the cluster operator rather than by the individual components. This is often done using IPSec, but there are various IP encapsulation strategies available.
TLS provides privacy and authentication, under the strict control of each endpoint - the connected entities establish trust and private comms with each other and don't have to trust anyone else. I guess Tokens would fill the authentication need, and a encrypted CNI could provide privacy, but now everybody has to trust the CNI implementation.
The connected entities need some mechanism for introduction and identity proof. For TLS, this is usually a certificate signed by a CA that the caller trusts (and the caller may not need to provide a cert -- mutual TLS requires distributing signed certificates to both parties, rather than just the "server"). There are other possible introduction mechanisms, but managing CA keys and getting signed certs distributed to clusters is actually non-trivial. (There are also possible trust issues beyond this -- see SPIFFE for details about how different CAs may be limited to only signing for certain trust domains.)
The two big challenges here are:
Getting a signed key for the server
Getting the CA key onto the client
If you have a public internet IP or DNS name you control, ACME can be used to acquire item 1 from (for example) LetsEncrypt. Many useful installations don't want to be internet-exposed, and LetsEncrypt already has pretty hard rate limits (50/week requests per subdir).
For off-cluster networking, TLS encryption (or equivalent, e.g. IPSec) would seem to be required.
I'm still getting my head around the on/off-cluster distinction, but I don't yet see why the security requirements are any different. The cluster is a shared network, potentially anyone with a credit card can get on it. Of course there are safeguards, like the real internet, but can you trust them?
I'm not sure what your threat model here is -- you say "the cluster is a shared network, potentially anyone with a credit card can get on it".
Most cloud providers are offering private per-customer VPC networks at this point; similarly, for a private network (home behind NAT or enterprise), presumably network access is controlled, and an encrypted CNI (providing a shared encryption key across the Kubernetes cluster) could further prevent tampering with packets if you trust the host administrators but not the network itself.
If you don't trust the host administrators (who control the Node's kernel and container runtime), you're in a difficult position -- Linux containers won't prevent host-level root from just scanning for keys or data from /proc/<pid>/mem directly.
@evankanderson I think that makes sense. It is worthwhile spelling out the trust requirements.
containers can't snoop on each others connections
intruders with unauthorized network access can't snoop on connections
trust: the cloud provider can snoop on or modify anything
not sure what your threat model here is --
My default threat model is "if I don't understand it, it's probably not safe :)"
Thanks for taking the time to explain.
No problem -- it helps to know what you're trying to defend against.
I think we have three or four different profiles of operators:
Public Cloud Providers.
We want to build something which can be shipped by cloud providers and work, but most cloud providers will go over everything and add their own integrations with the rest of their cloud products.
Most public cloud providers will also have dedicated security experts who can evaluate many of these components in the context of the particular cloud provider's security system and threat model. Additionally, public cloud providers (by their nature) must assume that their customers are malicious and attempting to compromise both the cloud provider and the other tenants (the "anyone with a credit card" argument). Other profiles may not have this problem.
Private Clouds.
This covers a range of on-premises deployments with varying levels of skill. Some will be packaged deployments or set up by a professional services organization; others may be sophisticated environments managed by best-in-class experts; some will be forgotten experiments with no patches applied.
One general feature of private cloud deployments is that all tenants eventually report up to the same organizational head, which means that security (to some extent) is a shared responsibility. Some organizations may choose to further segment tenants and clusters onto different infrastructure and clusters for additional security, but this is still a more-cooperative game than public cloud.
Hobbyist setups.
This is a special form of private clouds (possibly similar to the "forgotten experiment" case above), but the amount of stored business value is very low. They may also experience a high churn rate depending on the owner's free time, but the main security concern here is simply in preventing the resources from being harvested and re-used by attackers as jumping-off points for botnet operations.
Summary:
Public Cloud Provider -- don't fundamentally drop the ball and it will be fine.
Private Cloud -- install out of the box with guard-rails, support a wide range of policy customization.
Hobbyist -- prevent internet exposure. Consider auto-update if internet-exposed.
I think the requirements and principles outlined here give us enough to move forward. Future work will take place under #1449
/close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
Activity
evankanderson commentedon Jan 7, 2019
A few short thoughts and some doc links:
We started a doc here, but I don't think I was able to get anyone else to add their requirements. We also have some interesting internal requirements which I'll try to synthesize into public form, though they may boil down to "custom admission control may be needed here".
For data plane access control, I see four options:
Limit access by using DNS -- restrict who can resolve the DNS name of the channel, possibly including a nonce in the actual expected hostname to reduce ability to guess at the endpoint.
Cons: probably technically infeasible with kubernetes or other off the shelf resolvers (DNS does not have strong mechanisms for authenticating DNS clients). A name resolution leak (i.e. by passing results from one container to another) is an access control compromise. Feels like this is building a house of cards.
Limit access by using IP level controls, i.e. kubernetes
NetworkPolicy.Pros: probably widely available via CNI providers: Calico/Canal, Weave, kube-router, Cilium, or Romana support
NetworkPolicy. No need for service mesh installation.Cons: No fine-grained support for distinguishing below the IP level (hostname, path). May be difficult to support cross-cluster integrations. Encryption support dependent on CNI provider (maybe only Calico, Weave?)
Embrace the use of Istio/service mesh, and use layer-7 access control and policy to control access.
Pros: Supports fine-grained control (path-level and hostname-level) access control. Supports access control based on application-level identity which should work from off-cluster. Support for encryption provided by the service mesh.
Cons: Requires running Istio in sidecar mode, which adds cold-start latency for Serving. Adds a hard dependency on Istio.
Implement access control in application software.
Cons: Requires all application software to implement access control: via shared libraries in multiple languages, or via sidecar (see item 3 for sidecar approach). Introduces versioning and possible security issues when libraries are inconsistently applied. Still needs a mechanism to push access control policy to all participating nodes. This basically ignores the problem and pushes it on developers rather than solving it.
evankanderson commentedon Jan 7, 2019
Options 2 and 3 seem the most feasible. One possible additional option (suggested by @Harwayne) was to have an abstract access control interface which would determine the concrete source/destination which should be allowed and then multiple implementations of the access control interface for different option 2 or option 3 providers.
Note that doing this would either require that we think carefully about IP-level segregation of channel ingresses (and possibly also sinks) or that running in option 2 mode would be only a partial security solution.
grantr commentedon Jan 8, 2019
Punting this to 0.4. We have a start but nothing that could be called a design proposal.
/milestone v0.4.0
vaikas commentedon Mar 25, 2019
Let's break this down to Generic Security Requirements for now, then gather the requirements and then generate more fine grained issues to track.
[-]Security design & requirements[/-][+]Security requirements[/+]evankanderson commentedon Mar 25, 2019
This needs to be broken down into smaller steps. It may be worth using a Project to track this. Some sample stories/steps:
lindydonna commentedon Mar 27, 2019
/milestone 0.6
15 remaining items
evankanderson commentedon May 28, 2019
I think Mike assumed one item that isn't clear here -- standardizing on OpenID / JWTs with
subandaudclaims (and targets verifying theaudclaims).Rationale for preferring JWTs over something like x509 certs:
mikehelmick commentedon May 29, 2019
Thanks @evankanderson
Those comments veer into the detailed design bit. To enable the point-to-point auth, we are proposing to use the workload identity/service account and JWTs. In addition to the
subandaudclaims, receivers will need a configuration back to the issuer (iss) to verify the token.It is easy to map cluster generated tokens that are automatically refreshed at half their expiry period.
Implementations like the AAD Pod Identity referenced above allow those identities to be identities that can be used off cluster or for other managed services within a cloud provider. This allows for verifiable cross cluster communication.
alanconway commentedon May 29, 2019
Are all connections in the diagram are TLS encrypted to avoid snooping and MITM attacks? Perhaps that should be explicitly stated.
evankanderson commentedon May 29, 2019
Would requiring a CNI implementation with encryption support be acceptable for on-cluster networking?
For off-cluster networking, TLS encryption (or equivalent, e.g. IPSec) would seem to be required.
alanconway commentedon May 30, 2019
Not sure, I don't know how an encrypted CNI would work in terms of controlling keys, certs etc.
TLS provides privacy and authentication, under the strict control of each endpoint - the connected entities establish trust and private comms with each other and don't have to trust anyone else. I guess Tokens would fill the authentication need, and a encrypted CNI could provide privacy, but now everybody has to trust the CNI implementation.
I'm still getting my head around the on/off-cluster distinction, but I don't yet see why the security requirements are any different. The cluster is a shared network, potentially anyone with a credit card can get on it. Of course there are safeguards, like the real internet, but can you trust them?
evankanderson commentedon May 30, 2019
An encrypted CNI establishes network encryption between Kubernetes Nodes (which are all assumed to be on a flat-topology (directly reachable by IP) network. The key distribution and encryption is handled by the cluster operator rather than by the individual components. This is often done using IPSec, but there are various IP encapsulation strategies available.
The connected entities need some mechanism for introduction and identity proof. For TLS, this is usually a certificate signed by a CA that the caller trusts (and the caller may not need to provide a cert -- mutual TLS requires distributing signed certificates to both parties, rather than just the "server"). There are other possible introduction mechanisms, but managing CA keys and getting signed certs distributed to clusters is actually non-trivial. (There are also possible trust issues beyond this -- see SPIFFE for details about how different CAs may be limited to only signing for certain trust domains.)
The two big challenges here are:
If you have a public internet IP or DNS name you control, ACME can be used to acquire item 1 from (for example) LetsEncrypt. Many useful installations don't want to be internet-exposed, and LetsEncrypt already has pretty hard rate limits (50/week requests per subdir).
Kubernetes also offers a cert-signing API, but the approval mechanism is not automated, and introducing the cluster's CA key onto clients may also be challenging.
I'm not sure what your threat model here is -- you say "the cluster is a shared network, potentially anyone with a credit card can get on it".
Most cloud providers are offering private per-customer VPC networks at this point; similarly, for a private network (home behind NAT or enterprise), presumably network access is controlled, and an encrypted CNI (providing a shared encryption key across the Kubernetes cluster) could further prevent tampering with packets if you trust the host administrators but not the network itself.
If you don't trust the host administrators (who control the Node's kernel and container runtime), you're in a difficult position -- Linux containers won't prevent host-level root from just scanning for keys or data from
/proc/<pid>/memdirectly.alanconway commentedon May 31, 2019
@evankanderson I think that makes sense. It is worthwhile spelling out the trust requirements.
evankanderson commentedon May 31, 2019
No problem -- it helps to know what you're trying to defend against.
I think we have three or four different profiles of operators:
Public Cloud Providers.
We want to build something which can be shipped by cloud providers and work, but most cloud providers will go over everything and add their own integrations with the rest of their cloud products.
Most public cloud providers will also have dedicated security experts who can evaluate many of these components in the context of the particular cloud provider's security system and threat model. Additionally, public cloud providers (by their nature) must assume that their customers are malicious and attempting to compromise both the cloud provider and the other tenants (the "anyone with a credit card" argument). Other profiles may not have this problem.
Private Clouds.
This covers a range of on-premises deployments with varying levels of skill. Some will be packaged deployments or set up by a professional services organization; others may be sophisticated environments managed by best-in-class experts; some will be forgotten experiments with no patches applied.
One general feature of private cloud deployments is that all tenants eventually report up to the same organizational head, which means that security (to some extent) is a shared responsibility. Some organizations may choose to further segment tenants and clusters onto different infrastructure and clusters for additional security, but this is still a more-cooperative game than public cloud.
Hobbyist setups.
This is a special form of private clouds (possibly similar to the "forgotten experiment" case above), but the amount of stored business value is very low. They may also experience a high churn rate depending on the owner's free time, but the main security concern here is simply in preventing the resources from being harvested and re-used by attackers as jumping-off points for botnet operations.
Summary:
grantr commentedon Jun 24, 2019
/milestone v0.8.0
mikehelmick commentedon Aug 2, 2019
I think the requirements and principles outlined here give us enough to move forward. Future work will take place under #1449
/close
knative-prow-robot commentedon Aug 2, 2019
@mikehelmick: Closing this issue.
Details
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
[main] Sync Konflux configurations (knative#705)