Skip to content
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

Cross link trust #5

Open
kfox1111 opened this issue Jan 11, 2025 · 8 comments
Open

Cross link trust #5

kfox1111 opened this issue Jan 11, 2025 · 8 comments

Comments

@kfox1111
Copy link
Collaborator

Load the trust bundle of each server into the other's server under the federated name, spiffe://spire-ha. Then, in the spire-ha-agent, use those trust bundles for bootstrapping. This would enable booting a spire-ha-agent with only one upstream agent available.

@kfox1111
Copy link
Collaborator Author

How is jwks going to work?

@kfox1111
Copy link
Collaborator Author

Current thinking is to move the x509 trust bundle to spire-ha-x509 and then add spire-ha-jwks. It would require the jwks to be converted to pem.... which isn't really standardized. But I think we can get away with it since we control both the server side and client side, and we can encode the kid into the cn.

@sorindumitru
Copy link
Collaborator

I think it should be possible to deal with the trust bundle only in JWKS format. Most of the APIs involved should accept JWKS. Did you see any issues with that?

@kfox1111
Copy link
Collaborator Author

oh.... the default format is pem, which excludes the jwk's... but -format spiffe gets it:

spire-server bundle show -socketPath /var/run/spire/server/sockets/a/private/api.sock -format spiffe

That should work.

@kfox1111
Copy link
Collaborator Author

Hmmm.... Except that is a server command... I need to get it via the agent..

@sorindumitru
Copy link
Collaborator

I see. What I'm thinking might work is to subscribe via the delegated API to fetch x509 and jwt bundles and then merge them into one using https://pkg.go.dev/github.com/spiffe/go-spiffe/[email protected]/bundle/spiffebundle

The Bundle struct in there can be marshalled to a JWKS which can then be fed into spire-server. It might need conversion into yet another format, the protobuf representation of the bundle.

@kfox1111
Copy link
Collaborator Author

There are functions in the go library, it looks like, to rebuild a spiffe formatted json file from the ca and jwks formatted files.

@kfox1111
Copy link
Collaborator Author

Added a little tool to convert from ca.crt & jwt_bundle.json back to a spiffe formatted json file. spire-trust-sync service modified to use it. Now spiffe://spire-ha has a complete trust bundle.

Last step is to add support for it in the spire-ha-agent.

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

No branches or pull requests

2 participants