| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Core.Osv.Advisory
Synopsis
- data OsvAdvisory = OsvAdvisory {}
- data OsvAffected = OsvAffected {}
- data OsvPackage = OsvPackage {}
- data OsvRange = OsvRange {
- rangeType :: Text
- rangeEvents :: [OsvEvent]
- data OsvEvent = OsvEvent {}
- newtype OsvDatabaseSpecific = OsvDatabaseSpecific {
- dbsSeverity :: Maybe Text
- data OsvSeverityEntry = OsvSeverityEntry {}
- data ExtractedOsv = ExtractedOsv {
- extPackage :: Text
- extEcosystem :: Text
- extCveId :: Text
- extIntroduced :: Maybe Text
- extFixed :: Maybe Text
- extLastAffected :: Maybe Text
- extSeverity :: Maybe Double
- advisorySeverity :: OsvAdvisory -> Maybe Double
- extractFromAdvisory :: OsvAdvisory -> [ExtractedOsv]
- osvExportUrl :: Text -> Text -> String
Documentation
data OsvAdvisory Source #
Exact model of what osv.dev makes available
Constructors
| OsvAdvisory | |
Fields | |
Instances
| FromJSON OsvAdvisory Source # | |
Defined in Ecluse.Core.Osv.Advisory Methods parseJSON :: Value -> Parser OsvAdvisory Source # parseJSONList :: Value -> Parser [OsvAdvisory] Source # | |
| Show OsvAdvisory Source # | |
Defined in Ecluse.Core.Osv.Advisory Methods showsPrec :: Int -> OsvAdvisory -> ShowS # show :: OsvAdvisory -> String # showList :: [OsvAdvisory] -> ShowS # | |
| Eq OsvAdvisory Source # | |
Defined in Ecluse.Core.Osv.Advisory | |
data OsvAffected Source #
Constructors
| OsvAffected | |
Fields
| |
Instances
| FromJSON OsvAffected Source # | |
Defined in Ecluse.Core.Osv.Advisory Methods parseJSON :: Value -> Parser OsvAffected Source # parseJSONList :: Value -> Parser [OsvAffected] Source # | |
| Show OsvAffected Source # | |
Defined in Ecluse.Core.Osv.Advisory Methods showsPrec :: Int -> OsvAffected -> ShowS # show :: OsvAffected -> String # showList :: [OsvAffected] -> ShowS # | |
| Eq OsvAffected Source # | |
Defined in Ecluse.Core.Osv.Advisory | |
data OsvPackage Source #
Constructors
| OsvPackage | |
Fields
| |
Instances
| FromJSON OsvPackage Source # | |
Defined in Ecluse.Core.Osv.Advisory Methods parseJSON :: Value -> Parser OsvPackage Source # parseJSONList :: Value -> Parser [OsvPackage] Source # | |
| Show OsvPackage Source # | |
Defined in Ecluse.Core.Osv.Advisory Methods showsPrec :: Int -> OsvPackage -> ShowS # show :: OsvPackage -> String # showList :: [OsvPackage] -> ShowS # | |
| Eq OsvPackage Source # | |
Defined in Ecluse.Core.Osv.Advisory | |
Constructors
| OsvRange | |
Fields
| |
One event in a range's ordered event list. An event carries exactly one
bound: introduced opens the affected interval (inclusive), fixed closes it
below the fix (exclusive), and last_affected closes it at an inclusive upper
bound. The two upper bounds are genuinely different -- fixed 2.0 excludes
2.0, last_affected 2.0 includes it -- so they are decoded and carried
separately.
Constructors
| OsvEvent | |
Fields | |
newtype OsvDatabaseSpecific Source #
The subset of an advisory's database_specific block the pipeline consumes.
Constructors
| OsvDatabaseSpecific | |
Fields
| |
Instances
| FromJSON OsvDatabaseSpecific Source # | |
Defined in Ecluse.Core.Osv.Advisory Methods parseJSON :: Value -> Parser OsvDatabaseSpecific Source # parseJSONList :: Value -> Parser [OsvDatabaseSpecific] Source # | |
| Show OsvDatabaseSpecific Source # | |
Defined in Ecluse.Core.Osv.Advisory Methods showsPrec :: Int -> OsvDatabaseSpecific -> ShowS # show :: OsvDatabaseSpecific -> String # showList :: [OsvDatabaseSpecific] -> ShowS # | |
| Eq OsvDatabaseSpecific Source # | |
Defined in Ecluse.Core.Osv.Advisory Methods (==) :: OsvDatabaseSpecific -> OsvDatabaseSpecific -> Bool # (/=) :: OsvDatabaseSpecific -> OsvDatabaseSpecific -> Bool # | |
data OsvSeverityEntry Source #
One entry of an advisory's severity array: a scoring-system tag (for
example CVSS_V3) and its value. For the CVSS systems the value is the
vector string, not a number; the numeric base score is computed from it
(advisorySeverity).
Constructors
| OsvSeverityEntry | |
Instances
| FromJSON OsvSeverityEntry Source # | |
Defined in Ecluse.Core.Osv.Advisory Methods parseJSON :: Value -> Parser OsvSeverityEntry Source # parseJSONList :: Value -> Parser [OsvSeverityEntry] Source # | |
| Show OsvSeverityEntry Source # | |
Defined in Ecluse.Core.Osv.Advisory Methods showsPrec :: Int -> OsvSeverityEntry -> ShowS # show :: OsvSeverityEntry -> String # showList :: [OsvSeverityEntry] -> ShowS # | |
| Eq OsvSeverityEntry Source # | |
Defined in Ecluse.Core.Osv.Advisory Methods (==) :: OsvSeverityEntry -> OsvSeverityEntry -> Bool # (/=) :: OsvSeverityEntry -> OsvSeverityEntry -> Bool # | |
data ExtractedOsv Source #
One affected segment of one package, flattened for storage: the advisory
identity and severity carried alongside the interval bounds. Each ExtractedOsv
becomes a row of the artifact's ranges table.
The bounds mirror OSV's own model: extIntroduced is the inclusive lower bound
(Nothing == from the beginning); the upper bound is (exclusive) or
extFixed (inclusive) or neither (open-ended). An exact enumerated
version becomes a point segment (extLastAffectedintroduced == last_affected == v).
Constructors
| ExtractedOsv | |
Fields
| |
Instances
| Show ExtractedOsv Source # | |
Defined in Ecluse.Core.Osv.Advisory Methods showsPrec :: Int -> ExtractedOsv -> ShowS # show :: ExtractedOsv -> String # showList :: [ExtractedOsv] -> ShowS # | |
| Eq ExtractedOsv Source # | |
Defined in Ecluse.Core.Osv.Advisory | |
advisorySeverity :: OsvAdvisory -> Maybe Double Source #
The advisory's CVSS base score, normalised to a number at ingest so the stored artifact holds a single comparable form and the reader needs no parsing.
OSV carries severity as a CVSS vector string, not a number, so the score is
computed from it with the Security.CVSS library (the highest, when several
vectors parse). When no vector parses, the source database's qualitative label
(dbsSeverity) is mapped to its band ceiling (ghsaSeverityCeiling). Nothing
when the advisory offers neither.
extractFromAdvisory :: OsvAdvisory -> [ExtractedOsv] Source #
Flatten an advisory into one ExtractedOsv per affected segment: every
range segment of every affected package, plus each exactly-enumerated version as
a point. An advisory with neither ranges nor versions yields nothing.
osvExportUrl :: Text -> Text -> String Source #
An ecosystem's advisory export under an OSV-layout base URL
(<base>/<ecosystem>/all.zip): a zip archive of every advisory currently
published for the ecosystem. The base comes from configuration
(osvExportBaseUrl), so a moved or mirrored upstream never needs a new
binary; a trailing slash on the base is tolerated.
>>>osvExportUrl "https://osv-vulnerabilities.storage.googleapis.com/" "npm""https://osv-vulnerabilities.storage.googleapis.com/npm/all.zip"