Repository navigation
SPIFFE Broker API & Endpoint - #340
Conversation
|
looking really good. :) |
|
are there plans to continue work on this proposal? with istio ambient mode reaching GA, spire support is needed. |
|
Hi @apexlnc, this topic was discussed at the Istio spec call last week. The Istio community has yet to decide if they want to support a SPIFFE API at ztunnel or other flavors such as Envoy xDS. Until this decision is made this work here is put on hold. Feel free to join today and express your opinion in this topic. |
|
|
@kfox1111 I'm not a bit hesitant adding this API into the standard if we have no client in sight that's picking it up. (In case Istio decides against it) |
|
I agree with Arndt's sentiment here - if we don't have a clear adopter in mind, I would be hesitant to introduce the new specification. It'll be difficult for us to validate the specification is fit for purpose. |
|
I'd use it for making spire-ha-agent -> spiffe-ha-agent. There's also a chicken and the egg issue around it. We may never get users if we dont produce it in the first place. As is, istio ambient has been delaying as "we dont have spiffe support" If we had it, then it would shine light on the issue and prevent that from being used as a reason for not supporting it. |
Is there some documentation/design somewhere for this? It'd be great to explore this in SIG-Spec |
I agree. We already use SPIRE with Istio's sidecar mode. I am eager to replace the sidecars with ambient ... but without the SPIRE/SPIFFE support, that is actually the only pain point why we did not migrate to ambient ;-( |
|
Same. I'm hesitant to deploy ambient without spire support too. |
|
I actually wonder a bit. Just stumpled over: https://www.solo.io/blog/kubernetes-identity-the-right-way-with-spire-and-ambient |
06c5dd2 to
971bd60
Compare
Co-authored-by: Noah Stride <[email protected]> Signed-off-by: arndt-s <[email protected]>
Signed-off-by: arndt-s <[email protected]>
971bd60 to
3d32e1b
Compare
|
|
||
| Some references — such as the process ID — are only meaningful and discoverable on the local node. Clients MUST ensure that local references are not sent to remote Broker API servers, and deployments MUST ensure servers do not receive requests originating from outside the node they run on. This mitigates situations where a Broker requests credentials with a process ID from a different node, where that process ID is used by a different workload. | ||
|
|
||
| Object references (such as `KubernetesObjectReference`) are valid across the control plane that owns the referenced object — for example, anywhere within the same Kubernetes cluster — and MAY be sent across the network within that scope. Object references MUST NOT be honored by a server bound to a different control plane (e.g., a different cluster); servers MUST reject object references that name a control plane they do not serve. |
There was a problem hiding this comment.
The KubernetesObjectReference does not have a field that names the control plane. Should it get an optional cluster?
There was a problem hiding this comment.
My understanding is that the server itself is bound to a dedicated Kubernetes control plane and that the relationship is always 1-1. Maybe that's too much inferring existing SPIFFE architectures but I'm ensure if there's value to open up the Broker API being able to issue credentials from multiple Kubernetes clusters.
There was a problem hiding this comment.
Yes, but here we are asking the server to not honour those requests that are not within its control plane, but offer no way for it to differentiate. I agree that it's unlikely to be an issue in practice, but having something in the reference, which in the case of k8s would likely be the cluster, would help.
Happy to also defer this for a later discussions, since I don't think it's that big of an impediment, and I don't think it's worth delaying the spec for it.
There was a problem hiding this comment.
I don't think we can directly defer because, as you're pointing out, there's no name
servers MUST reject object references that name a control plane they do not serve.
| Server and client MUST ensure that no operations are performed beyond the lifetime of the workload. Once the workload has stopped, the server MUST stop sending responses for that workload, and the client MUST drop all data it received for the workload, removing it from file systems or other locations where it may have been stored. | ||
|
|
||
| What constitutes "stopped" depends on the reference type. For local references (such as a process ID), the workload is considered stopped when the underlying process terminates. For object references (such as a `KubernetesObjectReference`), the workload is considered stopped when the referenced object no longer exists in the control plane, or — when the reference pinned a UID alongside a name — when the object resolved by name no longer matches the pinned UID. |
There was a problem hiding this comment.
Note for SPIRE (and possibly other implementations), this means that workloads may need to be re-attested at least periodically.
I don't know if we want to relax this requirement a bit, does this mean that we would have to watch these resources?
There was a problem hiding this comment.
I think that relaxing the MUST to a SHOULD would decrease security by quite a bit. How do you feel if we add some classifier like in a timely manner? It would give SPIRE and other implementation some leeway to prioritize scale & resiliency and not re-attest at every request?
There was a problem hiding this comment.
That sounds good to me. I think the client (i.e. broker) should try to respond to this quickly and stop the stream, but the server can also do its own check.
For example in SPIRE I think a natural way of doing this is re-triggering attestation every time an updated SVID would be sent to the workload. I don't think we need to have that in the current PR for it, we can see later how we want to handle it.
There was a problem hiding this comment.
How do you feel if we add some classifier like in a timely manner?
That makes sense to me.
Signed-off-by: arndt-s <[email protected]>
4a1882b to
97a5576
Compare
… be only be used with a single CP Signed-off-by: arndt-s <[email protected]>
8c34b19 to
d0d62c1
Compare
|
🚀 ! |
Supersedes: spiffe/spire-api-sdk#92 spiffe/spire-api-sdk#96 SPIFFE PRs: spiffe/spiffe#340 arndt-s/spiffe#1 SPIRE PR: spiffe/spire#6915 Hey @arndt-s, @sorindumitru suggested adding this directly here instead of `spire-api-sdk` since this comes directly from SPIFFE and not SPIRE. Signed-off-by: Matheus Pimenta <[email protected]>
Add an experimental `broker-api` feature with bindings for the SPIFFE Broker API (spiffe/spiffe#340): - the generated `spiffe.broker` client and messages, under `broker_api::pb::spiffe::broker`, with a redacted `Debug` for the SVID messages - an `add_security_header` interceptor for the required `broker.spiffe.io: true` metadata - `From` conversions that pack PID and Kubernetes object references into a `WorkloadReference` with the full type URL `cargo run -p xtask -- gen spiffe` also generates these bindings. The README, CHANGELOG, and Makefile feature lanes cover the new feature. Signed-off-by: Quang Nguyen <[email protected]>
Add an experimental `broker-api` feature with bindings for the SPIFFE Broker API (spiffe/spiffe#340): - the generated `spiffe.broker` client and messages, under `broker_api::pb::spiffe::broker`. The client has no plaintext `connect`, because the Broker Endpoint requires mTLS. - `SecurityHeader`, an interceptor that adds the required `broker.spiffe.io: true` metadata. Like the Workload API interceptor, it runs an optional custom interceptor first, so that interceptor cannot remove or overwrite the header. - `From` conversions that pack PID and Kubernetes object references into a `WorkloadReference` with the full type URL. - a `Debug` for the SVID messages that shows only the length of the private key or token, like `PrivateKey` and the JWT `Token`. `cargo run -p xtask -- gen spiffe` also generates these bindings, without tonic transport code. The Workload API and spire-api output does not change. The README, CHANGELOG, crate summary and description, and the Makefile feature and MSRV lanes cover the new feature. The README states that semver guarantees do not cover it. Signed-off-by: Quang Nguyen <[email protected]>
Add an experimental `broker-api` feature with bindings for the SPIFFE Broker API (spiffe/spiffe#340): - the generated `spiffe.broker` client and messages, under `broker_api::pb::spiffe::broker`. The client has no plaintext `connect`, because the Broker Endpoint requires mTLS. - `SecurityHeader`, an interceptor that adds the required `broker.spiffe.io: true` metadata. Like the Workload API interceptor, it runs an optional custom interceptor first, so that interceptor cannot remove or overwrite the header. - `From` conversions that pack PID and Kubernetes object references into a `WorkloadReference` with the full type URL. The conversions cannot enforce the reference scope from Broker API §3.1.2, so their docs and the module docs state the rules that the caller must enforce. - a `Debug` for the SVID messages that shows only the length of the private key or token, like `PrivateKey` and the JWT `Token`. `cargo run -p xtask -- gen spiffe` also generates these bindings, without tonic transport code. The Workload API and spire-api output does not change. The README, CHANGELOG, crate summary and description, and the Makefile feature and MSRV lanes cover the new feature. The README, the module docs, and the CHANGELOG state the same compatibility policy. While `spiffe` is pre-1.0, a breaking change to `broker-api` requires a minor version bump, and patch releases stay compatible. Signed-off-by: Quang Nguyen <[email protected]>
Add an experimental `broker-api` feature with bindings for the SPIFFE Broker API (spiffe/spiffe#340): - the generated `spiffe.broker` client and messages, under `broker_api::pb::spiffe::broker`. The client has no plaintext `connect`, because the Broker Endpoint requires mTLS. - `SecurityHeader`, an interceptor that adds the required `broker.spiffe.io: true` metadata. Like the Workload API interceptor, it runs an optional custom interceptor first, so that interceptor cannot remove or overwrite the header. - `From` conversions that pack PID and Kubernetes object references into a `WorkloadReference` with the full type URL. The conversions cannot enforce the reference scope from Broker API §3.1.2, so their docs and the module docs state the rules that the caller must enforce. - a `Debug` for the SVID messages that shows only the length of the private key or token, like `PrivateKey` and the JWT `Token`. `cargo run -p xtask -- gen spiffe` also generates these bindings, without tonic transport code. The Workload API and spire-api output does not change. The README, CHANGELOG, crate summary and description, and the Makefile feature and MSRV lanes cover the new feature. The README, the module docs, and the CHANGELOG state the same compatibility policy. While `spiffe` is pre-1.0, a breaking change to `broker-api` requires a minor version bump, and patch releases stay compatible. Signed-off-by: Quang Nguyen <[email protected]>
This PR adds a SPIFFE Broker API and Endpoint to the SPIFFE specification.
See Google doc for design (proto is a bit outdated in it but it gives the idea)
Resolves #313.