checker: report skipped rules as StatusUnknown

Skipped tests that are not problematic should be UNKNOWN rather
than INFO; the affected rules cannot evaluate without their input,
so they are non-evaluations, not findings.
This commit is contained in:
nemunaire 2026-04-26 01:24:20 +07:00
commit ddbcf63aec

View file

@ -108,7 +108,7 @@ func (r *preferredEndpointRule) Evaluate(ctx context.Context, obs sdk.Observatio
// When nothing works, let the presence rule drive the verdict. // When nothing works, let the presence rule drive the verdict.
if !anyOK { if !anyOK {
return single(sdk.CheckState{ return single(sdk.CheckState{
Status: sdk.StatusInfo, Status: sdk.StatusUnknown,
Message: "No autoconfig responded; primary endpoint not evaluated.", Message: "No autoconfig responded; primary endpoint not evaluated.",
Code: "autoconfig_preferred_skip", Code: "autoconfig_preferred_skip",
}) })
@ -192,7 +192,7 @@ func (r *tlsRule) Evaluate(ctx context.Context, obs sdk.ObservationGetter, opts
if len(out) == 0 { if len(out) == 0 {
return single(sdk.CheckState{ return single(sdk.CheckState{
Status: sdk.StatusInfo, Status: sdk.StatusUnknown,
Message: "No autoconfig probe reached an endpoint; TLS not assessed.", Message: "No autoconfig probe reached an endpoint; TLS not assessed.",
Code: "autoconfig_tls_skip", Code: "autoconfig_tls_skip",
}) })
@ -218,7 +218,7 @@ func (r *encryptionRule) Evaluate(ctx context.Context, obs sdk.ObservationGetter
} }
if d.ClientConfig == nil { if d.ClientConfig == nil {
return single(sdk.CheckState{ return single(sdk.CheckState{
Status: sdk.StatusInfo, Status: sdk.StatusUnknown,
Message: "No clientConfig parsed; encryption check skipped.", Message: "No clientConfig parsed; encryption check skipped.",
Code: "autoconfig_encryption_skip", Code: "autoconfig_encryption_skip",
}) })
@ -257,7 +257,7 @@ func (r *encryptionRule) Evaluate(ctx context.Context, obs sdk.ObservationGetter
} }
if len(out) == 0 { if len(out) == 0 {
return single(sdk.CheckState{ return single(sdk.CheckState{
Status: sdk.StatusInfo, Status: sdk.StatusUnknown,
Message: "clientConfig declares no server to evaluate.", Message: "clientConfig declares no server to evaluate.",
Code: "autoconfig_encryption_skip", Code: "autoconfig_encryption_skip",
}) })
@ -283,7 +283,7 @@ func (r *consistencyRule) Evaluate(ctx context.Context, obs sdk.ObservationGette
} }
if d.ClientConfig == nil { if d.ClientConfig == nil {
return single(sdk.CheckState{ return single(sdk.CheckState{
Status: sdk.StatusInfo, Status: sdk.StatusUnknown,
Message: "No clientConfig to compare.", Message: "No clientConfig to compare.",
Code: "autoconfig_consistency_skip", Code: "autoconfig_consistency_skip",
}) })