riemann-tools icon indicating copy to clipboard operation
riemann-tools copied to clipboard

Add `riemann-tls-check` to monitor TLS certificates

Open smortex opened this issue 2 years ago • 1 comments

Add a riemann-tls-check that accept a list of URI of resources to check TLS certificates.

For each URI, resolve the IP addresses that provide the service, and for each IP address perform a TLS handshake and generate events from the certificate:

  1. availability: :ok:/:boom: global status of all the following metrics + reachability;
  2. not after: :ok:/:boom: + :chart_with_downwards_trend: number of seconds until the certificate is expired;
  3. not before: :ok:/:boom: + :chart_with_upwards_trend: number of seconds since the certificate is valid;
  4. identity: :ok:/:boom: certificate subject match the URI hostname;
  5. trust: :ok:/:boom: validity of the certificate trust chain;
  6. OCSP satus: :ok:/:boom: validity of the OCSP status if applicable.

(icons legend: :ok:/:boom: => the metric report a status (ok, warning, critical); :chart_with_downwards_trend: + :chart_with_upwards_trend: => the metric report a metric)

A STARTTLS handshake is automatically done for imap://, ldap:// and smtp:// URI.

A protocol specific handshake is done for mysql:// and postgres:// URI.

Limitations

The required API in OpenSSL to check for OCSP Stapling is not currently part of the openssl gem, so this cannot be tested at the moment: https://github.com/ruby/openssl/pull/401

smortex avatar Nov 11 '22 00:11 smortex