mTLS クライアント認可における検証済みリーフ証明書のサブジェクト確認
--grpc-auth-mode=mtls を使用するプロセス以前は、許可されたサブジェクトを持つ自己署名証明書を証明書チェーンに追加すると、その証明書が --grpc-ca による検証を受けていなくても、クライアントが認可されることがありました。アップグレード後は、エントリーが未設定または空の場合、mTLS プロセスは起動できません。また、リーフ証明書以外の証明書だけで照合されるクライアントは、RPC で client certificate not authorized(Unauthenticated)を受け取ることがあります。このエラーはサーバーに記録されません。
原文を表示
### gRPC mTLS authorization checks only the verified client certificate With `--grpc-auth-mode=mtls`, `--grpc-auth-mtls-allowed-substrings` was matched against every certificate the client presented, not just the one verified against `--grpc-ca`. A client with any certificate from that CA could append a self-signed certificate with an allowed subject and be admitted ([GHSA-xhx6-rmm2-5h2p](https://github.com/vitessio/vitess/security/advisories/GHSA-xhx6-rmm2-5h2p)). The flag is now matched only against the subject of the verified leaf certificate. In mtls mode the flag can also no longer have an empty entry, which matched every subject: an unset or empty value (the default), or a leading, trailing or repeated colon, such as in `CN=vtctld:`. #### Impact - A process started with `--grpc-auth-mode=mtls` logs `Failed to load auth plugin` and exits with status 1 if `--grpc-auth-mtls-allowed-substrings` has an empty entry. - An entry that matches only a non-leaf certificate, such as an intermediate CA's subject, no longer admits the client. RPCs between components, such as VTGate, VTOrc or vtctld calling an upgraded VTTablet, can fail with `client certificate not authorized` (gRPC code `Unauthenticated`), which the server doesn't log. - Before upgrading, set the flag to non-empty entries, and check that each client certificate's subject, as Go formats it (`CN=vtctld,OU=Vitess,O=Example,C=US`), contains one of them. See [#22234](https://github.com/vitessio/vitess/pull/22234) for details.github.com/vitessio/vitess/releases/tag/v24.0.6