feat: add TLS certificate expiry check to HTTPS network monitors (#2401)

Co-authored-by: henrygd <hank@henrygd.me>
This commit is contained in:
Sven van Ginkel
2026-09-23 23:07:29 +02:00
committed by GitHub
parent 0870716052
commit a99fe5e997
16 changed files with 547 additions and 19 deletions

View File

@@ -27,6 +27,13 @@ type Config struct {
Interval uint16 `cbor:"4,keyasint"` // seconds
}
// CertInfo holds details of the leaf TLS certificate presented by a target.
type CertInfo struct {
// Expires is the certificate's NotAfter Unix timestamp in milliseconds.
Expires int64 `cbor:"0,keyasint" json:"expires"`
Issuer string `cbor:"1,keyasint,omitempty" json:"issuer,omitempty"`
}
// SyncRequest defines an incremental or full monitor sync request sent to the agent.
type SyncRequest struct {
Action SyncAction `cbor:"0,keyasint"`
@@ -76,6 +83,8 @@ type Result struct {
TotalCount int64 `cbor:"10,keyasint"`
SuccessCount int64 `cbor:"11,keyasint"`
ResponseSum int64 `cbor:"12,keyasint"`
// Cert is set for HTTPS targets when a certificate check has new info the hub has not stored yet.
Cert *CertInfo `cbor:"13,keyasint,omitempty"`
}
// Stats holds response times in microseconds and packet loss percentage (0-100).