-
Notifications
You must be signed in to change notification settings - Fork 482
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
fix broken node API x509 validation #655
fix broken node API x509 validation #655
Conversation
The gRPC server TLS configuration was misconfigured to only request a client certificate, but not perform validation. The implication is that a certificate chained to any root with an expected SPIFFE ID could impersonate a node SVID and obtain workload SVIDs. Signed-off-by: Andrew Harding <[email protected]>
8e2f039
to
4a95117
Compare
Given the severity of this, I think I'd like to see a regression test added somewhere. I've seen this exact bug pop up in half the Golang TLS client-cert projects I've worked on .... |
The unit tests ensure the TLS config is correct, but I agree, an explicit test using client TLS connections to the gRPC server would be a stronger assertion. I'll add such a test. |
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.
thanks for this @azdagron. a functional test that actually starts the endpoints and tries to connect to them with various TLS configurations would go a long way I think.
we'll need to backport this one and cut some releases
pkg/server/endpoints/node/handler.go
Outdated
if len(tlsInfo.State.PeerCertificates) == 0 { | ||
return nil, errors.New("PeerCertificates was empty") | ||
if len(tlsInfo.State.VerifiedChains) == 0 { | ||
return nil, errors.New("VerifiedChains was empty") |
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.
I know this is similar to the previous error, but it would be good to be more descriptive here (and below as well)
Signed-off-by: Andrew Harding <[email protected]>
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.
LGTM, thanks again @azdagron
The gRPC server TLS configuration was misconfigured to only request a
client certificate, but not perform validation. The implication is that
a certificate chained to any root with an expected SPIFFE ID could
impersonate a node SVID and obtain workload SVIDs.