-
Notifications
You must be signed in to change notification settings - Fork 150
Provide Spire Workload Attestation Support to ztunnel #1676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Hi @MikeZappa87. Thanks for your PR. I'm waiting for a istio member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
c4574f8 to
86ee7b5
Compare
0c3d82d to
61672b7
Compare
61672b7 to
66e3f84
Compare
2880b7c to
5fa989e
Compare
5fa989e to
6bca259
Compare
9105d4e to
c20b489
Compare
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
Hey @MikeZappa87 we are (RH) interested in this feature, can I somehow help to push it forward ? |
@Dimss feel free to msg myself and Arndt on istio slack to discuss. We went the istio community sync before the holidays and had a couple action items. I removed the selector approach as it would reduce the friction with this PR. Selector mode is a SPIRE specific implementation and does not exist in the SPIFFE specification. Right now, Arndt is doing work on the SPIFFE broker API spec which is what I believe the istio community would want as the current implementation is spire specific as a spiffe api does not exist yet. Slack thread: https://istio.slack.com/archives/C049TCZMPCP/p1765304313250799 |
|
@MikeZappa87 hey Mike! This is going to be super helpful... Anything I can do to help move this along? I've got a few commits on SPIRE, do you need help pushing anything on that side forward? |
The istio community doesn't like the spire specific delegated identity api and want the spiffe broker endpoint api. We are working with the spiffe community to get that moving. Reach out to me on the istio slack, I can add you to the chat. |
SPIRE Delegated Identity API Integration for ztunnel
Overview
This document describes the design and implementation of SPIRE integration in ztunnel using the Delegated Identity API. The implementation supports two attestation modes: Selector-based and PID-based, each with different security and efficiency trade-offs.
Background
Current ztunnel Certificate Management
The existing ztunnel certificate management uses
SecretManagerto cache certificates byIdentity(SPIFFE ID). When multiple pods share the same service account, they share a single cached certificate, reducing CA calls and memory usage.SPIRE Delegated Identity API
SPIRE's Delegated Identity API allows a trusted delegate (ztunnel) to request certificates on behalf of workloads. The API supports two attestation methods:
Design
Attestation Modes
In PID mode, each workload is attested individually using its container process ID. This approach:
CompositeId Design
Motivation
The original
SecretManagerusedIdentityas the cache key. To support PID-based attestation while maintaining backward compatibility with the existingCaClientTraitinterface, we introducedCompositeId<RequestKeyEnum>.Structure
Trade-offs
This design was chosen to maintain backward compatibility with
CaClientTrait:Benefits:
SecretManagercan track per-workload state when neededConsequences:
SecretManagercaches byCompositeId, resulting in one cache entry per pod even if they share the same identityPID Verification Flow
In PID mode, ztunnel performs the following steps:
WorkloadUidComparison Summary
CompositeIdwithIdentitykeyCompositeIdwithWorkloadUidkeyConfiguration
Future Considerations
Certificate Caching with Per-Pod Attestation: In PID mode, we should cache and reuse certificates by
Identitywhile still attesting every pod individually. This would reduce SPIRE server load and memory usage—multiple pods with the same identity would share one certificate after each pod passes local PID verification. The first pod triggers a SPIRE call; subsequent pods with the same identity only require local PID verification before reusing the cached certificate.Collaborate with SPIRE/SPIFFE Community: Work with the SPIRE and SPIFFE community to improve the Delegated Identity API and related interfaces to better support delegated attestation use cases like ztunnel's.
Consider a different trait for attested workloads instead of modifying fetch_certificate.