使用 AAD Pod 标识使用托管标识的安全问题

Security concerns of using managed identity using AAD Pod Identities

我一直在研究托管身份和 AKS 集群,这是我的理解:

现在我的问题是,假设我有两个不同的 pods。一个pods想要 访问 keyvault,另一个 pods 想要访问 Azure DNS。这 使这项工作的唯一方法是将用户管理的身份修改为 授予对这两种资源的访问权限。但现在看来 pods 都可以 访问这两个资源。

现在我的问题是:

关于 AKS 中的托管标识,它们有两个用途。 AKS 集群本身及其 pods.

关于集群的托管标识,该标识用于访问 the docs 中所述的多个 azure 资源:

Currently, an Azure Kubernetes Service (AKS) cluster (specifically, the Kubernetes cloud provider) requires an identity to create additional resources like load balancers and managed disks in Azure. This identity can be either a managed identity or a service principal.

那么你有managed identities for Pods目前处于预览阶段,仅在 linux 个节点上可用! 您可以 create more than one of them and assign permissions per identity. Then you need to add a pod identity 引用托管标识并在部署容器时使用它。

通过这种方式您最多可以拥有 200 个 pod 身份。

所以,回到这个问题

Now my question is, let's say I have two different pods. One pods want to access keyvault and the other pods wants to access Azure DNS. The only way of making this work is modifying the user managed identity to give access to both the resources. But now it seems both the pods can access both the resources.

这是不正确的,如前所述,您可以拥有多个 pod 身份,每个身份都有自己的访问权限。