-
Notifications
You must be signed in to change notification settings - Fork 16
Controller crashes when certificates are handled by Vault PKI #208
Comments
Filed hashicorp/consul-api-gateway#208. The API Gateway relies on SPIFFE validation and Vault PKI Secrets Engine doesn't include a SPIFFE URL.
So, this is likely coming from an issue with our server-side mTLS verification for SDS. Besides using our root cert for crypto verification, we use the root and leaf cert SPIFFE urls to verify the identity of a known gateway as well as ensure that it has the ability to request certain certificates. This identity verification happens after the cryptographic verification of the leaf certs using the requested root cert. Included in the ID check is this bit: consul-api-gateway/internal/envoy/middleware.go Lines 84 to 87 in 358445d
where My suggestion is that we consider just dropping this particular check and ignore the "host" part of the SPIFFE url in the client cert. We'd still use the rest of the SPIFFE path for identifying the namespace/name of the deployed gateway and aligning it with our gateway configuration, but we should be able to ignore the need for a root CA SPIFFE component and only leverage the CA for cryptographic verification. So, TLDR; just remove the above lines and I think we should be good. |
Overview of the Issue
I configured a
Gateway
with a TLS certificate that is generated by Vault PKI secrets engine. It comes up successfully but when I create anHTTPRoute
to add an upstream, the API Gateway controller throws an error and fails to add the route because it cannot validate the certificate's SPIFFE URL.Reproduction Steps
Create three self-signed root CAs and configure each with a
Vault PKI secrets engine with two levels of intermediate certificates.
Create a Consul cluster that uses Vault PKI Secrets Engine.
Deploy a gateway with a TLS certificate.
The gateway comes up:
Deploy an
HTTPRoute
.The gateway throws an error and restarts:
Logs
Logs
Expected behavior
I expected to have the
HTTPRoute
add an upstream to my service and be able to access the service over HTTPS.Environment details
consul-api-gateway
version: v0.2.1Additional Context
You can find the full deployment (including Vault PKI secrets engine setup and certificate generation) at joatmon08/hashicorp-stack-demoapp.
The text was updated successfully, but these errors were encountered: