-
Notifications
You must be signed in to change notification settings - Fork 479
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
Support for JWT Token based Node Attestation #5647
Comments
Thank you @snanjundaswamy for opening this issue. |
@amartinezfayo I have added the response to the issue description |
Thank you @snanjundaswamy for the details. |
Expanding on @amartinezfayo's question, the |
Thank you for the response folks! There are two distinct problems here.
|
Thanks for the context, @snanjundaswamy, this is helpful. If it suits your use case, I think it's feasible to have the If that's still not adequate because you need to key your node attestation off of an arbitrary number of selectors or off selector values that don't cleanly map into existing X.509 attributes, then I think introducing a JWT node attestor plugin sounds reasonable. It's a bit more work to implement a new node attestor plugin, so I just wanted to be sure there wasn't a potentially simpler solution to enable your use case with the existing set of node attestation plugins before going down the road of adding a new one. |
@rturner3 The scaffolding that needs to be in place to get issue X509 certs and JWTs are similar. Theoretically, X509 does not discourage such augmentation of SANs, just that it feels like an unnatural fit. There are some un-intended side effects of solving this with arbitrary SANs.
Directionally managing fewer things makes sense and my current inclination is to implement this with X509 node attestor provided that we are okay with the above two shortcomings. |
It's definitely something to consider in how you manage host identity in your infrastructure. If the need arises, you could provision multiple certs onto a host for different purposes (e.g. one for SPIRE node attestation and another for TLS communication between host processes and remote services).
Sure, but I assume that to do this with JWTs, you would still have to set up some internal JWT issuer that sets the proper claims in tokens that you provision onto your hosts? If you already had this JWT infrastructure set up and didn't have an internal PKI, then I can understand why JWT-based attestation might seem like a more appealing option though. We would welcome a PR that provides SANs as node selectors and agent path template parameters (if not already available) in the |
@snanjundaswamy Would you mind creating a new issue for the proposed changes in the |
Problem
The current join token-based node attestation plugin identifies only a single node. Unlike the k8s/aws_iid node attestation, the join token does not expose any selectors, which limits us in certain aspects:
Potential Solution
Create a generic plugin for JWT-based node attestation. A trusted entity that bootstraps these nodes would inject a JWT token with a specific set of labels in the claims. The agent bootstrapped with this JWT token would presented this to the server. The plugin would then verify the JWT token and expose all the claims as selectors. This enables us to create node aliases based on the selectors exposed by the plugin.
This would function similar to a Kubernetes PSAT node attestor, except that the issuer of the JWT token would be a trusted entity responsible for verifying the node before issuing the JWT tokens. To restrict arbitrary claims, we can add a template attributes on the plugin side to validate (Or we can totally ignore this and let folks write then restrictions on selectors when they create node alias entries)
We're happy to contribute back to the community if this is a good idea.
Open Questions
Related Discussions
#2612
#671
Edit 1 : Address comment from @amartinezfayo
Lets say we have just started fresh with tens of thousands nodes on-prem (this is our usecase too). The goal for us is to run multiple sets of services on these machines internal systemd services, telemetry agents and orchestrators themselves. At this layer on baremetal, nothing else works other than join_tokens.
Copying my own example from the spire slack,
Why join_token is not a good fit
For instance consider this arbitrary usecase, Join Token has no way to solve this elegantly and we need to store the mapping of nodes to cluster(lack of a better terminology) in a different database and management of such entries could get out of hand quickly.
We could create a join token with a SpiffeId, but it would be a flat alias across all nodes
spiffe://foo.com/nodegroup1
,spiffe://foo.com/nodegroup2
etc.How do we create an identity that spans a subset of hosts across the two nodegroups 1&2?
Like k8s psat attestors, the powerful weapon we get with JWTs attestor is the ability to extract selectors. With plugin selectors, we could easily map them to a node-alias eliminating the need for additional persistent storage to map overlapping nodes to different clusters.
In a desperate attempt, we could get by using K8s_psat attestor as a generic JWT based node attestor by mimicking the APIs, but it wouldn't an elegant solution
The text was updated successfully, but these errors were encountered: