Create a custom role with the following six data actions and assign it to the
onboarded App Registration at the Subscription or Resource Group level. The built-in
Azure Kubernetes Service RBAC Reader role is not sufficient.
{
"Name": "PANW K8s Watcher",
"Description": "Read-only Kubernetes access for Palo Alto Networks Cloud IP-Tag",
"AssignableScopes": ["/subscriptions/<subscription-id>"],
"Actions": [],
"DataActions": [
"Microsoft.ContainerService/managedClusters/pods/read",
"Microsoft.ContainerService/managedClusters/services/read",
"Microsoft.ContainerService/managedClusters/endpoints/read",
"Microsoft.ContainerService/managedClusters/nodes/read",
"Microsoft.ContainerService/managedClusters/discovery.k8s.io/endpointslices/read",
"Microsoft.ContainerService/managedClusters/authorization.k8s.io/selfsubjectaccessreviews/write"
]
}
The sixth action is selfsubjectaccessreviews/write—not
/create. The system runs a SelfSubjectAccessReview check before
monitoring a cluster; without this permission, the check is denied and the cluster
is never monitored. Azure role assignments can take up to approximately 10 minutes
to take effect.
Option B — Kubernetes RBAC: ClusterRole and ClusterRoleBinding (per
cluster)
Apply the following YAML in each cluster. Set the subject name to the App
Registration client ID:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: panw-k8s-watcher
rules:
- apiGroups: [""]
resources: ["pods", "services", "endpoints", "nodes"]
verbs: ["get", "list", "watch"]
- apiGroups: ["discovery.k8s.io"]
resources: ["endpointslices"]
verbs: ["get", "list", "watch"]
- apiGroups: ["authorization.k8s.io"]
resources: ["selfsubjectaccessreviews"]
verbs: ["create"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: panw-k8s-watcher-binding
subjects:
- kind: User
name: "<app-registration-client-id>"
apiGroup: rbac.authorization.k8s.io
roleRef:
kind: ClusterRole
name: panw-k8s-watcher
apiGroup: rbac.authorization.k8s.io