Move per-rule user options onto their owning rules
Each of the seven user options was read by exactly one rule, so expose them via CheckRuleWithOptions instead of the checker-wide UserOpts list. This keeps each rule's configuration colocated with its evaluation logic.
This commit is contained in:
parent
6c5f06a3ff
commit
81ca1810f1
5 changed files with 76 additions and 48 deletions
|
|
@ -114,6 +114,25 @@ func (rrsigFreshnessRule) Name() string { return "dnssec_rrsig_freshness" }
|
|||
func (rrsigFreshnessRule) Description() string {
|
||||
return "Warns when RRSIGs are close to expiring; preemptive alert for stuck signers."
|
||||
}
|
||||
func (rrsigFreshnessRule) Options() sdk.CheckerOptionsDocumentation {
|
||||
return sdk.CheckerOptionsDocumentation{
|
||||
UserOpts: []sdk.CheckerOptionDocumentation{
|
||||
{
|
||||
Id: "signatureFreshness",
|
||||
Type: "uint",
|
||||
Label: "RRSIG freshness WARN threshold (days)",
|
||||
Description: "Warn when the closest RRSIG expires in fewer than this many days.",
|
||||
Default: defaultSignatureFreshnessDays,
|
||||
},
|
||||
{
|
||||
Id: "signatureFreshnessCrit",
|
||||
Type: "uint",
|
||||
Label: "RRSIG freshness CRIT threshold (days)",
|
||||
Default: defaultSignatureFreshnessCrit,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (rrsigFreshnessRule) Evaluate(ctx context.Context, obs sdk.ObservationGetter, opts sdk.CheckerOptions) []sdk.CheckState {
|
||||
data, errState := loadDNSSEC(ctx, obs)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue