Skip to content

x509pop grouping selector #7001

Description

@kfox1111

Problem Statement

When deploying a the spire-iidentity-exchange alongside a spire-agent inside a standard Kubernetes Deployment (rather than a DaemonSet), each individual pod's spire-agent must obtain a unique SPIFFE ID via a node attestation method like x509pop to avoid kicking each other out.

However, because these agents act on behalf of a singular, logical "identity exchange" service, a SPIRE administrator needs a clean way to register downstream workload entries using a single, static parentID (e.g., spiffe://example.org/spire-identity-exchange). Currently, there is a missing link to bridge the gap between unique per-agent SPIFFE IDs and a common identity/selector that a Node Alias can target.

Without this, managing individual registration entries for every scaled replica of an identity-exchange pod becomes unmaintainable.

Proposed Solution Architecture

The goal is to deploy spire-identity-exchange as a standard Kubernetes Deployment.

The host-level agents run standard node attestation (e.g., k8s_psat).

The specialized Deployment pods use the SPIFFE CSI driver to receive an SVID, then use x509pop to attest to the SPIRE server.

The server needs to generate a non-unique, common selector based on the attested agent's path metadata so a Node Alias can target all instances of this deployment.

Considered Options

Option 1: Introduce Path/Parent Selector Logic to x509pop (Preferred)

Modify the x509pop server node attestor to generate a selector based on a "parent" or "trimmed" path derived from the configured agent_path_template.

Example Structure:

SVID provided to agent: spiffe://spire-exchange/k8s/clusterfoo/spire-identity-exchange/abcdefg

Generated Agent SVID: spiffe://spire/agent/x509pop/k8s/clusterfoo/spire-identity-exchange/abcdefg

New Auto-Generated Selector:
x509pop:agent_path_parent:spiffe://spire/agent/x509pop/k8s/clusterfoo/spire-identity-exchange (analogous to a dirname operation on the path template).

A single Node Alias entry can then target x509pop:agent_path_parent:spiffe://spire/agent/x509pop/k8s/clusterfoo/spire-identity-exchange and project the target spiffe://example.org/spire-identity-exchange parent ID to all instances seamlessly.

Option 2: Static Group Config for x509pop

Introduce an option such as extra_groups or static selectors into the x509pop configuration that allows adding generic classification selectors during attestation.

Example Config: config.x509pop.extraGroups = ["spire-identity-exchange"]

Resulting Selector: x509pop:static_group:spire-identity-exchange

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions