-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Add SpiffeID for Consul server agents #14485
Add SpiffeID for Consul server agents #14485
Conversation
By adding a SpiffeID for server agents, servers can now request a leaf certificate from the Connect CA. This new Spiffe ID has a key property: servers are identified by their datacenter name and trust domain. All servers that share these attributes will share a ServerURI. The aim is to use these certificates to verify the server name of ANY server in a Consul datacenter.
99dbd14
to
f95a6d2
Compare
Co-authored-by: Eric Haberkorn <[email protected]>
// ServerURI is the URI value of a cert issued for a server agent. | ||
// The same URI is shared by all servers in a Consul datacenter. | ||
ServerURI string `json:",omitempty"` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious why IssuedCert
isn't exported from the API
package? Looks like it's returned from at least one endpoint /v1/agent/connect/ca/leaf/test?token=<token>
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DanStough It is in the api
package, but for some reason it has a different name there. I assume it was for clarity? 9638466
Cert type:
Line 108 in 8c46e48
type LeafCert struct { |
Endpoint client:
Line 1112 in 8c46e48
func (a *Agent) ConnectCALeaf(serviceID string, q *QueryOptions) (*LeafCert, *QueryMeta, error) { |
We don't need to expose ServerURI
via that type because users can't request leaf certs for Consul servers.
Description
By adding a SpiffeID for server agents, servers can now request a leaf
certificate from the Connect CA.
This new Spiffe ID has a key property: servers are identified by their
datacenter name and trust domain. All servers that share these
attributes will share a ServerURI.
The aim is to use these certificates to verify the server name of ANY
server in a Consul datacenter.
Testing & Reproduction steps
Links
https://go.hashi.co/csl-204-server-cert
PR Checklist