Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion prober/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,11 @@ func ProbeHTTP(ctx context.Context, target string, module config.Module, registr
[]string{"version"},
)

probeTLSCipher = prometheus.NewGaugeVec(
probeTLSCipherGaugeOpts,
[]string{"cipher"},
)

probeHTTPVersionGauge = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "probe_http_version",
Help: "Returns the version of HTTP of the probe response",
Expand Down Expand Up @@ -638,9 +643,10 @@ func ProbeHTTP(ctx context.Context, target string, module config.Module, registr

if resp.TLS != nil {
isSSLGauge.Set(float64(1))
registry.MustRegister(probeSSLEarliestCertExpiryGauge, probeTLSVersion, probeSSLLastChainExpiryTimestampSeconds, probeSSLLastInformation)
registry.MustRegister(probeSSLEarliestCertExpiryGauge, probeTLSVersion, probeTLSCipher, probeSSLLastChainExpiryTimestampSeconds, probeSSLLastInformation)
probeSSLEarliestCertExpiryGauge.Set(float64(getEarliestCertExpiry(resp.TLS).Unix()))
probeTLSVersion.WithLabelValues(getTLSVersion(resp.TLS)).Set(1)
probeTLSCipher.WithLabelValues(getTLSCipher(resp.TLS)).Set(1)
probeSSLLastChainExpiryTimestampSeconds.Set(float64(getLastChainExpiry(resp.TLS).Unix()))
probeSSLLastInformation.WithLabelValues(getFingerprint(resp.TLS), getSubject(resp.TLS), getIssuer(resp.TLS), getDNSNames(resp.TLS)).Set(1)
if httpConfig.FailIfSSL {
Expand Down
6 changes: 6 additions & 0 deletions prober/prober.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const (
helpSSLEarliestCertExpiry = "Returns last SSL chain expiry in unixtime"
helpSSLChainExpiryInTimeStamp = "Returns last SSL chain expiry in timestamp"
helpProbeTLSInfo = "Returns the TLS version used or NaN when unknown"
helpProbeTLSCipher = "Returns the TLS cipher negotiated during handshake"
)

var (
Expand All @@ -45,4 +46,9 @@ var (
Name: "probe_tls_version_info",
Help: helpProbeTLSInfo,
}

probeTLSCipherGaugeOpts = prometheus.GaugeOpts{
Name: "probe_tls_cipher_info",
Help: helpProbeTLSCipher,
}
)
4 changes: 4 additions & 0 deletions prober/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,7 @@ func getTLSVersion(state *tls.ConnectionState) string {
return "unknown"
}
}

func getTLSCipher(state *tls.ConnectionState) string {
return tls.CipherSuiteName(state.CipherSuite)
}