Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Security.OSV
Description
This module contains the OSV datatype and its ToJSON instance. The module was initialized with http://json-to-haskell.chrispenner.ca/
Synopsis
- data Model dbSpecific affectedEcosystemSpecific affectedDbSpecific rangeDbSpecific = Model {
- modelSchemaVersion :: Text
- modelId :: Text
- modelModified :: UTCTime
- modelPublished :: Maybe UTCTime
- modelWithdrawn :: Maybe UTCTime
- modelAliases :: [Text]
- modelRelated :: [Text]
- modelSummary :: Maybe Text
- modelDetails :: Maybe Text
- modelSeverity :: [Severity]
- modelAffected :: [Affected affectedEcosystemSpecific affectedDbSpecific rangeDbSpecific]
- modelReferences :: [Reference]
- modelCredits :: [Credit]
- modelDatabaseSpecific :: Maybe dbSpecific
- newModel :: Text -> Text -> UTCTime -> Model dbs aes adbs rdbs
- newModel' :: Text -> UTCTime -> Model dbs aes adbs rdbs
- defaultSchemaVersion :: Text
- data Affected dbSpecific ecosystemSpecific rangeDbSpecific = Affected {
- affectedRanges :: [Range rangeDbSpecific]
- affectedPackage :: Package
- affectedSeverity :: [Severity]
- affectedEcosystemSpecific :: Maybe ecosystemSpecific
- affectedDatabaseSpecific :: Maybe dbSpecific
- data Credit = Credit {
- creditType :: CreditType
- creditName :: Text
- creditContacts :: [Text]
- data CreditType
- creditTypes :: [(CreditType, Text)]
- data Event a
- = EventIntroduced a
- | EventFixed a
- | EventLastAffected a
- | EventLimit a
- data Package = Package {}
- data Range dbSpecific
- data Reference = Reference {}
- data ReferenceType
- referenceTypes :: [(ReferenceType, Text)]
- newtype Severity = Severity CVSS
Top-level data type
data Model dbSpecific affectedEcosystemSpecific affectedDbSpecific rangeDbSpecific Source #
OSV model parameterised over database-specific and ecosystem-specific fields.
A naïve consumer can parse
for no loss of information.Model
Value
Value Value Value
A producer can instantiate unused database/ecosystem-specific
fields at Data.Void.Void
. ()
is not recommended, because
will serialise as an empty JSON array.Just
()
Constructors
Model | |
Fields
|
Instances
(FromJSON dbSpecific, FromJSON affectedEcosystemSpecific, FromJSON affectedDbSpecific, FromJSON rangeDbSpecific) => FromJSON (Model dbSpecific affectedEcosystemSpecific affectedDbSpecific rangeDbSpecific) Source # | |
Defined in Security.OSV Methods parseJSON :: Value -> Parser (Model dbSpecific affectedEcosystemSpecific affectedDbSpecific rangeDbSpecific) # parseJSONList :: Value -> Parser [Model dbSpecific affectedEcosystemSpecific affectedDbSpecific rangeDbSpecific] # omittedField :: Maybe (Model dbSpecific affectedEcosystemSpecific affectedDbSpecific rangeDbSpecific) # | |
(ToJSON dbSpecific, ToJSON affectedEcosystemSpecific, ToJSON affectedDbSpecific, ToJSON rangeDbSpecific) => ToJSON (Model dbSpecific affectedEcosystemSpecific affectedDbSpecific rangeDbSpecific) Source # | |
Defined in Security.OSV Methods toJSON :: Model dbSpecific affectedEcosystemSpecific affectedDbSpecific rangeDbSpecific -> Value # toEncoding :: Model dbSpecific affectedEcosystemSpecific affectedDbSpecific rangeDbSpecific -> Encoding # toJSONList :: [Model dbSpecific affectedEcosystemSpecific affectedDbSpecific rangeDbSpecific] -> Value # toEncodingList :: [Model dbSpecific affectedEcosystemSpecific affectedDbSpecific rangeDbSpecific] -> Encoding # omitField :: Model dbSpecific affectedEcosystemSpecific affectedDbSpecific rangeDbSpecific -> Bool # | |
(Show rangeDbSpecific, Show affectedDbSpecific, Show affectedEcosystemSpecific, Show dbSpecific) => Show (Model dbSpecific affectedEcosystemSpecific affectedDbSpecific rangeDbSpecific) Source # | |
Defined in Security.OSV Methods showsPrec :: Int -> Model dbSpecific affectedEcosystemSpecific affectedDbSpecific rangeDbSpecific -> ShowS # show :: Model dbSpecific affectedEcosystemSpecific affectedDbSpecific rangeDbSpecific -> String # showList :: [Model dbSpecific affectedEcosystemSpecific affectedDbSpecific rangeDbSpecific] -> ShowS # | |
(Eq rangeDbSpecific, Eq affectedDbSpecific, Eq affectedEcosystemSpecific, Eq dbSpecific) => Eq (Model dbSpecific affectedEcosystemSpecific affectedDbSpecific rangeDbSpecific) Source # | |
Defined in Security.OSV Methods (==) :: Model dbSpecific affectedEcosystemSpecific affectedDbSpecific rangeDbSpecific -> Model dbSpecific affectedEcosystemSpecific affectedDbSpecific rangeDbSpecific -> Bool # (/=) :: Model dbSpecific affectedEcosystemSpecific affectedDbSpecific rangeDbSpecific -> Model dbSpecific affectedEcosystemSpecific affectedDbSpecific rangeDbSpecific -> Bool # |
Construct a new model with only the required fields
Construct a new model given id
and modified
values,
using defaultSchemaVersion
.
defaultSchemaVersion :: Text Source #
Schema version implemented by this library. Currently 1.5.0
.
Subsidiary data types
data Affected dbSpecific ecosystemSpecific rangeDbSpecific Source #
Constructors
Affected | |
Fields
|
Instances
(FromJSON ecosystemSpecific, FromJSON dbSpecific, FromJSON rangeDbSpecific) => FromJSON (Affected ecosystemSpecific dbSpecific rangeDbSpecific) Source # | |
Defined in Security.OSV | |
(ToJSON ecosystemSpecific, ToJSON dbSpecific, ToJSON rangeDbSpecific) => ToJSON (Affected ecosystemSpecific dbSpecific rangeDbSpecific) Source # | |
Defined in Security.OSV Methods toJSON :: Affected ecosystemSpecific dbSpecific rangeDbSpecific -> Value # toEncoding :: Affected ecosystemSpecific dbSpecific rangeDbSpecific -> Encoding # toJSONList :: [Affected ecosystemSpecific dbSpecific rangeDbSpecific] -> Value # toEncodingList :: [Affected ecosystemSpecific dbSpecific rangeDbSpecific] -> Encoding # omitField :: Affected ecosystemSpecific dbSpecific rangeDbSpecific -> Bool # | |
(Show rangeDbSpecific, Show ecosystemSpecific, Show dbSpecific) => Show (Affected dbSpecific ecosystemSpecific rangeDbSpecific) Source # | |
(Eq rangeDbSpecific, Eq ecosystemSpecific, Eq dbSpecific) => Eq (Affected dbSpecific ecosystemSpecific rangeDbSpecific) Source # | |
Constructors
Credit | |
Fields
|
data CreditType Source #
Types of individuals or entities to be credited in relation to an advisory.
Constructors
CreditTypeFinder | Identified the vulnerability |
CreditTypeReporter | Notified the vendor of the vulnerability to a CNA |
CreditTypeAnalyst | Validated the vulnerability to ensure accuracy or severity |
CreditTypeCoordinator | Facilitated the coordinated response process |
CreditTypeRemediationDeveloper | prepared a code change or other remediation plans |
CreditTypeRemediationReviewer | Reviewed vulnerability remediation plans or code changes for effectiveness and completeness |
CreditTypeRemediationVerifier | Tested and verified the vulnerability or its remediation |
CreditTypeTool | Names of tools used in vulnerability discovery or identification |
CreditTypeSponsor | Supported the vulnerability identification or remediation activities |
CreditTypeOther | Any other type or role that does not fall under the categories described above |
Instances
FromJSON CreditType Source # | |
Defined in Security.OSV | |
ToJSON CreditType Source # | |
Defined in Security.OSV Methods toJSON :: CreditType -> Value # toEncoding :: CreditType -> Encoding # toJSONList :: [CreditType] -> Value # toEncodingList :: [CreditType] -> Encoding # omitField :: CreditType -> Bool # | |
Show CreditType Source # | |
Defined in Security.OSV Methods showsPrec :: Int -> CreditType -> ShowS # show :: CreditType -> String # showList :: [CreditType] -> ShowS # | |
Eq CreditType Source # | |
Defined in Security.OSV |
creditTypes :: [(CreditType, Text)] Source #
Bijection of credit types and their string representations
Constructors
EventIntroduced a | |
EventFixed a | |
EventLastAffected a | |
EventLimit a |
Constructors
Package | |
Fields
|
data Range dbSpecific Source #
Constructors
RangeSemVer [Event Text] (Maybe dbSpecific) | |
RangeEcosystem [Event Text] (Maybe dbSpecific) | |
RangeGit | |
Constructors
Reference | |
Fields |
data ReferenceType Source #
Constructors
ReferenceTypeAdvisory | A published security advisory for the vulnerability. |
ReferenceTypeArticle | An article or blog post describing the vulnerability. |
ReferenceTypeDetection | A tool, script, scanner, or other mechanism that allows for detection of the vulnerability in production environments. e.g. YARA rules, hashes, virus signature, or other scanners. |
ReferenceTypeDiscussion | A social media discussion regarding the vulnerability, e.g. a Twitter, Mastodon, Hacker News, or Reddit thread. |
ReferenceTypeReport | A report, typically on a bug or issue tracker, of the vulnerability. |
ReferenceTypeFix | A source code browser link to the fix (e.g., a GitHub commit) Note that
the |
ReferenceTypeIntroduced | A source code browser link to the introduction of the vulnerability
(e.g., a GitHub commit) Note that the introduced type is meant for viewing
by people using web browsers. Programs interested in analyzing the exact
commit range would do better to use the GIT-typed affected |
ReferenceTypePackage | A home web page for the package. |
ReferenceTypeEvidence | A demonstration of the validity of a vulnerability claim, e.g.
|
ReferenceTypeWeb | A web page of some unspecified kind. |
Instances
FromJSON ReferenceType Source # | |
Defined in Security.OSV Methods parseJSON :: Value -> Parser ReferenceType # parseJSONList :: Value -> Parser [ReferenceType] # | |
ToJSON ReferenceType Source # | |
Defined in Security.OSV Methods toJSON :: ReferenceType -> Value # toEncoding :: ReferenceType -> Encoding # toJSONList :: [ReferenceType] -> Value # toEncodingList :: [ReferenceType] -> Encoding # omitField :: ReferenceType -> Bool # | |
Show ReferenceType Source # | |
Defined in Security.OSV Methods showsPrec :: Int -> ReferenceType -> ShowS # show :: ReferenceType -> String # showList :: [ReferenceType] -> ShowS # | |
Eq ReferenceType Source # | |
Defined in Security.OSV Methods (==) :: ReferenceType -> ReferenceType -> Bool # (/=) :: ReferenceType -> ReferenceType -> Bool # |
referenceTypes :: [(ReferenceType, Text)] Source #
Bijection of reference types and their string representations