PRs: #7122, #7123, #7141, #7142
Unblocks: spiffe/helm-charts-hardened#868
My plan for Deployment agents in terms of registration entries is as follows. It supports multiple Deployment agents in the Kubernetes cluster, in any namespaces. (The below is fully written by hand, no AI, please read everything!)
k8s_psat node attestor cluster entries
Cluster entries in the k8s_psat node attestor configuration are just named rules the agents can choose among for defining the format of the SPIFFE ID they will get, they do not define selectors or entry authorization (see next sections). The selectors emitted for agents attesting by this method are fixed.
In a Kubernetes cluster with both DaemonSet agents and Deployment agents, two entries are needed in the server-side config of k8s_psat:
- The usual one, defaulting to node-UID SPIFFE IDs for agents
- An additional entry using
use_pod_uid_for_agent_id
If the cluster has multiple Deployments acting as SPIRE agents, all of them can reference the second (pod-UID-based) cluster entry without conflicts.
The DaemonSet agent uses the first cluster entry (node-UID-based). If there's only one DaemonSet agent in the cluster (e.g. the one deployed by the SPIRE Helm chart), this is enough. If there are multiple DaemonSets, then only one can use the first node-UID-based cluster entry, all the others have to use the pod-UID-based entry or create a new node-UID-based cluster entry.
Alias entries
A single alias is needed for each SPIRE agent, regardless if Deployment or DaemonSet. Multiple aliases for the same group-of-pods SPIRE agent do not improve security, because at the end all of them have to select the same set of agent pods. In other words, from the perspective of alias entries, a group of pods representing the same logical SPIRE agent is the atomic unit. In Kubernetes, that is represented by the ServiceAccount being shared by all the pods in that group.
So for each Deployment or DaemonSet that is a SPIRE agent in the cluster, I'd recommend a single alias entry:
- Parent ID: SPIRE server ID
- SPIFFE ID: the alias ID for a specific group of pods (Deployment or DaemonSet)
- Selectors:
k8s_psat:cluster:<cluster> (The server-side cluster entry the agent has chosen to join, see previous section)
k8s_psat:agent_ns:<namespace>
k8s_psat:agent_sa:<service-account>
In the Helm chart for deploying a Deployment-based Broker API agent, a ClusterStaticEntry can be used for the alias entry.
Broker entries
Usual Workload API business. Brokers get SVIDs just like any other workload, via Workload API. The existing governance applies. The Broker-over-TCP chart can facilitate this as well, by creating a ClusterStaticEntry for each broker ID with the parent set to the alias for DaemonSet agents.
Broker access to object entries
Opt into SubjectAccessReview (access_policy = "enforced"). In this case, the broker ID is used as a Kubernetes username for a SubjectAccessReview with verb impersonate-via-spire on the referenced object. The Broker-over-TCP chart can facilitate this as well, by creating RBAC resources to satisfy the required access relationships.
Object entries
Can be initially created via ClusterStaticEntry, and later via #7075. They will usually point to a single parent alias, but there can be multiple entries for the same object pointing to multiple parent aliases. (This should be a requirement for #7075.)
PRs: #7122, #7123, #7141, #7142
Unblocks: spiffe/helm-charts-hardened#868
My plan for Deployment agents in terms of registration entries is as follows. It supports multiple Deployment agents in the Kubernetes cluster, in any namespaces. (The below is fully written by hand, no AI, please read everything!)
k8s_psatnode attestor cluster entriesCluster entries in the
k8s_psatnode attestor configuration are just named rules the agents can choose among for defining the format of the SPIFFE ID they will get, they do not define selectors or entry authorization (see next sections). The selectors emitted for agents attesting by this method are fixed.In a Kubernetes cluster with both DaemonSet agents and Deployment agents, two entries are needed in the server-side config of
k8s_psat:use_pod_uid_for_agent_idIf the cluster has multiple Deployments acting as SPIRE agents, all of them can reference the second (pod-UID-based) cluster entry without conflicts.
The DaemonSet agent uses the first cluster entry (node-UID-based). If there's only one DaemonSet agent in the cluster (e.g. the one deployed by the SPIRE Helm chart), this is enough. If there are multiple DaemonSets, then only one can use the first node-UID-based cluster entry, all the others have to use the pod-UID-based entry or create a new node-UID-based cluster entry.
Alias entries
A single alias is needed for each SPIRE agent, regardless if Deployment or DaemonSet. Multiple aliases for the same group-of-pods SPIRE agent do not improve security, because at the end all of them have to select the same set of agent pods. In other words, from the perspective of alias entries, a group of pods representing the same logical SPIRE agent is the atomic unit. In Kubernetes, that is represented by the ServiceAccount being shared by all the pods in that group.
So for each Deployment or DaemonSet that is a SPIRE agent in the cluster, I'd recommend a single alias entry:
k8s_psat:cluster:<cluster>(The server-side cluster entry the agent has chosen to join, see previous section)k8s_psat:agent_ns:<namespace>k8s_psat:agent_sa:<service-account>In the Helm chart for deploying a Deployment-based Broker API agent, a ClusterStaticEntry can be used for the alias entry.
Broker entries
Usual Workload API business. Brokers get SVIDs just like any other workload, via Workload API. The existing governance applies. The Broker-over-TCP chart can facilitate this as well, by creating a ClusterStaticEntry for each broker ID with the parent set to the alias for DaemonSet agents.
Broker access to object entries
Opt into SubjectAccessReview (
access_policy = "enforced"). In this case, the broker ID is used as a Kubernetes username for a SubjectAccessReview with verbimpersonate-via-spireon the referenced object. The Broker-over-TCP chart can facilitate this as well, by creating RBAC resources to satisfy the required access relationships.Object entries
Can be initially created via ClusterStaticEntry, and later via #7075. They will usually point to a single parent alias, but there can be multiple entries for the same object pointing to multiple parent aliases. (This should be a requirement for #7075.)