API Reference
CertificateMonitor
Aggregates certificate validity information for multiple hosts.
Inheritance
- Object
- CertificateMonitor
Remarks
The monitor periodically connects to configured hosts and records certificate details such as expiration, validity, and chain state.
Constructors
public CertificateMonitor() #Methods
public async Task Analyze(IEnumerable<String> hosts, Int32 port = 443, InternalLogger logger = null, CancellationToken cancellationToken = null, Boolean showProgress = true) #TaskChecks certificates for the provided hosts.
Parameters
- hosts System.Collections.Generic.IEnumerable{System.String}
- Hostnames or URLs to verify.
- port System.Int32 = 443
- Port used for HTTPS.
- logger DomainDetective.InternalLogger = null
- Logger instance for diagnostics.
- cancellationToken System.Threading.CancellationToken = null
- Optional cancellation token.
- showProgress System.Boolean = true
- When true, writes progress via the logger.
public CertificateInventoryDiffSummary BuildInventoryDiff(Nullable<DateTimeOffset> sinceUtc = null, Nullable<DateTimeOffset> previousCapturedAtUtc = null, Nullable<DateTimeOffset> currentCapturedAtUtc = null, Boolean includeUnchanged = false, Int32 maxEndpoints = 500) #CertificateInventoryDiffSummaryBuilds a point-in-time diff between two inventory snapshots.
Parameters
- sinceUtc System.Nullable{System.DateTimeOffset} = null
- Optional lower bound for snapshot capture time.
- previousCapturedAtUtc System.Nullable{System.DateTimeOffset} = null
- Optional previous snapshot timestamp selector.
- currentCapturedAtUtc System.Nullable{System.DateTimeOffset} = null
- Optional current snapshot timestamp selector.
- includeUnchanged System.Boolean = false
- When true, includes unchanged endpoints in results.
- maxEndpoints System.Int32 = 500
- Maximum endpoint rows returned.
public CertificateInventoryDriftSummary BuildInventoryDrift(Nullable<DateTimeOffset> sinceUtc = null, Boolean changedOnly = false, Int32 maxEndpoints = 200, String minimumSeverity = null, IEnumerable<String> requiredChangeKinds = null, String changeKindMatchMode = null) #CertificateInventoryDriftSummaryBuilds endpoint-level certificate drift history from persisted inventory snapshots.
Parameters
- sinceUtc System.Nullable{System.DateTimeOffset} = null
- Optional lower bound for snapshot capture time.
- changedOnly System.Boolean = false
- When true, only returns endpoints with observed changes.
- maxEndpoints System.Int32 = 200
- Maximum number of endpoint rows returned.
- minimumSeverity System.String = null
- Optional minimum drift severity filter (None, Low, Medium, High).
- requiredChangeKinds System.Collections.Generic.IEnumerable{System.String} = null
- Optional list of required drift change kinds (certificate, issuer, expiry, service, auth-profile, chain-source).
- changeKindMatchMode System.String = null
- Optional change-kind matching mode (Any or All).
public CertificateInventoryNativeCtDiagnosticsHealthSummary BuildInventoryNativeCtDiagnosticsHealth(CertificateInventoryNativeCtDiagnosticsHealthQuery query = null) #CertificateInventoryNativeCtDiagnosticsHealthSummaryBuilds CT diagnostics health timeline from persisted inventory snapshots.
Parameters
- query DomainDetective.CertificateInventoryNativeCtDiagnosticsHealthQuery = null
- Health query options including thresholds and snapshot window.
public CertificateInventoryPolicySummary BuildInventoryPolicy(Nullable<DateTimeOffset> sinceUtc = null, String baselineProfile = "Balanced", Boolean includeCompliant = false, Int32 maxEndpoints = 300, CertificateInventoryPolicyOverrides policyOverrides = null) #CertificateInventoryPolicySummaryBuilds endpoint-level certificate policy posture from persisted inventory snapshots.
Parameters
- sinceUtc System.Nullable{System.DateTimeOffset} = null
- Optional lower bound for snapshot capture time.
- baselineProfile System.String = "Balanced"
- Policy baseline profile (Strict, Balanced, Legacy).
- includeCompliant System.Boolean = false
- When true, includes endpoints with no policy violations.
- maxEndpoints System.Int32 = 300
- Maximum endpoint rows returned.
- policyOverrides DomainDetective.CertificateInventoryPolicyOverrides = null
- Optional organization override rules for baseline/profile suppression.
public CertificateInventoryPolicyDriftSummary BuildInventoryPolicyDrift(Nullable<DateTimeOffset> sinceUtc = null, String baselineProfile = "Balanced", Nullable<DateTimeOffset> previousCapturedAtUtc = null, Nullable<DateTimeOffset> currentCapturedAtUtc = null, Boolean changedOnly = true, Int32 maxEndpoints = 300, CertificateInventoryPolicyOverrides policyOverrides = null) #CertificateInventoryPolicyDriftSummaryBuilds endpoint-level certificate policy drift between two persisted inventory snapshots.
Parameters
- sinceUtc System.Nullable{System.DateTimeOffset} = null
- Optional lower bound for snapshot capture time.
- baselineProfile System.String = "Balanced"
- Policy baseline profile (Strict, Balanced, Legacy).
- previousCapturedAtUtc System.Nullable{System.DateTimeOffset} = null
- Optional previous snapshot timestamp selector (selects latest snapshot at or before timestamp).
- currentCapturedAtUtc System.Nullable{System.DateTimeOffset} = null
- Optional current snapshot timestamp selector (selects latest snapshot at or before timestamp).
- changedOnly System.Boolean = true
- When true, only returns endpoint rows with detected policy drift.
- maxEndpoints System.Int32 = 300
- Maximum endpoint rows returned.
- policyOverrides DomainDetective.CertificateInventoryPolicyOverrides = null
- Optional organization override rules for baseline/profile suppression.
public CertificateInventoryReuseSummary BuildInventoryReuse(Nullable<DateTimeOffset> sinceUtc = null, Boolean includeSingleEndpointCertificates = false, Int32 minEndpointCount = 2, Int32 maxCertificates = 300, Int32 maxEndpointsPerCertificate = 30) #CertificateInventoryReuseSummaryBuilds certificate reuse and assignment mapping from persisted inventory snapshots.
Parameters
- sinceUtc System.Nullable{System.DateTimeOffset} = null
- Optional lower bound for snapshot capture time.
- includeSingleEndpointCertificates System.Boolean = false
- When true, includes certificates used by only one endpoint.
- minEndpointCount System.Int32 = 2
- Minimum endpoint count required per certificate.
- maxCertificates System.Int32 = 300
- Maximum certificate rows returned.
- maxEndpointsPerCertificate System.Int32 = 30
- Maximum endpoint references returned per certificate row.
public CertificateInventoryRiskSummary BuildInventoryRisk(Nullable<DateTimeOffset> sinceUtc = null, Boolean includeNoRisk = false, Int32 expiringWithinDays = 30, Int32 criticalExpiringWithinDays = 7, Int32 maxEndpoints = 300, String minimumSeverity = null, Nullable<Int32> scoreMin = null, Nullable<Int32> scoreMax = null, Nullable<Int32> reasonCountMin = null, Nullable<Int32> reasonCountMax = null, String riskProfile = null, String reasonContains = null, String issuerContains = null, String authorityFamilyEquals = null, String rootAuthorityFamilyEquals = null, String ctSourceContains = null, String ctTemplateErrorContains = null, String chainSourceContains = null, String thumbprintEquals = null, String rootThumbprintEquals = null, String serialNumberEquals = null, String hostContains = null, String serviceEquals = null, Nullable<Int32> portEquals = null, Nullable<Int32> chainLengthMin = null, Nullable<Int32> chainLengthMax = null, Nullable<Int32> intermediateCountMin = null, Nullable<Int32> intermediateCountMax = null, Nullable<Boolean> ctObservedOnly = null, Nullable<Boolean> chainCompleteOnly = null, Nullable<Boolean> reachableOnly = null, Nullable<Boolean> hostnameMatchOnly = null, Nullable<Boolean> selfSignedOnly = null, Nullable<Boolean> weakKeyOnly = null, Nullable<Boolean> sha1SignatureOnly = null, Nullable<Boolean> expiredOnly = null, Nullable<Boolean> notYetValidOnly = null, Nullable<Boolean> currentlyValidOnly = null, Nullable<Int32> daysToExpireMin = null, Nullable<Int32> daysToExpireMax = null, Nullable<Int32> daysUntilValidMin = null, Nullable<Int32> daysUntilValidMax = null, Nullable<Boolean> knownAuthorityOnly = null, Nullable<Boolean> knownRootAuthorityOnly = null, String authenticationProfileEquals = null, Boolean serverAuthOnly = false, Boolean clientAuthOnly = false, Boolean secureEmailOnly = false, String[] reasonAnyOf = null, String[] reasonAllOf = null, String[] issuerContainsAnyOf = null, String[] issuerContainsAllOf = null, String rootIssuerContains = null, String[] rootIssuerContainsAnyOf = null, String[] rootIssuerContainsAllOf = null, Nullable<Int32> certificateReuseEndpointCountMin = null, Nullable<Int32> certificateReuseEndpointCountMax = null, Nullable<Boolean> certificateReuseCrossServiceOnly = null, Nullable<Int32> certificateReuseDistinctServiceCountMin = null, Nullable<Int32> certificateReuseDistinctServiceCountMax = null, Nullable<Int32> certificateReuseDistinctPortCountMin = null, Nullable<Int32> certificateReuseDistinctPortCountMax = null, Nullable<Boolean> certificateReuseCrossPortOnly = null) #CertificateInventoryRiskSummaryBuilds inventory risk.
Parameters
- sinceUtc System.Nullable{System.DateTimeOffset} = null
- includeNoRisk System.Boolean = false
- expiringWithinDays System.Int32 = 30
- criticalExpiringWithinDays System.Int32 = 7
- maxEndpoints System.Int32 = 300
- minimumSeverity System.String = null
- scoreMin System.Nullable{System.Int32} = null
- scoreMax System.Nullable{System.Int32} = null
- reasonCountMin System.Nullable{System.Int32} = null
- reasonCountMax System.Nullable{System.Int32} = null
- riskProfile System.String = null
- reasonContains System.String = null
- issuerContains System.String = null
- authorityFamilyEquals System.String = null
- rootAuthorityFamilyEquals System.String = null
- ctSourceContains System.String = null
- ctTemplateErrorContains System.String = null
- chainSourceContains System.String = null
- thumbprintEquals System.String = null
- rootThumbprintEquals System.String = null
- serialNumberEquals System.String = null
- hostContains System.String = null
- serviceEquals System.String = null
- portEquals System.Nullable{System.Int32} = null
- chainLengthMin System.Nullable{System.Int32} = null
- chainLengthMax System.Nullable{System.Int32} = null
- intermediateCountMin System.Nullable{System.Int32} = null
- intermediateCountMax System.Nullable{System.Int32} = null
- ctObservedOnly System.Nullable{System.Boolean} = null
- chainCompleteOnly System.Nullable{System.Boolean} = null
- reachableOnly System.Nullable{System.Boolean} = null
- hostnameMatchOnly System.Nullable{System.Boolean} = null
- selfSignedOnly System.Nullable{System.Boolean} = null
- weakKeyOnly System.Nullable{System.Boolean} = null
- sha1SignatureOnly System.Nullable{System.Boolean} = null
- expiredOnly System.Nullable{System.Boolean} = null
- notYetValidOnly System.Nullable{System.Boolean} = null
- currentlyValidOnly System.Nullable{System.Boolean} = null
- daysToExpireMin System.Nullable{System.Int32} = null
- daysToExpireMax System.Nullable{System.Int32} = null
- daysUntilValidMin System.Nullable{System.Int32} = null
- daysUntilValidMax System.Nullable{System.Int32} = null
- knownAuthorityOnly System.Nullable{System.Boolean} = null
- knownRootAuthorityOnly System.Nullable{System.Boolean} = null
- authenticationProfileEquals System.String = null
- serverAuthOnly System.Boolean = false
- clientAuthOnly System.Boolean = false
- secureEmailOnly System.Boolean = false
- reasonAnyOf System.String[] = null
- reasonAllOf System.String[] = null
- issuerContainsAnyOf System.String[] = null
- issuerContainsAllOf System.String[] = null
- rootIssuerContains System.String = null
- rootIssuerContainsAnyOf System.String[] = null
- rootIssuerContainsAllOf System.String[] = null
- certificateReuseEndpointCountMin System.Nullable{System.Int32} = null
- certificateReuseEndpointCountMax System.Nullable{System.Int32} = null
- certificateReuseCrossServiceOnly System.Nullable{System.Boolean} = null
- certificateReuseDistinctServiceCountMin System.Nullable{System.Int32} = null
- certificateReuseDistinctServiceCountMax System.Nullable{System.Int32} = null
- certificateReuseDistinctPortCountMin System.Nullable{System.Int32} = null
- certificateReuseDistinctPortCountMax System.Nullable{System.Int32} = null
- certificateReuseCrossPortOnly System.Nullable{System.Boolean} = null
public CertificateInventorySummary BuildInventorySummary(Nullable<DateTimeOffset> sinceUtc = null, Int32 expiringWithinDays = 30, Int32 maxExpiringEndpoints = 200) #CertificateInventorySummaryBuilds a normalized summary view for persisted inventory snapshots.
Parameters
- sinceUtc System.Nullable{System.DateTimeOffset} = null
- Optional lower bound for snapshot capture time.
- expiringWithinDays System.Int32 = 30
- Threshold window for expiring certificates.
- maxExpiringEndpoints System.Int32 = 200
- Maximum number of expiring endpoints in the summary.
public IReadOnlyList<CertificateInventorySnapshot> LoadInventorySnapshots(Nullable<DateTimeOffset> sinceUtc = null, Nullable<DateTimeOffset> untilUtc = null, Int32 maxSnapshots = 0, Boolean latestOnly = false) #IReadOnlyList<CertificateInventorySnapshot>Loads persisted inventory snapshots from disk.
Parameters
- sinceUtc System.Nullable{System.DateTimeOffset} = null
- Optional lower bound for snapshot capture time.
- untilUtc System.Nullable{System.DateTimeOffset} = null
- Optional upper bound for snapshot capture time.
- maxSnapshots System.Int32 = 0
- Optional maximum number of snapshots to return (latest N).
- latestOnly System.Boolean = false
- When true, returns only the latest available snapshot after filtering.
public CertificateInventoryQueryResult QueryInventoryEntries(CertificateInventoryQuery query = null) #CertificateInventoryQueryResultQueries persisted inventory entries using structured filters.
Parameters
- query DomainDetective.CertificateInventoryQuery = null
- Query options.
public CertificateInventoryNativeCtDiagnosticsResult QueryInventoryNativeCtDiagnostics(CertificateInventoryNativeCtDiagnosticsQuery query = null) #CertificateInventoryNativeCtDiagnosticsResultQueries persisted native CT ingestion diagnostics captured alongside inventory snapshots.
Parameters
- query DomainDetective.CertificateInventoryNativeCtDiagnosticsQuery = null
- Native CT diagnostics query options.
public String SaveInventorySnapshot(CertificateInventorySnapshot snapshot, InternalLogger logger = null) #StringPersists the provided inventory snapshot to disk.
Parameters
- snapshot DomainDetective.CertificateInventorySnapshot
- Snapshot to persist.
- logger DomainDetective.InternalLogger = null
- Optional logger for non-terminating persistence errors.
Returns
Absolute path of the saved snapshot file, or an empty string when persistence fails.
public Void Start(IEnumerable<String> hosts, TimeSpan interval, Int32 port = 443, InternalLogger logger = null) #VoidBegins periodic monitoring of the specified hosts.
Parameters
- hosts System.Collections.Generic.IEnumerable{System.String}
- Hosts to monitor.
- interval System.TimeSpan
- Interval between checks.
- port System.Int32 = 443
- Port used for HTTPS.
- logger DomainDetective.InternalLogger = null
- Optional logger instance.
public static CertificateInventoryEntry ToInventoryEntry(Entry entry) #CertificateInventoryEntryConverts this value to inventory entry.
Parameters
- entry DomainDetective.CertificateMonitor.Entry
Inherited Methods
public override Boolean Equals(Object obj) #BooleanParameters
- obj Object
Properties
AnalysisOverride #Optional override for certificate analysis (primarily for testing).
public String CacheDirectory { get; set; } #Directory used to cache certificate data.
public TimeSpan CacheRetention { get; set; } #Duration cached files are kept.
public Boolean PersistInventorySnapshots { get; set; } #Persist monitor runs as inventory snapshots (opt-in).
public String InventoryDirectory { get; } #Directory used for persisted inventory snapshots.
public Boolean IsRunning { get; } #Indicates whether monitoring is active.
public Int32 ExpiryWarningDays { get; set; } #Threshold in days for considering a certificate expiring soon.
public Int32 MaxParallelism { get; set; } #Maximum number of hosts analyzed in parallel per run.
public List<Entry> Results { get; } #Collection of monitoring results.
public Int32 ValidCount { get; } #Number of hosts with valid certificates.
public Int32 ExpiringCount { get; } #Number of hosts with certificates expiring soon.
public Int32 ExpiredCount { get; } #Number of hosts with expired certificates.
public Int32 FailedCount { get; } #Number of hosts where validation failed.
public Int32 CompleteChainCount { get; } #Number of certificates with complete chains.
public Int32 IncompleteChainCount { get; } #Number of certificates with incomplete chains.
public Int32 UnknownChainCount { get; } #Number of hosts where the chain status couldn't be determined.