Move status inference out of observation layer into rules
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
The prober (collect.go) was calling inferApexDNSKEYStatus during zone parsing, effectively making a SECURE/BOGUS judgement inside the collection phase rather than the evaluation phase. The DNS-rcode fallback (z.Status = z.DNSStatus) was also applied at parse time.
This commit is contained in:
parent
5591df021b
commit
4543e9b0cf
6 changed files with 110 additions and 83 deletions
|
|
@ -35,13 +35,14 @@ func (r *overallStatusRule) Evaluate(ctx context.Context, obs sdk.ObservationGet
|
|||
leaf = zones[0]
|
||||
z = data.Zones[leaf]
|
||||
}
|
||||
eff := effectiveStatus(z)
|
||||
st := sdk.CheckState{
|
||||
Code: "dnsviz_overall_status",
|
||||
Subject: leaf,
|
||||
Status: statusFromGrok(z.Status),
|
||||
Message: fmt.Sprintf("DNSViz status: %s", emptyAsUnknown(z.Status)),
|
||||
Status: statusFromGrok(eff),
|
||||
Message: fmt.Sprintf("DNSViz status: %s", emptyAsUnknown(eff)),
|
||||
Meta: map[string]any{
|
||||
"status": z.Status,
|
||||
"status": eff,
|
||||
"errors": len(z.Errors),
|
||||
"warnings": len(z.Warnings),
|
||||
},
|
||||
|
|
@ -72,11 +73,12 @@ func (r *perZoneStatusRule) Evaluate(ctx context.Context, obs sdk.ObservationGet
|
|||
out := make([]sdk.CheckState, 0, len(zones))
|
||||
for _, name := range zones {
|
||||
z := data.Zones[name]
|
||||
eff := effectiveStatus(z)
|
||||
out = append(out, sdk.CheckState{
|
||||
Code: "dnsviz_per_zone_status",
|
||||
Subject: name,
|
||||
Status: statusFromGrok(z.Status),
|
||||
Message: fmt.Sprintf("%s: errors=%d warnings=%d", emptyAsUnknown(z.Status), len(z.Errors), len(z.Warnings)),
|
||||
Status: statusFromGrok(eff),
|
||||
Message: fmt.Sprintf("%s: errors=%d warnings=%d", emptyAsUnknown(eff), len(z.Errors), len(z.Warnings)),
|
||||
})
|
||||
}
|
||||
return out
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue