Skip to content

server: hot reload the gRPC client CA - #1290

Open
kkk777-7 wants to merge 1 commit into
envoyproxy:mainfrom
kkk777-7:reload-client-ca
Open

kkk777-7 wants to merge 1 commit into
envoyproxy:mainfrom
kkk777-7:reload-client-ca

Conversation

@kkk777-7

Copy link
Copy Markdown
Member

The gRPC server cert and key are hot reloaded since #587, but the client CA (GRPC_CLIENT_TLS_CACERT) is only loaded at startup. When the client CA is rotated (e.g. by cert-manager), client certs issued by the new CA are rejected until ratelimit is restarted, and since Envoy fails open by default, rate limiting silently stops being enforced.

This adds a ClientCAProvider that watches the client CA directory via goruntime, like CertProvider, and verifies client certs against the current CA on every handshake via GetConfigForClient (including the GRPC_CLIENT_TLS_SAN check). If the new CA cannot be loaded, the previous one is kept. Established connections are not affected.

Behavior change: the reloaded CA replaces the previous one immediately, so client certs signed only by the old CA are rejected for new connections. Rotating without disruption requires a bundle with both CAs during the rotation (documented in the README).

Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>
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

Successfully merging this pull request may close these issues.

1 participant