ingress-nginx-helm/internal/ingress
Thibault Jamet 1e66a54974
Add a certificate info metric (#8253)
When the ingress controller loads certificates  (new ones or following a
secret update), it performs a series of check to ensure its validity.

In our systems, we detected a case where, when the secret object is
compromised, for example when the certificate does not match the secret
key, different pods of the ingress controller are serving a different
version of the certificate.

This behaviour is due to the cache mechanism of the ingress controller,
keeping the last known certificate in case of corruption. When this
happens, old ingress-controller pods will keep serving the old one,
while new pods, by failing to load the corrupted certificates, would
use the default certificate, causing invalid certificates for its
clients.

This generates a random error on the client side, depending on the
actual pod instance it reaches.

In order to allow detecting occurences of those situations, add a metric
to expose, for all ingress controlller pods, detailed informations of
the currently loaded certificate.

This will, for example, allow setting an alert when there is a
certificate discrepency across all ingress controller pods using a query
similar to `sum(nginx_ingress_controller_ssl_certificate_info{host="name.tld"})by(serial_number)`

This also allows to catch other exceptions loading certificates (failing
to load the certificate from the k8s API, ...

Co-authored-by: Daniel Ricart <danielricart@users.noreply.github.com>

Co-authored-by: Daniel Ricart <danielricart@users.noreply.github.com>
2022-02-24 07:08:32 -08:00
..
annotations Append elements on match, instead of removing for cors-annotations (#8185) 2022-02-13 10:39:47 -08:00
controller Add a certificate info metric (#8253) 2022-02-24 07:08:32 -08:00
defaults Allow the usage of Services as Upstream on a global level (#7469) 2021-09-07 12:47:15 -07:00
errors Remove deprecated libraries, update other libs, add ci v1.23 (#8118) 2022-01-09 16:29:12 -08:00
metric Add a certificate info metric (#8253) 2022-02-24 07:08:32 -08:00
resolver chore: Add test to internal ingress resolver pkg 2020-12-23 13:33:12 -03:00
status Remove deprecated libraries, update other libs, add ci v1.23 (#8118) 2022-01-09 16:29:12 -08:00
sslcert.go Add a certificate info metric (#8253) 2022-02-24 07:08:32 -08:00
types.go Add stream-snippet as a ConfigMap and Annotation option (#8029) 2021-12-23 11:46:30 -08:00
types_equals.go generating SHA for CA only certs in backend_ssl.go + comparision of ProxySSL structures in types_equals.go (#8098) 2022-01-09 14:06:00 -03:00
types_equals_test.go fix crl not reload when crl got updated in the ca secret 2021-03-31 16:13:07 -04:00
zz_generated.deepcopy.go Update ingress to go 1.17 (#7521) 2021-08-23 14:25:25 -07:00