ecluse:ecluse-core
Safe HaskellNone
LanguageGHC2021

Ecluse.Core.Rules.Freshness

Description

How old the advisory push behind a CVE-based deny may be. The clock is the published object's own timestamp, which Ecluse.Core.Cve.Slot carries, so a recompile of unchanged bytes still moves it and a restart does not reset it. What a source says about its own data is diagnostic and is never read here. Ecluse.Core.Rules applies the reading to a prepared rule.

Synopsis

The effective maximum

data MaxAdvisoryAge Source #

The maximum push age one mount's CVE-based denies accept, and where the value came from. The basis is carried so the boot log can report it beside the number.

Constructors

MaxAdvisoryAge 

Fields

data AdvisoryAgeBasis Source #

Where an effective maximum came from.

Constructors

AgeConfigured

The operator set advisories.maxAgeSeconds, which overrides every derivation.

AgeBeforeQuarantine NominalDiffTime

Derived to land advisoryAgeLead ahead of the earliest quarantine admission this mount's own rules allow (carried), so the failure shows before that cohort is admitted.

AgeFloor

The floor, which no derivation goes below.

maxAdvisoryAgeFor :: Maybe NominalDiffTime -> [Rule] -> MaxAdvisoryAge Source #

One mount's effective maximum. An explicit value is final, above and below the derivation. One mount's rules are read alone, so another ecosystem's quarantine cannot set this limit.

Reading one push

data AdvisoryPublication Source #

What a slot says about the serving artifact's publication. The undated case is separate because a generation whose age cannot be established is not the same as none serving at all.

Constructors

NoGeneration

Nothing is serving yet, so there is no artifact to age.

PublishedAt UTCTime

The published object's own timestamp.

UndatedGeneration

A generation is serving and the store reported no publication time for it.

data AdvisoryAge Source #

One reading of a push: when it landed, how old it is now, and the maximum it was read against. An audit line and an alarm both render this, so neither can report a different number.

Instances

Instances details
Show AdvisoryAge Source # 
Instance details

Defined in Ecluse.Core.Rules.Freshness

Eq AdvisoryAge Source # 
Instance details

Defined in Ecluse.Core.Rules.Freshness

data AdvisoryFreshness Source #

What a push permits. AdvisoryAging is still eligible: it is the early warning, raised at half the maximum so an update outage surfaces while there is still time to act on it.

Constructors

AdvisoryFresh

Within half the maximum, or nothing serving to age.

AdvisoryAging AdvisoryAge

Past half the maximum and still eligible.

AdvisoryStale AdvisoryAge

Past the maximum. CVE-based denial refuses, whatever its onUnavailable says.

AdvisoryUndated

A serving generation whose age cannot be established, which is unverified evidence and refuses on the same terms as an expired one.

assessAdvisoryAge :: MaxAdvisoryAge -> UTCTime -> AdvisoryPublication -> AdvisoryFreshness Source #

Read one publication against a maximum: equal to it is eligible, and greater expires. Nothing serving is not aged here, leaving the ordinary absent-database path to decide.

ageAlarmStep :: Bool -> AdvisoryFreshness -> (Bool, Maybe AdvisoryAge) Source #

The early warning's next latch state, and the reading to report where this one crosses. An undated generation has no age to report and raises its own alarm where the artifact lands.