| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Cve.Sync
Description
The advisory-sync plan: one CveSyncHandle per mount ecosystem (planCveSync), the
projections the composition root reads off it, and one supervised sync task per handle.
Synopsis
- data CveSyncHandle = CveSyncHandle {}
- data AdvisoryNeed = AdvisoryNeed {
- anEcosystem :: Ecosystem
- anMaxAge :: MaxAdvisoryAge
- anEpss :: EpssRequirement
- anDatabase :: DatabaseRequirement
- planCveSync :: LogEnv -> Maybe AwsEndpoint -> AppConfig -> [AdvisoryNeed] -> IO (Map Ecosystem CveSyncHandle)
- sweepStaleTemps :: LogEnv -> FilePath -> IO ()
- sweepStep :: LogEnv -> FilePath -> IO () -> IO ()
- cveRuleDepsFor :: Map Ecosystem CveSyncHandle -> BreakerReporter -> (Ecosystem -> OutageReport -> IO ()) -> Ecosystem -> RuleDeps
- advisoryFreshnessFor :: Map Ecosystem CveSyncHandle -> Ecosystem -> IO AdvisoryFreshness
- reportPushAge :: LogEnv -> Ecosystem -> CveSyncHandle -> IO ()
- katipOutageReporter :: LogEnv -> Ecosystem -> OutageReport -> IO ()
- outageReportPeriod :: NominalDiffTime
- cveSyncReadiness :: Map Ecosystem CveSyncHandle -> IO Readiness
- cveSyncScheduleFor :: AppConfig -> SyncSchedule
- cveSyncTasks :: LogEnv -> Metrics -> Telemetry -> SyncSchedule -> Map Ecosystem CveSyncHandle -> [IO ()]
- registerAdvisoryAges :: Metrics -> Map Ecosystem CveSyncHandle -> IO ()
Documentation
data CveSyncHandle Source #
One configured ecosystem's advisory-sync wiring.
Constructors
| CveSyncHandle | |
Fields
| |
data AdvisoryNeed Source #
What one vetted mount's rules ask of the advisory stack, read off its own policy at boot.
Constructors
| AdvisoryNeed | |
Fields
| |
planCveSync :: LogEnv -> Maybe AwsEndpoint -> AppConfig -> [AdvisoryNeed] -> IO (Map Ecosystem CveSyncHandle) Source #
Build one sync handle per vetted ecosystem. No store yields no handles, and unsupported mounts stay unready.
sweepStaleTemps :: LogEnv -> FilePath -> IO () Source #
Remove stale downloads retained across container restarts, with best-effort errors handled by sweepStep.
sweepStep :: LogEnv -> FilePath -> IO () -> IO () Source #
Log and swallow an IOError from one sweep step. Other exceptions propagate.
cveRuleDepsFor :: Map Ecosystem CveSyncHandle -> BreakerReporter -> (Ecosystem -> OutageReport -> IO ()) -> Ecosystem -> RuleDeps Source #
Bind each ecosystem's rules to its own advisory slot and observers. Missing handles configure no database.
advisoryFreshnessFor :: Map Ecosystem CveSyncHandle -> Ecosystem -> IO AdvisoryFreshness Source #
Assess the live slot's publication age. Ecosystems without an advisory stack have nothing to age.
reportPushAge :: LogEnv -> Ecosystem -> CveSyncHandle -> IO () Source #
Report crossing half the maximum age once. A fresh push re-arms the report.
katipOutageReporter :: LogEnv -> Ecosystem -> OutageReport -> IO () Source #
Log outage starts and reminders at ERROR, and recovery at INFO. Fault details reach no client.
outageReportPeriod :: NominalDiffTime Source #
The reminder interval for continuing outages, shared with unloaded-database reports.
cveSyncReadiness :: Map Ecosystem CveSyncHandle -> IO Readiness Source #
Wait for the first sync only on mounts with advisory denies. Other ecosystems remain routable.
cveSyncScheduleFor :: AppConfig -> SyncSchedule Source #
Use the boot retry burst and configured poll interval. Configuration bounds the microsecond conversion.
cveSyncTasks :: LogEnv -> Metrics -> Telemetry -> SyncSchedule -> Map Ecosystem CveSyncHandle -> [IO ()] Source #
Run one supervised sync task per ecosystem, marking first-sync readiness once for every evaluating role.
registerAdvisoryAges :: Metrics -> Map Ecosystem CveSyncHandle -> IO () Source #
Register once per role. Callbacks read the slots, so observations survive sync-task restarts.