Nice work!
One major concern I have is that I don't see any tests. I realize from reviewing that this seems to be more of integration code so unit testing probably wasn't obvious. However, I can imagine a test that can spin off two TLS clients / servers and validate the code paths without too much complication.
Otherwise, I only have code nits.
Amazing work @meyskens! I'm really impressed with how quickly you've pulled functional code together.
However, I'm in a similar boat to @christarazi here, the changes look great, but I'd like to see unit tests, particularly for mtls_authhandler.go
and certificate_provider.go
. I think just tests that exercise the code paths inside the if
statements are a great place to start, even for the internal functions. Let's lock in tests while this is a small change, and then we can have greater confidence as the changesets and assoicated testing get bigger.
Everything's in order from my side. Nice!
Great work @meyskens! 🎉
I have some Helm suggestions and questions around the mTLS codepath.
While trying the patch I hit the following issue where the Cilium agent can't connect to the spire server:
cilium-98l82 cilium-agent level=info msg="Connecting to SPIRE Delegate API Client" subsys=spire-delegate
cilium-98l82 cilium-agent level=error msg="error in delegate stream, restarting" error="rpc error: code = PermissionDenied desc = no identity issued" subsys=spire-delegate
Looks great to me!
LGTM for API changes
Login to write a write a comment.
This adds an mTLS auth handler to the Serice Mesh auth package.
It will listen on a given port and does a mutual TLS handshake with
SPIFFE IDs it received. This will assure the both sides got the needed
certificates.
In order to integrate with the datapath tables it also improves the SPIFFE
interface to use the Cilium Numeric Identities. And convert them from and
to valid SNI fields. As well as implement code to validate the URI SANS
inside the certificates.
This can be enabled in the in the Helm chart.
Fixes: #23807