Skip to content

Enforce access checks for brokers in the k8s workloadattestor#1

Closed
matheuscscp wants to merge 2 commits into
broker-apifrom
sar-preview
Closed

Enforce access checks for brokers in the k8s workloadattestor#1
matheuscscp wants to merge 2 commits into
broker-apifrom
sar-preview

Conversation

@matheuscscp

@matheuscscp matheuscscp commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Preview for spiffe#7074

SPIRE PR: spiffe#6915

Adds broker-aware Kubernetes authorization checks to the k8s workload attestor. Broker-originated Attest() / AttestReference() calls that reference Kubernetes objects now run a Kubernetes SubjectAccessReview before returning selectors. The SAR uses the broker SPIFFE ID as the username and no groups, and asks whether that user may use SPIRE's custom verb impersonate-via-spire on the referenced object.

For pod references, brokers can also set pod_reference_scope. The default agent_node scope only allows pods whose spec.nodeName matches the configured agent node name (node_name / node_name_env); cluster removes that same-node restriction, but the SubjectAccessReview check still applies.

WorkloadAttestor "k8s" {
  plugin_data {
    node_name_env = "MY_NODE_NAME"

    broker {
      brokers = [
        {
          id = "spiffe://example.org/broker"
          pod_reference_scope = "cluster"
        },
      ]
    }
  }
}

@matheuscscp
matheuscscp force-pushed the sar-preview branch 2 times, most recently from e49dc9a to 0701070 Compare June 20, 2026 01:21
@matheuscscp
matheuscscp force-pushed the broker-api branch 2 times, most recently from b39ff10 to cbb222f Compare June 23, 2026 21:44
@matheuscscp
matheuscscp force-pushed the sar-preview branch 2 times, most recently from b5604c2 to 730151f Compare June 24, 2026 00:23
@matheuscscp
matheuscscp force-pushed the sar-preview branch 2 times, most recently from e6a4e63 to 28c15ce Compare June 24, 2026 01:34
@matheuscscp matheuscscp changed the title Enforce RBAC for brokers in the k8s workloadattesttor Enforce SubjectAccessReview for brokers in the k8s workloadattestor Jun 24, 2026
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
@matheuscscp
matheuscscp force-pushed the sar-preview branch 2 times, most recently from 41f594a to af85f66 Compare June 24, 2026 20:32
@matheuscscp matheuscscp changed the title Enforce SubjectAccessReview for brokers in the k8s workloadattestor Enforce k8s access checks for brokers in the k8s workloadattestor Jun 24, 2026
@matheuscscp matheuscscp changed the title Enforce k8s access checks for brokers in the k8s workloadattestor Enforce access checks for brokers in the k8s workloadattestor Jun 24, 2026
Comment thread conf/agent/agent_full.conf Outdated
Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
@matheuscscp

Copy link
Copy Markdown
Owner Author

Merged it to the main SPIRE PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants