mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 11:55:40 +01:00
only using enums from CVSS 3.0
This commit is contained in:
parent
b03df5508a
commit
4206c2e4b3
5 changed files with 533 additions and 1032 deletions
|
|
@ -644,36 +644,36 @@ type CVSS2 struct {
|
|||
|
||||
// CVSS3 holding a CVSS v3.x value
|
||||
type CVSS3 struct {
|
||||
Version CVSSVersion3 `json:"version"` // required
|
||||
VectorString CVSS3VectorString `json:"vectorString"` // required
|
||||
AttackVector *CVSS30AttackVector `json:"attackVector,omitempty"`
|
||||
AttackComplexity *CVSS30AttackComplexity `json:"attackComplexity,omitempty"`
|
||||
PrivilegesRequired *CVSS30PrivilegesRequired `json:"privilegesRequired,omitempty"`
|
||||
UserInteraction *CVSS30UserInteraction `json:"userInteraction,omitempty"`
|
||||
Scope *CVSS30Scope `json:"scope,omitempty"`
|
||||
ConfidentialityImpact *CVSS30Cia `json:"confidentialityImpact,omitempty"`
|
||||
IntegrityImpact CVSS30Cia `json:"integrityImpact,omitempty"`
|
||||
AvailabilityImpact *CVSS30Cia `json:"availabilityImpact,omitempty"`
|
||||
BaseScore float64 `json:"baseScore"` // required
|
||||
BaseSeverity CVSS30Severity `json:"baseSeverity"` // required
|
||||
ExploitCodeMaturity *CVSS30ExploitCodeMaturity `json:"exploitCodeMaturity,omitempty"`
|
||||
RemediationLevel *CVSS30RemediationLevel `json:"remediationLevel,omitempty"`
|
||||
ReportConfidence *CVSS30Confidence `json:"reportConfidence,omitempty"`
|
||||
TemporalScore *float64 `json:"temporalScore,omitempty"`
|
||||
TemporalSeverity *CVSS30Severity `json:"temporalSeverity,omitempty"`
|
||||
ConfidentialityRequirement *CVSS30CiaRequirement `json:"confidentialityRequirement,omitempty"`
|
||||
IntegrityRequirement *CVSS30CiaRequirement `json:"integrityRequirement,omitempty"`
|
||||
AvailabilityRequirement *CVSS30CiaRequirement `json:"availabilityRequirement,omitempty"`
|
||||
ModifiedAttackVector *CVSS30ModifiedAttackVector `json:"modifiedAttackVector,omitempty"`
|
||||
ModifiedAttackComplexity *CVSS30ModifiedAttackComplexity `json:"modifiedAttackComplexity,omitempty"`
|
||||
ModifiedPrivilegesRequired *CVSS30ModifiedPrivilegesRequired `json:"modifiedPrivilegesRequired,omitempty"`
|
||||
ModifiedUserInteraction *CVSS30ModifiedUserInteraction `json:"modifiedUserInteraction,omitempty"`
|
||||
ModifiedScope *CVSS30ModifiedScope `json:"modifiedScope,omitempty"`
|
||||
ModifiedConfidentialityImpact *CVSS30ModifiedCia `json:"modifiedConfidentialityImpact,omitempty"`
|
||||
ModifiedIntegrityImpact *CVSS30ModifiedCia `json:"modifiedIntegrityImpact,omitempty"`
|
||||
ModifiedAvailabilityImpact *CVSS30ModifiedCia `json:"modifiedAvailabilityImpact,omitempty"`
|
||||
EenvironmentalScore *float64 `json:"environmentalScore,omitempty"`
|
||||
EnvironmentalSeverity *CVSS30Severity `json:"environmentalSeverity,omitempty"`
|
||||
Version CVSSVersion3 `json:"version"` // required
|
||||
VectorString CVSS3VectorString `json:"vectorString"` // required
|
||||
AttackVector *CVSS3AttackVector `json:"attackVector,omitempty"`
|
||||
AttackComplexity *CVSS3AttackComplexity `json:"attackComplexity,omitempty"`
|
||||
PrivilegesRequired *CVSS3PrivilegesRequired `json:"privilegesRequired,omitempty"`
|
||||
UserInteraction *CVSS3UserInteraction `json:"userInteraction,omitempty"`
|
||||
Scope *CVSS3Scope `json:"scope,omitempty"`
|
||||
ConfidentialityImpact *CVSS3Cia `json:"confidentialityImpact,omitempty"`
|
||||
IntegrityImpact CVSS3Cia `json:"integrityImpact,omitempty"`
|
||||
AvailabilityImpact *CVSS3Cia `json:"availabilityImpact,omitempty"`
|
||||
BaseScore float64 `json:"baseScore"` // required
|
||||
BaseSeverity CVSS3Severity `json:"baseSeverity"` // required
|
||||
ExploitCodeMaturity *CVSS3ExploitCodeMaturity `json:"exploitCodeMaturity,omitempty"`
|
||||
RemediationLevel *CVSS3RemediationLevel `json:"remediationLevel,omitempty"`
|
||||
ReportConfidence *CVSS3Confidence `json:"reportConfidence,omitempty"`
|
||||
TemporalScore *float64 `json:"temporalScore,omitempty"`
|
||||
TemporalSeverity *CVSS3Severity `json:"temporalSeverity,omitempty"`
|
||||
ConfidentialityRequirement *CVSS3CiaRequirement `json:"confidentialityRequirement,omitempty"`
|
||||
IntegrityRequirement *CVSS3CiaRequirement `json:"integrityRequirement,omitempty"`
|
||||
AvailabilityRequirement *CVSS3CiaRequirement `json:"availabilityRequirement,omitempty"`
|
||||
ModifiedAttackVector *CVSS3ModifiedAttackVector `json:"modifiedAttackVector,omitempty"`
|
||||
ModifiedAttackComplexity *CVSS3ModifiedAttackComplexity `json:"modifiedAttackComplexity,omitempty"`
|
||||
ModifiedPrivilegesRequired *CVSS3ModifiedPrivilegesRequired `json:"modifiedPrivilegesRequired,omitempty"`
|
||||
ModifiedUserInteraction *CVSS3ModifiedUserInteraction `json:"modifiedUserInteraction,omitempty"`
|
||||
ModifiedScope *CVSS3ModifiedScope `json:"modifiedScope,omitempty"`
|
||||
ModifiedConfidentialityImpact *CVSS3ModifiedCia `json:"modifiedConfidentialityImpact,omitempty"`
|
||||
ModifiedIntegrityImpact *CVSS3ModifiedCia `json:"modifiedIntegrityImpact,omitempty"`
|
||||
ModifiedAvailabilityImpact *CVSS3ModifiedCia `json:"modifiedAvailabilityImpact,omitempty"`
|
||||
EenvironmentalScore *float64 `json:"environmentalScore,omitempty"`
|
||||
EnvironmentalSeverity *CVSS3Severity `json:"environmentalSeverity,omitempty"`
|
||||
}
|
||||
|
||||
// Score specifies information about (at least one) score of the vulnerability and for which
|
||||
|
|
|
|||
|
|
@ -1,500 +0,0 @@
|
|||
// This file is Free Software under the MIT License
|
||||
// without warranty, see README.md and LICENSES/MIT.txt for details.
|
||||
//
|
||||
// SPDX-License-Identifier: MIT
|
||||
//
|
||||
// SPDX-FileCopyrightText: 2023 German Federal Office for Information Security (BSI) <https://www.bsi.bund.de>
|
||||
// Software-Engineering: 2023 Intevation GmbH <https://intevation.de>
|
||||
//
|
||||
// THIS FILE IS MACHINE GENERATED. EDIT WITH CARE!
|
||||
|
||||
package csaf
|
||||
|
||||
// CVSS30AttackComplexity represents the attackComplexityType in CVSS30.
|
||||
type CVSS30AttackComplexity string
|
||||
|
||||
const (
|
||||
// CVSS30AttackComplexityHigh is a constant for "HIGH".
|
||||
CVSS30AttackComplexityHigh CVSS30AttackComplexity = "HIGH"
|
||||
// CVSS30AttackComplexityLow is a constant for "LOW".
|
||||
CVSS30AttackComplexityLow CVSS30AttackComplexity = "LOW"
|
||||
)
|
||||
|
||||
var cvss30AttackComplexityPattern = alternativesUnmarshal(
|
||||
string(CVSS30AttackComplexityHigh),
|
||||
string(CVSS30AttackComplexityLow),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS30AttackComplexity) UnmarshalText(data []byte) error {
|
||||
s, err := cvss30AttackComplexityPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS30AttackComplexity(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS30AttackVector represents the attackVectorType in CVSS30.
|
||||
type CVSS30AttackVector string
|
||||
|
||||
const (
|
||||
// CVSS30AttackVectorNetwork is a constant for "NETWORK".
|
||||
CVSS30AttackVectorNetwork CVSS30AttackVector = "NETWORK"
|
||||
// CVSS30AttackVectorAdjacentNetwork is a constant for "ADJACENT_NETWORK".
|
||||
CVSS30AttackVectorAdjacentNetwork CVSS30AttackVector = "ADJACENT_NETWORK"
|
||||
// CVSS30AttackVectorLocal is a constant for "LOCAL".
|
||||
CVSS30AttackVectorLocal CVSS30AttackVector = "LOCAL"
|
||||
// CVSS30AttackVectorPhysical is a constant for "PHYSICAL".
|
||||
CVSS30AttackVectorPhysical CVSS30AttackVector = "PHYSICAL"
|
||||
)
|
||||
|
||||
var cvss30AttackVectorPattern = alternativesUnmarshal(
|
||||
string(CVSS30AttackVectorNetwork),
|
||||
string(CVSS30AttackVectorAdjacentNetwork),
|
||||
string(CVSS30AttackVectorLocal),
|
||||
string(CVSS30AttackVectorPhysical),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS30AttackVector) UnmarshalText(data []byte) error {
|
||||
s, err := cvss30AttackVectorPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS30AttackVector(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS30CiaRequirement represents the ciaRequirementType in CVSS30.
|
||||
type CVSS30CiaRequirement string
|
||||
|
||||
const (
|
||||
// CVSS30CiaRequirementLow is a constant for "LOW".
|
||||
CVSS30CiaRequirementLow CVSS30CiaRequirement = "LOW"
|
||||
// CVSS30CiaRequirementMedium is a constant for "MEDIUM".
|
||||
CVSS30CiaRequirementMedium CVSS30CiaRequirement = "MEDIUM"
|
||||
// CVSS30CiaRequirementHigh is a constant for "HIGH".
|
||||
CVSS30CiaRequirementHigh CVSS30CiaRequirement = "HIGH"
|
||||
// CVSS30CiaRequirementNotDefined is a constant for "NOT_DEFINED".
|
||||
CVSS30CiaRequirementNotDefined CVSS30CiaRequirement = "NOT_DEFINED"
|
||||
)
|
||||
|
||||
var cvss30CiaRequirementPattern = alternativesUnmarshal(
|
||||
string(CVSS30CiaRequirementLow),
|
||||
string(CVSS30CiaRequirementMedium),
|
||||
string(CVSS30CiaRequirementHigh),
|
||||
string(CVSS30CiaRequirementNotDefined),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS30CiaRequirement) UnmarshalText(data []byte) error {
|
||||
s, err := cvss30CiaRequirementPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS30CiaRequirement(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS30Cia represents the ciaType in CVSS30.
|
||||
type CVSS30Cia string
|
||||
|
||||
const (
|
||||
// CVSS30CiaNone is a constant for "NONE".
|
||||
CVSS30CiaNone CVSS30Cia = "NONE"
|
||||
// CVSS30CiaLow is a constant for "LOW".
|
||||
CVSS30CiaLow CVSS30Cia = "LOW"
|
||||
// CVSS30CiaHigh is a constant for "HIGH".
|
||||
CVSS30CiaHigh CVSS30Cia = "HIGH"
|
||||
)
|
||||
|
||||
var cvss30CiaPattern = alternativesUnmarshal(
|
||||
string(CVSS30CiaNone),
|
||||
string(CVSS30CiaLow),
|
||||
string(CVSS30CiaHigh),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS30Cia) UnmarshalText(data []byte) error {
|
||||
s, err := cvss30CiaPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS30Cia(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS30Confidence represents the confidenceType in CVSS30.
|
||||
type CVSS30Confidence string
|
||||
|
||||
const (
|
||||
// CVSS30ConfidenceUnknown is a constant for "UNKNOWN".
|
||||
CVSS30ConfidenceUnknown CVSS30Confidence = "UNKNOWN"
|
||||
// CVSS30ConfidenceReasonable is a constant for "REASONABLE".
|
||||
CVSS30ConfidenceReasonable CVSS30Confidence = "REASONABLE"
|
||||
// CVSS30ConfidenceConfirmed is a constant for "CONFIRMED".
|
||||
CVSS30ConfidenceConfirmed CVSS30Confidence = "CONFIRMED"
|
||||
// CVSS30ConfidenceNotDefined is a constant for "NOT_DEFINED".
|
||||
CVSS30ConfidenceNotDefined CVSS30Confidence = "NOT_DEFINED"
|
||||
)
|
||||
|
||||
var cvss30ConfidencePattern = alternativesUnmarshal(
|
||||
string(CVSS30ConfidenceUnknown),
|
||||
string(CVSS30ConfidenceReasonable),
|
||||
string(CVSS30ConfidenceConfirmed),
|
||||
string(CVSS30ConfidenceNotDefined),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS30Confidence) UnmarshalText(data []byte) error {
|
||||
s, err := cvss30ConfidencePattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS30Confidence(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS30ExploitCodeMaturity represents the exploitCodeMaturityType in CVSS30.
|
||||
type CVSS30ExploitCodeMaturity string
|
||||
|
||||
const (
|
||||
// CVSS30ExploitCodeMaturityUnproven is a constant for "UNPROVEN".
|
||||
CVSS30ExploitCodeMaturityUnproven CVSS30ExploitCodeMaturity = "UNPROVEN"
|
||||
// CVSS30ExploitCodeMaturityProofOfConcept is a constant for "PROOF_OF_CONCEPT".
|
||||
CVSS30ExploitCodeMaturityProofOfConcept CVSS30ExploitCodeMaturity = "PROOF_OF_CONCEPT"
|
||||
// CVSS30ExploitCodeMaturityFunctional is a constant for "FUNCTIONAL".
|
||||
CVSS30ExploitCodeMaturityFunctional CVSS30ExploitCodeMaturity = "FUNCTIONAL"
|
||||
// CVSS30ExploitCodeMaturityHigh is a constant for "HIGH".
|
||||
CVSS30ExploitCodeMaturityHigh CVSS30ExploitCodeMaturity = "HIGH"
|
||||
// CVSS30ExploitCodeMaturityNotDefined is a constant for "NOT_DEFINED".
|
||||
CVSS30ExploitCodeMaturityNotDefined CVSS30ExploitCodeMaturity = "NOT_DEFINED"
|
||||
)
|
||||
|
||||
var cvss30ExploitCodeMaturityPattern = alternativesUnmarshal(
|
||||
string(CVSS30ExploitCodeMaturityUnproven),
|
||||
string(CVSS30ExploitCodeMaturityProofOfConcept),
|
||||
string(CVSS30ExploitCodeMaturityFunctional),
|
||||
string(CVSS30ExploitCodeMaturityHigh),
|
||||
string(CVSS30ExploitCodeMaturityNotDefined),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS30ExploitCodeMaturity) UnmarshalText(data []byte) error {
|
||||
s, err := cvss30ExploitCodeMaturityPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS30ExploitCodeMaturity(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS30ModifiedAttackComplexity represents the modifiedAttackComplexityType in CVSS30.
|
||||
type CVSS30ModifiedAttackComplexity string
|
||||
|
||||
const (
|
||||
// CVSS30ModifiedAttackComplexityHigh is a constant for "HIGH".
|
||||
CVSS30ModifiedAttackComplexityHigh CVSS30ModifiedAttackComplexity = "HIGH"
|
||||
// CVSS30ModifiedAttackComplexityLow is a constant for "LOW".
|
||||
CVSS30ModifiedAttackComplexityLow CVSS30ModifiedAttackComplexity = "LOW"
|
||||
// CVSS30ModifiedAttackComplexityNotDefined is a constant for "NOT_DEFINED".
|
||||
CVSS30ModifiedAttackComplexityNotDefined CVSS30ModifiedAttackComplexity = "NOT_DEFINED"
|
||||
)
|
||||
|
||||
var cvss30ModifiedAttackComplexityPattern = alternativesUnmarshal(
|
||||
string(CVSS30ModifiedAttackComplexityHigh),
|
||||
string(CVSS30ModifiedAttackComplexityLow),
|
||||
string(CVSS30ModifiedAttackComplexityNotDefined),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS30ModifiedAttackComplexity) UnmarshalText(data []byte) error {
|
||||
s, err := cvss30ModifiedAttackComplexityPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS30ModifiedAttackComplexity(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS30ModifiedAttackVector represents the modifiedAttackVectorType in CVSS30.
|
||||
type CVSS30ModifiedAttackVector string
|
||||
|
||||
const (
|
||||
// CVSS30ModifiedAttackVectorNetwork is a constant for "NETWORK".
|
||||
CVSS30ModifiedAttackVectorNetwork CVSS30ModifiedAttackVector = "NETWORK"
|
||||
// CVSS30ModifiedAttackVectorAdjacentNetwork is a constant for "ADJACENT_NETWORK".
|
||||
CVSS30ModifiedAttackVectorAdjacentNetwork CVSS30ModifiedAttackVector = "ADJACENT_NETWORK"
|
||||
// CVSS30ModifiedAttackVectorLocal is a constant for "LOCAL".
|
||||
CVSS30ModifiedAttackVectorLocal CVSS30ModifiedAttackVector = "LOCAL"
|
||||
// CVSS30ModifiedAttackVectorPhysical is a constant for "PHYSICAL".
|
||||
CVSS30ModifiedAttackVectorPhysical CVSS30ModifiedAttackVector = "PHYSICAL"
|
||||
// CVSS30ModifiedAttackVectorNotDefined is a constant for "NOT_DEFINED".
|
||||
CVSS30ModifiedAttackVectorNotDefined CVSS30ModifiedAttackVector = "NOT_DEFINED"
|
||||
)
|
||||
|
||||
var cvss30ModifiedAttackVectorPattern = alternativesUnmarshal(
|
||||
string(CVSS30ModifiedAttackVectorNetwork),
|
||||
string(CVSS30ModifiedAttackVectorAdjacentNetwork),
|
||||
string(CVSS30ModifiedAttackVectorLocal),
|
||||
string(CVSS30ModifiedAttackVectorPhysical),
|
||||
string(CVSS30ModifiedAttackVectorNotDefined),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS30ModifiedAttackVector) UnmarshalText(data []byte) error {
|
||||
s, err := cvss30ModifiedAttackVectorPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS30ModifiedAttackVector(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS30ModifiedCia represents the modifiedCiaType in CVSS30.
|
||||
type CVSS30ModifiedCia string
|
||||
|
||||
const (
|
||||
// CVSS30ModifiedCiaNone is a constant for "NONE".
|
||||
CVSS30ModifiedCiaNone CVSS30ModifiedCia = "NONE"
|
||||
// CVSS30ModifiedCiaLow is a constant for "LOW".
|
||||
CVSS30ModifiedCiaLow CVSS30ModifiedCia = "LOW"
|
||||
// CVSS30ModifiedCiaHigh is a constant for "HIGH".
|
||||
CVSS30ModifiedCiaHigh CVSS30ModifiedCia = "HIGH"
|
||||
// CVSS30ModifiedCiaNotDefined is a constant for "NOT_DEFINED".
|
||||
CVSS30ModifiedCiaNotDefined CVSS30ModifiedCia = "NOT_DEFINED"
|
||||
)
|
||||
|
||||
var cvss30ModifiedCiaPattern = alternativesUnmarshal(
|
||||
string(CVSS30ModifiedCiaNone),
|
||||
string(CVSS30ModifiedCiaLow),
|
||||
string(CVSS30ModifiedCiaHigh),
|
||||
string(CVSS30ModifiedCiaNotDefined),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS30ModifiedCia) UnmarshalText(data []byte) error {
|
||||
s, err := cvss30ModifiedCiaPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS30ModifiedCia(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS30ModifiedPrivilegesRequired represents the modifiedPrivilegesRequiredType in CVSS30.
|
||||
type CVSS30ModifiedPrivilegesRequired string
|
||||
|
||||
const (
|
||||
// CVSS30ModifiedPrivilegesRequiredHigh is a constant for "HIGH".
|
||||
CVSS30ModifiedPrivilegesRequiredHigh CVSS30ModifiedPrivilegesRequired = "HIGH"
|
||||
// CVSS30ModifiedPrivilegesRequiredLow is a constant for "LOW".
|
||||
CVSS30ModifiedPrivilegesRequiredLow CVSS30ModifiedPrivilegesRequired = "LOW"
|
||||
// CVSS30ModifiedPrivilegesRequiredNone is a constant for "NONE".
|
||||
CVSS30ModifiedPrivilegesRequiredNone CVSS30ModifiedPrivilegesRequired = "NONE"
|
||||
// CVSS30ModifiedPrivilegesRequiredNotDefined is a constant for "NOT_DEFINED".
|
||||
CVSS30ModifiedPrivilegesRequiredNotDefined CVSS30ModifiedPrivilegesRequired = "NOT_DEFINED"
|
||||
)
|
||||
|
||||
var cvss30ModifiedPrivilegesRequiredPattern = alternativesUnmarshal(
|
||||
string(CVSS30ModifiedPrivilegesRequiredHigh),
|
||||
string(CVSS30ModifiedPrivilegesRequiredLow),
|
||||
string(CVSS30ModifiedPrivilegesRequiredNone),
|
||||
string(CVSS30ModifiedPrivilegesRequiredNotDefined),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS30ModifiedPrivilegesRequired) UnmarshalText(data []byte) error {
|
||||
s, err := cvss30ModifiedPrivilegesRequiredPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS30ModifiedPrivilegesRequired(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS30ModifiedScope represents the modifiedScopeType in CVSS30.
|
||||
type CVSS30ModifiedScope string
|
||||
|
||||
const (
|
||||
// CVSS30ModifiedScopeUnchanged is a constant for "UNCHANGED".
|
||||
CVSS30ModifiedScopeUnchanged CVSS30ModifiedScope = "UNCHANGED"
|
||||
// CVSS30ModifiedScopeChanged is a constant for "CHANGED".
|
||||
CVSS30ModifiedScopeChanged CVSS30ModifiedScope = "CHANGED"
|
||||
// CVSS30ModifiedScopeNotDefined is a constant for "NOT_DEFINED".
|
||||
CVSS30ModifiedScopeNotDefined CVSS30ModifiedScope = "NOT_DEFINED"
|
||||
)
|
||||
|
||||
var cvss30ModifiedScopePattern = alternativesUnmarshal(
|
||||
string(CVSS30ModifiedScopeUnchanged),
|
||||
string(CVSS30ModifiedScopeChanged),
|
||||
string(CVSS30ModifiedScopeNotDefined),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS30ModifiedScope) UnmarshalText(data []byte) error {
|
||||
s, err := cvss30ModifiedScopePattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS30ModifiedScope(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS30ModifiedUserInteraction represents the modifiedUserInteractionType in CVSS30.
|
||||
type CVSS30ModifiedUserInteraction string
|
||||
|
||||
const (
|
||||
// CVSS30ModifiedUserInteractionNone is a constant for "NONE".
|
||||
CVSS30ModifiedUserInteractionNone CVSS30ModifiedUserInteraction = "NONE"
|
||||
// CVSS30ModifiedUserInteractionRequired is a constant for "REQUIRED".
|
||||
CVSS30ModifiedUserInteractionRequired CVSS30ModifiedUserInteraction = "REQUIRED"
|
||||
// CVSS30ModifiedUserInteractionNotDefined is a constant for "NOT_DEFINED".
|
||||
CVSS30ModifiedUserInteractionNotDefined CVSS30ModifiedUserInteraction = "NOT_DEFINED"
|
||||
)
|
||||
|
||||
var cvss30ModifiedUserInteractionPattern = alternativesUnmarshal(
|
||||
string(CVSS30ModifiedUserInteractionNone),
|
||||
string(CVSS30ModifiedUserInteractionRequired),
|
||||
string(CVSS30ModifiedUserInteractionNotDefined),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS30ModifiedUserInteraction) UnmarshalText(data []byte) error {
|
||||
s, err := cvss30ModifiedUserInteractionPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS30ModifiedUserInteraction(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS30PrivilegesRequired represents the privilegesRequiredType in CVSS30.
|
||||
type CVSS30PrivilegesRequired string
|
||||
|
||||
const (
|
||||
// CVSS30PrivilegesRequiredHigh is a constant for "HIGH".
|
||||
CVSS30PrivilegesRequiredHigh CVSS30PrivilegesRequired = "HIGH"
|
||||
// CVSS30PrivilegesRequiredLow is a constant for "LOW".
|
||||
CVSS30PrivilegesRequiredLow CVSS30PrivilegesRequired = "LOW"
|
||||
// CVSS30PrivilegesRequiredNone is a constant for "NONE".
|
||||
CVSS30PrivilegesRequiredNone CVSS30PrivilegesRequired = "NONE"
|
||||
)
|
||||
|
||||
var cvss30PrivilegesRequiredPattern = alternativesUnmarshal(
|
||||
string(CVSS30PrivilegesRequiredHigh),
|
||||
string(CVSS30PrivilegesRequiredLow),
|
||||
string(CVSS30PrivilegesRequiredNone),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS30PrivilegesRequired) UnmarshalText(data []byte) error {
|
||||
s, err := cvss30PrivilegesRequiredPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS30PrivilegesRequired(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS30RemediationLevel represents the remediationLevelType in CVSS30.
|
||||
type CVSS30RemediationLevel string
|
||||
|
||||
const (
|
||||
// CVSS30RemediationLevelOfficialFix is a constant for "OFFICIAL_FIX".
|
||||
CVSS30RemediationLevelOfficialFix CVSS30RemediationLevel = "OFFICIAL_FIX"
|
||||
// CVSS30RemediationLevelTemporaryFix is a constant for "TEMPORARY_FIX".
|
||||
CVSS30RemediationLevelTemporaryFix CVSS30RemediationLevel = "TEMPORARY_FIX"
|
||||
// CVSS30RemediationLevelWorkaround is a constant for "WORKAROUND".
|
||||
CVSS30RemediationLevelWorkaround CVSS30RemediationLevel = "WORKAROUND"
|
||||
// CVSS30RemediationLevelUnavailable is a constant for "UNAVAILABLE".
|
||||
CVSS30RemediationLevelUnavailable CVSS30RemediationLevel = "UNAVAILABLE"
|
||||
// CVSS30RemediationLevelNotDefined is a constant for "NOT_DEFINED".
|
||||
CVSS30RemediationLevelNotDefined CVSS30RemediationLevel = "NOT_DEFINED"
|
||||
)
|
||||
|
||||
var cvss30RemediationLevelPattern = alternativesUnmarshal(
|
||||
string(CVSS30RemediationLevelOfficialFix),
|
||||
string(CVSS30RemediationLevelTemporaryFix),
|
||||
string(CVSS30RemediationLevelWorkaround),
|
||||
string(CVSS30RemediationLevelUnavailable),
|
||||
string(CVSS30RemediationLevelNotDefined),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS30RemediationLevel) UnmarshalText(data []byte) error {
|
||||
s, err := cvss30RemediationLevelPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS30RemediationLevel(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS30Scope represents the scopeType in CVSS30.
|
||||
type CVSS30Scope string
|
||||
|
||||
const (
|
||||
// CVSS30ScopeUnchanged is a constant for "UNCHANGED".
|
||||
CVSS30ScopeUnchanged CVSS30Scope = "UNCHANGED"
|
||||
// CVSS30ScopeChanged is a constant for "CHANGED".
|
||||
CVSS30ScopeChanged CVSS30Scope = "CHANGED"
|
||||
)
|
||||
|
||||
var cvss30ScopePattern = alternativesUnmarshal(
|
||||
string(CVSS30ScopeUnchanged),
|
||||
string(CVSS30ScopeChanged),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS30Scope) UnmarshalText(data []byte) error {
|
||||
s, err := cvss30ScopePattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS30Scope(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS30Severity represents the severityType in CVSS30.
|
||||
type CVSS30Severity string
|
||||
|
||||
const (
|
||||
// CVSS30SeverityNone is a constant for "NONE".
|
||||
CVSS30SeverityNone CVSS30Severity = "NONE"
|
||||
// CVSS30SeverityLow is a constant for "LOW".
|
||||
CVSS30SeverityLow CVSS30Severity = "LOW"
|
||||
// CVSS30SeverityMedium is a constant for "MEDIUM".
|
||||
CVSS30SeverityMedium CVSS30Severity = "MEDIUM"
|
||||
// CVSS30SeverityHigh is a constant for "HIGH".
|
||||
CVSS30SeverityHigh CVSS30Severity = "HIGH"
|
||||
// CVSS30SeverityCritical is a constant for "CRITICAL".
|
||||
CVSS30SeverityCritical CVSS30Severity = "CRITICAL"
|
||||
)
|
||||
|
||||
var cvss30SeverityPattern = alternativesUnmarshal(
|
||||
string(CVSS30SeverityNone),
|
||||
string(CVSS30SeverityLow),
|
||||
string(CVSS30SeverityMedium),
|
||||
string(CVSS30SeverityHigh),
|
||||
string(CVSS30SeverityCritical),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS30Severity) UnmarshalText(data []byte) error {
|
||||
s, err := cvss30SeverityPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS30Severity(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS30UserInteraction represents the userInteractionType in CVSS30.
|
||||
type CVSS30UserInteraction string
|
||||
|
||||
const (
|
||||
// CVSS30UserInteractionNone is a constant for "NONE".
|
||||
CVSS30UserInteractionNone CVSS30UserInteraction = "NONE"
|
||||
// CVSS30UserInteractionRequired is a constant for "REQUIRED".
|
||||
CVSS30UserInteractionRequired CVSS30UserInteraction = "REQUIRED"
|
||||
)
|
||||
|
||||
var cvss30UserInteractionPattern = alternativesUnmarshal(
|
||||
string(CVSS30UserInteractionNone),
|
||||
string(CVSS30UserInteractionRequired),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS30UserInteraction) UnmarshalText(data []byte) error {
|
||||
s, err := cvss30UserInteractionPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS30UserInteraction(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
|
@ -1,500 +0,0 @@
|
|||
// This file is Free Software under the MIT License
|
||||
// without warranty, see README.md and LICENSES/MIT.txt for details.
|
||||
//
|
||||
// SPDX-License-Identifier: MIT
|
||||
//
|
||||
// SPDX-FileCopyrightText: 2023 German Federal Office for Information Security (BSI) <https://www.bsi.bund.de>
|
||||
// Software-Engineering: 2023 Intevation GmbH <https://intevation.de>
|
||||
//
|
||||
// THIS FILE IS MACHINE GENERATED. EDIT WITH CARE!
|
||||
|
||||
package csaf
|
||||
|
||||
// CVSS31AttackComplexity represents the attackComplexityType in CVSS31.
|
||||
type CVSS31AttackComplexity string
|
||||
|
||||
const (
|
||||
// CVSS31AttackComplexityHigh is a constant for "HIGH".
|
||||
CVSS31AttackComplexityHigh CVSS31AttackComplexity = "HIGH"
|
||||
// CVSS31AttackComplexityLow is a constant for "LOW".
|
||||
CVSS31AttackComplexityLow CVSS31AttackComplexity = "LOW"
|
||||
)
|
||||
|
||||
var cvss31AttackComplexityPattern = alternativesUnmarshal(
|
||||
string(CVSS31AttackComplexityHigh),
|
||||
string(CVSS31AttackComplexityLow),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS31AttackComplexity) UnmarshalText(data []byte) error {
|
||||
s, err := cvss31AttackComplexityPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS31AttackComplexity(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS31AttackVector represents the attackVectorType in CVSS31.
|
||||
type CVSS31AttackVector string
|
||||
|
||||
const (
|
||||
// CVSS31AttackVectorNetwork is a constant for "NETWORK".
|
||||
CVSS31AttackVectorNetwork CVSS31AttackVector = "NETWORK"
|
||||
// CVSS31AttackVectorAdjacentNetwork is a constant for "ADJACENT_NETWORK".
|
||||
CVSS31AttackVectorAdjacentNetwork CVSS31AttackVector = "ADJACENT_NETWORK"
|
||||
// CVSS31AttackVectorLocal is a constant for "LOCAL".
|
||||
CVSS31AttackVectorLocal CVSS31AttackVector = "LOCAL"
|
||||
// CVSS31AttackVectorPhysical is a constant for "PHYSICAL".
|
||||
CVSS31AttackVectorPhysical CVSS31AttackVector = "PHYSICAL"
|
||||
)
|
||||
|
||||
var cvss31AttackVectorPattern = alternativesUnmarshal(
|
||||
string(CVSS31AttackVectorNetwork),
|
||||
string(CVSS31AttackVectorAdjacentNetwork),
|
||||
string(CVSS31AttackVectorLocal),
|
||||
string(CVSS31AttackVectorPhysical),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS31AttackVector) UnmarshalText(data []byte) error {
|
||||
s, err := cvss31AttackVectorPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS31AttackVector(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS31CiaRequirement represents the ciaRequirementType in CVSS31.
|
||||
type CVSS31CiaRequirement string
|
||||
|
||||
const (
|
||||
// CVSS31CiaRequirementLow is a constant for "LOW".
|
||||
CVSS31CiaRequirementLow CVSS31CiaRequirement = "LOW"
|
||||
// CVSS31CiaRequirementMedium is a constant for "MEDIUM".
|
||||
CVSS31CiaRequirementMedium CVSS31CiaRequirement = "MEDIUM"
|
||||
// CVSS31CiaRequirementHigh is a constant for "HIGH".
|
||||
CVSS31CiaRequirementHigh CVSS31CiaRequirement = "HIGH"
|
||||
// CVSS31CiaRequirementNotDefined is a constant for "NOT_DEFINED".
|
||||
CVSS31CiaRequirementNotDefined CVSS31CiaRequirement = "NOT_DEFINED"
|
||||
)
|
||||
|
||||
var cvss31CiaRequirementPattern = alternativesUnmarshal(
|
||||
string(CVSS31CiaRequirementLow),
|
||||
string(CVSS31CiaRequirementMedium),
|
||||
string(CVSS31CiaRequirementHigh),
|
||||
string(CVSS31CiaRequirementNotDefined),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS31CiaRequirement) UnmarshalText(data []byte) error {
|
||||
s, err := cvss31CiaRequirementPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS31CiaRequirement(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS31Cia represents the ciaType in CVSS31.
|
||||
type CVSS31Cia string
|
||||
|
||||
const (
|
||||
// CVSS31CiaNone is a constant for "NONE".
|
||||
CVSS31CiaNone CVSS31Cia = "NONE"
|
||||
// CVSS31CiaLow is a constant for "LOW".
|
||||
CVSS31CiaLow CVSS31Cia = "LOW"
|
||||
// CVSS31CiaHigh is a constant for "HIGH".
|
||||
CVSS31CiaHigh CVSS31Cia = "HIGH"
|
||||
)
|
||||
|
||||
var cvss31CiaPattern = alternativesUnmarshal(
|
||||
string(CVSS31CiaNone),
|
||||
string(CVSS31CiaLow),
|
||||
string(CVSS31CiaHigh),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS31Cia) UnmarshalText(data []byte) error {
|
||||
s, err := cvss31CiaPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS31Cia(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS31Confidence represents the confidenceType in CVSS31.
|
||||
type CVSS31Confidence string
|
||||
|
||||
const (
|
||||
// CVSS31ConfidenceUnknown is a constant for "UNKNOWN".
|
||||
CVSS31ConfidenceUnknown CVSS31Confidence = "UNKNOWN"
|
||||
// CVSS31ConfidenceReasonable is a constant for "REASONABLE".
|
||||
CVSS31ConfidenceReasonable CVSS31Confidence = "REASONABLE"
|
||||
// CVSS31ConfidenceConfirmed is a constant for "CONFIRMED".
|
||||
CVSS31ConfidenceConfirmed CVSS31Confidence = "CONFIRMED"
|
||||
// CVSS31ConfidenceNotDefined is a constant for "NOT_DEFINED".
|
||||
CVSS31ConfidenceNotDefined CVSS31Confidence = "NOT_DEFINED"
|
||||
)
|
||||
|
||||
var cvss31ConfidencePattern = alternativesUnmarshal(
|
||||
string(CVSS31ConfidenceUnknown),
|
||||
string(CVSS31ConfidenceReasonable),
|
||||
string(CVSS31ConfidenceConfirmed),
|
||||
string(CVSS31ConfidenceNotDefined),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS31Confidence) UnmarshalText(data []byte) error {
|
||||
s, err := cvss31ConfidencePattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS31Confidence(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS31ExploitCodeMaturity represents the exploitCodeMaturityType in CVSS31.
|
||||
type CVSS31ExploitCodeMaturity string
|
||||
|
||||
const (
|
||||
// CVSS31ExploitCodeMaturityUnproven is a constant for "UNPROVEN".
|
||||
CVSS31ExploitCodeMaturityUnproven CVSS31ExploitCodeMaturity = "UNPROVEN"
|
||||
// CVSS31ExploitCodeMaturityProofOfConcept is a constant for "PROOF_OF_CONCEPT".
|
||||
CVSS31ExploitCodeMaturityProofOfConcept CVSS31ExploitCodeMaturity = "PROOF_OF_CONCEPT"
|
||||
// CVSS31ExploitCodeMaturityFunctional is a constant for "FUNCTIONAL".
|
||||
CVSS31ExploitCodeMaturityFunctional CVSS31ExploitCodeMaturity = "FUNCTIONAL"
|
||||
// CVSS31ExploitCodeMaturityHigh is a constant for "HIGH".
|
||||
CVSS31ExploitCodeMaturityHigh CVSS31ExploitCodeMaturity = "HIGH"
|
||||
// CVSS31ExploitCodeMaturityNotDefined is a constant for "NOT_DEFINED".
|
||||
CVSS31ExploitCodeMaturityNotDefined CVSS31ExploitCodeMaturity = "NOT_DEFINED"
|
||||
)
|
||||
|
||||
var cvss31ExploitCodeMaturityPattern = alternativesUnmarshal(
|
||||
string(CVSS31ExploitCodeMaturityUnproven),
|
||||
string(CVSS31ExploitCodeMaturityProofOfConcept),
|
||||
string(CVSS31ExploitCodeMaturityFunctional),
|
||||
string(CVSS31ExploitCodeMaturityHigh),
|
||||
string(CVSS31ExploitCodeMaturityNotDefined),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS31ExploitCodeMaturity) UnmarshalText(data []byte) error {
|
||||
s, err := cvss31ExploitCodeMaturityPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS31ExploitCodeMaturity(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS31ModifiedAttackComplexity represents the modifiedAttackComplexityType in CVSS31.
|
||||
type CVSS31ModifiedAttackComplexity string
|
||||
|
||||
const (
|
||||
// CVSS31ModifiedAttackComplexityHigh is a constant for "HIGH".
|
||||
CVSS31ModifiedAttackComplexityHigh CVSS31ModifiedAttackComplexity = "HIGH"
|
||||
// CVSS31ModifiedAttackComplexityLow is a constant for "LOW".
|
||||
CVSS31ModifiedAttackComplexityLow CVSS31ModifiedAttackComplexity = "LOW"
|
||||
// CVSS31ModifiedAttackComplexityNotDefined is a constant for "NOT_DEFINED".
|
||||
CVSS31ModifiedAttackComplexityNotDefined CVSS31ModifiedAttackComplexity = "NOT_DEFINED"
|
||||
)
|
||||
|
||||
var cvss31ModifiedAttackComplexityPattern = alternativesUnmarshal(
|
||||
string(CVSS31ModifiedAttackComplexityHigh),
|
||||
string(CVSS31ModifiedAttackComplexityLow),
|
||||
string(CVSS31ModifiedAttackComplexityNotDefined),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS31ModifiedAttackComplexity) UnmarshalText(data []byte) error {
|
||||
s, err := cvss31ModifiedAttackComplexityPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS31ModifiedAttackComplexity(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS31ModifiedAttackVector represents the modifiedAttackVectorType in CVSS31.
|
||||
type CVSS31ModifiedAttackVector string
|
||||
|
||||
const (
|
||||
// CVSS31ModifiedAttackVectorNetwork is a constant for "NETWORK".
|
||||
CVSS31ModifiedAttackVectorNetwork CVSS31ModifiedAttackVector = "NETWORK"
|
||||
// CVSS31ModifiedAttackVectorAdjacentNetwork is a constant for "ADJACENT_NETWORK".
|
||||
CVSS31ModifiedAttackVectorAdjacentNetwork CVSS31ModifiedAttackVector = "ADJACENT_NETWORK"
|
||||
// CVSS31ModifiedAttackVectorLocal is a constant for "LOCAL".
|
||||
CVSS31ModifiedAttackVectorLocal CVSS31ModifiedAttackVector = "LOCAL"
|
||||
// CVSS31ModifiedAttackVectorPhysical is a constant for "PHYSICAL".
|
||||
CVSS31ModifiedAttackVectorPhysical CVSS31ModifiedAttackVector = "PHYSICAL"
|
||||
// CVSS31ModifiedAttackVectorNotDefined is a constant for "NOT_DEFINED".
|
||||
CVSS31ModifiedAttackVectorNotDefined CVSS31ModifiedAttackVector = "NOT_DEFINED"
|
||||
)
|
||||
|
||||
var cvss31ModifiedAttackVectorPattern = alternativesUnmarshal(
|
||||
string(CVSS31ModifiedAttackVectorNetwork),
|
||||
string(CVSS31ModifiedAttackVectorAdjacentNetwork),
|
||||
string(CVSS31ModifiedAttackVectorLocal),
|
||||
string(CVSS31ModifiedAttackVectorPhysical),
|
||||
string(CVSS31ModifiedAttackVectorNotDefined),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS31ModifiedAttackVector) UnmarshalText(data []byte) error {
|
||||
s, err := cvss31ModifiedAttackVectorPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS31ModifiedAttackVector(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS31ModifiedCia represents the modifiedCiaType in CVSS31.
|
||||
type CVSS31ModifiedCia string
|
||||
|
||||
const (
|
||||
// CVSS31ModifiedCiaNone is a constant for "NONE".
|
||||
CVSS31ModifiedCiaNone CVSS31ModifiedCia = "NONE"
|
||||
// CVSS31ModifiedCiaLow is a constant for "LOW".
|
||||
CVSS31ModifiedCiaLow CVSS31ModifiedCia = "LOW"
|
||||
// CVSS31ModifiedCiaHigh is a constant for "HIGH".
|
||||
CVSS31ModifiedCiaHigh CVSS31ModifiedCia = "HIGH"
|
||||
// CVSS31ModifiedCiaNotDefined is a constant for "NOT_DEFINED".
|
||||
CVSS31ModifiedCiaNotDefined CVSS31ModifiedCia = "NOT_DEFINED"
|
||||
)
|
||||
|
||||
var cvss31ModifiedCiaPattern = alternativesUnmarshal(
|
||||
string(CVSS31ModifiedCiaNone),
|
||||
string(CVSS31ModifiedCiaLow),
|
||||
string(CVSS31ModifiedCiaHigh),
|
||||
string(CVSS31ModifiedCiaNotDefined),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS31ModifiedCia) UnmarshalText(data []byte) error {
|
||||
s, err := cvss31ModifiedCiaPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS31ModifiedCia(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS31ModifiedPrivilegesRequired represents the modifiedPrivilegesRequiredType in CVSS31.
|
||||
type CVSS31ModifiedPrivilegesRequired string
|
||||
|
||||
const (
|
||||
// CVSS31ModifiedPrivilegesRequiredHigh is a constant for "HIGH".
|
||||
CVSS31ModifiedPrivilegesRequiredHigh CVSS31ModifiedPrivilegesRequired = "HIGH"
|
||||
// CVSS31ModifiedPrivilegesRequiredLow is a constant for "LOW".
|
||||
CVSS31ModifiedPrivilegesRequiredLow CVSS31ModifiedPrivilegesRequired = "LOW"
|
||||
// CVSS31ModifiedPrivilegesRequiredNone is a constant for "NONE".
|
||||
CVSS31ModifiedPrivilegesRequiredNone CVSS31ModifiedPrivilegesRequired = "NONE"
|
||||
// CVSS31ModifiedPrivilegesRequiredNotDefined is a constant for "NOT_DEFINED".
|
||||
CVSS31ModifiedPrivilegesRequiredNotDefined CVSS31ModifiedPrivilegesRequired = "NOT_DEFINED"
|
||||
)
|
||||
|
||||
var cvss31ModifiedPrivilegesRequiredPattern = alternativesUnmarshal(
|
||||
string(CVSS31ModifiedPrivilegesRequiredHigh),
|
||||
string(CVSS31ModifiedPrivilegesRequiredLow),
|
||||
string(CVSS31ModifiedPrivilegesRequiredNone),
|
||||
string(CVSS31ModifiedPrivilegesRequiredNotDefined),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS31ModifiedPrivilegesRequired) UnmarshalText(data []byte) error {
|
||||
s, err := cvss31ModifiedPrivilegesRequiredPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS31ModifiedPrivilegesRequired(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS31ModifiedScope represents the modifiedScopeType in CVSS31.
|
||||
type CVSS31ModifiedScope string
|
||||
|
||||
const (
|
||||
// CVSS31ModifiedScopeUnchanged is a constant for "UNCHANGED".
|
||||
CVSS31ModifiedScopeUnchanged CVSS31ModifiedScope = "UNCHANGED"
|
||||
// CVSS31ModifiedScopeChanged is a constant for "CHANGED".
|
||||
CVSS31ModifiedScopeChanged CVSS31ModifiedScope = "CHANGED"
|
||||
// CVSS31ModifiedScopeNotDefined is a constant for "NOT_DEFINED".
|
||||
CVSS31ModifiedScopeNotDefined CVSS31ModifiedScope = "NOT_DEFINED"
|
||||
)
|
||||
|
||||
var cvss31ModifiedScopePattern = alternativesUnmarshal(
|
||||
string(CVSS31ModifiedScopeUnchanged),
|
||||
string(CVSS31ModifiedScopeChanged),
|
||||
string(CVSS31ModifiedScopeNotDefined),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS31ModifiedScope) UnmarshalText(data []byte) error {
|
||||
s, err := cvss31ModifiedScopePattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS31ModifiedScope(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS31ModifiedUserInteraction represents the modifiedUserInteractionType in CVSS31.
|
||||
type CVSS31ModifiedUserInteraction string
|
||||
|
||||
const (
|
||||
// CVSS31ModifiedUserInteractionNone is a constant for "NONE".
|
||||
CVSS31ModifiedUserInteractionNone CVSS31ModifiedUserInteraction = "NONE"
|
||||
// CVSS31ModifiedUserInteractionRequired is a constant for "REQUIRED".
|
||||
CVSS31ModifiedUserInteractionRequired CVSS31ModifiedUserInteraction = "REQUIRED"
|
||||
// CVSS31ModifiedUserInteractionNotDefined is a constant for "NOT_DEFINED".
|
||||
CVSS31ModifiedUserInteractionNotDefined CVSS31ModifiedUserInteraction = "NOT_DEFINED"
|
||||
)
|
||||
|
||||
var cvss31ModifiedUserInteractionPattern = alternativesUnmarshal(
|
||||
string(CVSS31ModifiedUserInteractionNone),
|
||||
string(CVSS31ModifiedUserInteractionRequired),
|
||||
string(CVSS31ModifiedUserInteractionNotDefined),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS31ModifiedUserInteraction) UnmarshalText(data []byte) error {
|
||||
s, err := cvss31ModifiedUserInteractionPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS31ModifiedUserInteraction(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS31PrivilegesRequired represents the privilegesRequiredType in CVSS31.
|
||||
type CVSS31PrivilegesRequired string
|
||||
|
||||
const (
|
||||
// CVSS31PrivilegesRequiredHigh is a constant for "HIGH".
|
||||
CVSS31PrivilegesRequiredHigh CVSS31PrivilegesRequired = "HIGH"
|
||||
// CVSS31PrivilegesRequiredLow is a constant for "LOW".
|
||||
CVSS31PrivilegesRequiredLow CVSS31PrivilegesRequired = "LOW"
|
||||
// CVSS31PrivilegesRequiredNone is a constant for "NONE".
|
||||
CVSS31PrivilegesRequiredNone CVSS31PrivilegesRequired = "NONE"
|
||||
)
|
||||
|
||||
var cvss31PrivilegesRequiredPattern = alternativesUnmarshal(
|
||||
string(CVSS31PrivilegesRequiredHigh),
|
||||
string(CVSS31PrivilegesRequiredLow),
|
||||
string(CVSS31PrivilegesRequiredNone),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS31PrivilegesRequired) UnmarshalText(data []byte) error {
|
||||
s, err := cvss31PrivilegesRequiredPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS31PrivilegesRequired(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS31RemediationLevel represents the remediationLevelType in CVSS31.
|
||||
type CVSS31RemediationLevel string
|
||||
|
||||
const (
|
||||
// CVSS31RemediationLevelOfficialFix is a constant for "OFFICIAL_FIX".
|
||||
CVSS31RemediationLevelOfficialFix CVSS31RemediationLevel = "OFFICIAL_FIX"
|
||||
// CVSS31RemediationLevelTemporaryFix is a constant for "TEMPORARY_FIX".
|
||||
CVSS31RemediationLevelTemporaryFix CVSS31RemediationLevel = "TEMPORARY_FIX"
|
||||
// CVSS31RemediationLevelWorkaround is a constant for "WORKAROUND".
|
||||
CVSS31RemediationLevelWorkaround CVSS31RemediationLevel = "WORKAROUND"
|
||||
// CVSS31RemediationLevelUnavailable is a constant for "UNAVAILABLE".
|
||||
CVSS31RemediationLevelUnavailable CVSS31RemediationLevel = "UNAVAILABLE"
|
||||
// CVSS31RemediationLevelNotDefined is a constant for "NOT_DEFINED".
|
||||
CVSS31RemediationLevelNotDefined CVSS31RemediationLevel = "NOT_DEFINED"
|
||||
)
|
||||
|
||||
var cvss31RemediationLevelPattern = alternativesUnmarshal(
|
||||
string(CVSS31RemediationLevelOfficialFix),
|
||||
string(CVSS31RemediationLevelTemporaryFix),
|
||||
string(CVSS31RemediationLevelWorkaround),
|
||||
string(CVSS31RemediationLevelUnavailable),
|
||||
string(CVSS31RemediationLevelNotDefined),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS31RemediationLevel) UnmarshalText(data []byte) error {
|
||||
s, err := cvss31RemediationLevelPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS31RemediationLevel(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS31Scope represents the scopeType in CVSS31.
|
||||
type CVSS31Scope string
|
||||
|
||||
const (
|
||||
// CVSS31ScopeUnchanged is a constant for "UNCHANGED".
|
||||
CVSS31ScopeUnchanged CVSS31Scope = "UNCHANGED"
|
||||
// CVSS31ScopeChanged is a constant for "CHANGED".
|
||||
CVSS31ScopeChanged CVSS31Scope = "CHANGED"
|
||||
)
|
||||
|
||||
var cvss31ScopePattern = alternativesUnmarshal(
|
||||
string(CVSS31ScopeUnchanged),
|
||||
string(CVSS31ScopeChanged),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS31Scope) UnmarshalText(data []byte) error {
|
||||
s, err := cvss31ScopePattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS31Scope(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS31Severity represents the severityType in CVSS31.
|
||||
type CVSS31Severity string
|
||||
|
||||
const (
|
||||
// CVSS31SeverityNone is a constant for "NONE".
|
||||
CVSS31SeverityNone CVSS31Severity = "NONE"
|
||||
// CVSS31SeverityLow is a constant for "LOW".
|
||||
CVSS31SeverityLow CVSS31Severity = "LOW"
|
||||
// CVSS31SeverityMedium is a constant for "MEDIUM".
|
||||
CVSS31SeverityMedium CVSS31Severity = "MEDIUM"
|
||||
// CVSS31SeverityHigh is a constant for "HIGH".
|
||||
CVSS31SeverityHigh CVSS31Severity = "HIGH"
|
||||
// CVSS31SeverityCritical is a constant for "CRITICAL".
|
||||
CVSS31SeverityCritical CVSS31Severity = "CRITICAL"
|
||||
)
|
||||
|
||||
var cvss31SeverityPattern = alternativesUnmarshal(
|
||||
string(CVSS31SeverityNone),
|
||||
string(CVSS31SeverityLow),
|
||||
string(CVSS31SeverityMedium),
|
||||
string(CVSS31SeverityHigh),
|
||||
string(CVSS31SeverityCritical),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS31Severity) UnmarshalText(data []byte) error {
|
||||
s, err := cvss31SeverityPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS31Severity(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS31UserInteraction represents the userInteractionType in CVSS31.
|
||||
type CVSS31UserInteraction string
|
||||
|
||||
const (
|
||||
// CVSS31UserInteractionNone is a constant for "NONE".
|
||||
CVSS31UserInteractionNone CVSS31UserInteraction = "NONE"
|
||||
// CVSS31UserInteractionRequired is a constant for "REQUIRED".
|
||||
CVSS31UserInteractionRequired CVSS31UserInteraction = "REQUIRED"
|
||||
)
|
||||
|
||||
var cvss31UserInteractionPattern = alternativesUnmarshal(
|
||||
string(CVSS31UserInteractionNone),
|
||||
string(CVSS31UserInteractionRequired),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS31UserInteraction) UnmarshalText(data []byte) error {
|
||||
s, err := cvss31UserInteractionPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS31UserInteraction(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
500
csaf/cvss3enums.go
Normal file
500
csaf/cvss3enums.go
Normal file
|
|
@ -0,0 +1,500 @@
|
|||
// This file is Free Software under the MIT License
|
||||
// without warranty, see README.md and LICENSES/MIT.txt for details.
|
||||
//
|
||||
// SPDX-License-Identifier: MIT
|
||||
//
|
||||
// SPDX-FileCopyrightText: 2023 German Federal Office for Information Security (BSI) <https://www.bsi.bund.de>
|
||||
// Software-Engineering: 2023 Intevation GmbH <https://intevation.de>
|
||||
//
|
||||
// THIS FILE IS MACHINE GENERATED. EDIT WITH CARE!
|
||||
|
||||
package csaf
|
||||
|
||||
// CVSS3AttackComplexity represents the attackComplexityType in CVSS3.
|
||||
type CVSS3AttackComplexity string
|
||||
|
||||
const (
|
||||
// CVSS3AttackComplexityHigh is a constant for "HIGH".
|
||||
CVSS3AttackComplexityHigh CVSS3AttackComplexity = "HIGH"
|
||||
// CVSS3AttackComplexityLow is a constant for "LOW".
|
||||
CVSS3AttackComplexityLow CVSS3AttackComplexity = "LOW"
|
||||
)
|
||||
|
||||
var cvss3AttackComplexityPattern = alternativesUnmarshal(
|
||||
string(CVSS3AttackComplexityHigh),
|
||||
string(CVSS3AttackComplexityLow),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS3AttackComplexity) UnmarshalText(data []byte) error {
|
||||
s, err := cvss3AttackComplexityPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS3AttackComplexity(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS3AttackVector represents the attackVectorType in CVSS3.
|
||||
type CVSS3AttackVector string
|
||||
|
||||
const (
|
||||
// CVSS3AttackVectorNetwork is a constant for "NETWORK".
|
||||
CVSS3AttackVectorNetwork CVSS3AttackVector = "NETWORK"
|
||||
// CVSS3AttackVectorAdjacentNetwork is a constant for "ADJACENT_NETWORK".
|
||||
CVSS3AttackVectorAdjacentNetwork CVSS3AttackVector = "ADJACENT_NETWORK"
|
||||
// CVSS3AttackVectorLocal is a constant for "LOCAL".
|
||||
CVSS3AttackVectorLocal CVSS3AttackVector = "LOCAL"
|
||||
// CVSS3AttackVectorPhysical is a constant for "PHYSICAL".
|
||||
CVSS3AttackVectorPhysical CVSS3AttackVector = "PHYSICAL"
|
||||
)
|
||||
|
||||
var cvss3AttackVectorPattern = alternativesUnmarshal(
|
||||
string(CVSS3AttackVectorNetwork),
|
||||
string(CVSS3AttackVectorAdjacentNetwork),
|
||||
string(CVSS3AttackVectorLocal),
|
||||
string(CVSS3AttackVectorPhysical),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS3AttackVector) UnmarshalText(data []byte) error {
|
||||
s, err := cvss3AttackVectorPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS3AttackVector(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS3CiaRequirement represents the ciaRequirementType in CVSS3.
|
||||
type CVSS3CiaRequirement string
|
||||
|
||||
const (
|
||||
// CVSS3CiaRequirementLow is a constant for "LOW".
|
||||
CVSS3CiaRequirementLow CVSS3CiaRequirement = "LOW"
|
||||
// CVSS3CiaRequirementMedium is a constant for "MEDIUM".
|
||||
CVSS3CiaRequirementMedium CVSS3CiaRequirement = "MEDIUM"
|
||||
// CVSS3CiaRequirementHigh is a constant for "HIGH".
|
||||
CVSS3CiaRequirementHigh CVSS3CiaRequirement = "HIGH"
|
||||
// CVSS3CiaRequirementNotDefined is a constant for "NOT_DEFINED".
|
||||
CVSS3CiaRequirementNotDefined CVSS3CiaRequirement = "NOT_DEFINED"
|
||||
)
|
||||
|
||||
var cvss3CiaRequirementPattern = alternativesUnmarshal(
|
||||
string(CVSS3CiaRequirementLow),
|
||||
string(CVSS3CiaRequirementMedium),
|
||||
string(CVSS3CiaRequirementHigh),
|
||||
string(CVSS3CiaRequirementNotDefined),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS3CiaRequirement) UnmarshalText(data []byte) error {
|
||||
s, err := cvss3CiaRequirementPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS3CiaRequirement(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS3Cia represents the ciaType in CVSS3.
|
||||
type CVSS3Cia string
|
||||
|
||||
const (
|
||||
// CVSS3CiaNone is a constant for "NONE".
|
||||
CVSS3CiaNone CVSS3Cia = "NONE"
|
||||
// CVSS3CiaLow is a constant for "LOW".
|
||||
CVSS3CiaLow CVSS3Cia = "LOW"
|
||||
// CVSS3CiaHigh is a constant for "HIGH".
|
||||
CVSS3CiaHigh CVSS3Cia = "HIGH"
|
||||
)
|
||||
|
||||
var cvss3CiaPattern = alternativesUnmarshal(
|
||||
string(CVSS3CiaNone),
|
||||
string(CVSS3CiaLow),
|
||||
string(CVSS3CiaHigh),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS3Cia) UnmarshalText(data []byte) error {
|
||||
s, err := cvss3CiaPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS3Cia(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS3Confidence represents the confidenceType in CVSS3.
|
||||
type CVSS3Confidence string
|
||||
|
||||
const (
|
||||
// CVSS3ConfidenceUnknown is a constant for "UNKNOWN".
|
||||
CVSS3ConfidenceUnknown CVSS3Confidence = "UNKNOWN"
|
||||
// CVSS3ConfidenceReasonable is a constant for "REASONABLE".
|
||||
CVSS3ConfidenceReasonable CVSS3Confidence = "REASONABLE"
|
||||
// CVSS3ConfidenceConfirmed is a constant for "CONFIRMED".
|
||||
CVSS3ConfidenceConfirmed CVSS3Confidence = "CONFIRMED"
|
||||
// CVSS3ConfidenceNotDefined is a constant for "NOT_DEFINED".
|
||||
CVSS3ConfidenceNotDefined CVSS3Confidence = "NOT_DEFINED"
|
||||
)
|
||||
|
||||
var cvss3ConfidencePattern = alternativesUnmarshal(
|
||||
string(CVSS3ConfidenceUnknown),
|
||||
string(CVSS3ConfidenceReasonable),
|
||||
string(CVSS3ConfidenceConfirmed),
|
||||
string(CVSS3ConfidenceNotDefined),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS3Confidence) UnmarshalText(data []byte) error {
|
||||
s, err := cvss3ConfidencePattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS3Confidence(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS3ExploitCodeMaturity represents the exploitCodeMaturityType in CVSS3.
|
||||
type CVSS3ExploitCodeMaturity string
|
||||
|
||||
const (
|
||||
// CVSS3ExploitCodeMaturityUnproven is a constant for "UNPROVEN".
|
||||
CVSS3ExploitCodeMaturityUnproven CVSS3ExploitCodeMaturity = "UNPROVEN"
|
||||
// CVSS3ExploitCodeMaturityProofOfConcept is a constant for "PROOF_OF_CONCEPT".
|
||||
CVSS3ExploitCodeMaturityProofOfConcept CVSS3ExploitCodeMaturity = "PROOF_OF_CONCEPT"
|
||||
// CVSS3ExploitCodeMaturityFunctional is a constant for "FUNCTIONAL".
|
||||
CVSS3ExploitCodeMaturityFunctional CVSS3ExploitCodeMaturity = "FUNCTIONAL"
|
||||
// CVSS3ExploitCodeMaturityHigh is a constant for "HIGH".
|
||||
CVSS3ExploitCodeMaturityHigh CVSS3ExploitCodeMaturity = "HIGH"
|
||||
// CVSS3ExploitCodeMaturityNotDefined is a constant for "NOT_DEFINED".
|
||||
CVSS3ExploitCodeMaturityNotDefined CVSS3ExploitCodeMaturity = "NOT_DEFINED"
|
||||
)
|
||||
|
||||
var cvss3ExploitCodeMaturityPattern = alternativesUnmarshal(
|
||||
string(CVSS3ExploitCodeMaturityUnproven),
|
||||
string(CVSS3ExploitCodeMaturityProofOfConcept),
|
||||
string(CVSS3ExploitCodeMaturityFunctional),
|
||||
string(CVSS3ExploitCodeMaturityHigh),
|
||||
string(CVSS3ExploitCodeMaturityNotDefined),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS3ExploitCodeMaturity) UnmarshalText(data []byte) error {
|
||||
s, err := cvss3ExploitCodeMaturityPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS3ExploitCodeMaturity(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS3ModifiedAttackComplexity represents the modifiedAttackComplexityType in CVSS3.
|
||||
type CVSS3ModifiedAttackComplexity string
|
||||
|
||||
const (
|
||||
// CVSS3ModifiedAttackComplexityHigh is a constant for "HIGH".
|
||||
CVSS3ModifiedAttackComplexityHigh CVSS3ModifiedAttackComplexity = "HIGH"
|
||||
// CVSS3ModifiedAttackComplexityLow is a constant for "LOW".
|
||||
CVSS3ModifiedAttackComplexityLow CVSS3ModifiedAttackComplexity = "LOW"
|
||||
// CVSS3ModifiedAttackComplexityNotDefined is a constant for "NOT_DEFINED".
|
||||
CVSS3ModifiedAttackComplexityNotDefined CVSS3ModifiedAttackComplexity = "NOT_DEFINED"
|
||||
)
|
||||
|
||||
var cvss3ModifiedAttackComplexityPattern = alternativesUnmarshal(
|
||||
string(CVSS3ModifiedAttackComplexityHigh),
|
||||
string(CVSS3ModifiedAttackComplexityLow),
|
||||
string(CVSS3ModifiedAttackComplexityNotDefined),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS3ModifiedAttackComplexity) UnmarshalText(data []byte) error {
|
||||
s, err := cvss3ModifiedAttackComplexityPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS3ModifiedAttackComplexity(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS3ModifiedAttackVector represents the modifiedAttackVectorType in CVSS3.
|
||||
type CVSS3ModifiedAttackVector string
|
||||
|
||||
const (
|
||||
// CVSS3ModifiedAttackVectorNetwork is a constant for "NETWORK".
|
||||
CVSS3ModifiedAttackVectorNetwork CVSS3ModifiedAttackVector = "NETWORK"
|
||||
// CVSS3ModifiedAttackVectorAdjacentNetwork is a constant for "ADJACENT_NETWORK".
|
||||
CVSS3ModifiedAttackVectorAdjacentNetwork CVSS3ModifiedAttackVector = "ADJACENT_NETWORK"
|
||||
// CVSS3ModifiedAttackVectorLocal is a constant for "LOCAL".
|
||||
CVSS3ModifiedAttackVectorLocal CVSS3ModifiedAttackVector = "LOCAL"
|
||||
// CVSS3ModifiedAttackVectorPhysical is a constant for "PHYSICAL".
|
||||
CVSS3ModifiedAttackVectorPhysical CVSS3ModifiedAttackVector = "PHYSICAL"
|
||||
// CVSS3ModifiedAttackVectorNotDefined is a constant for "NOT_DEFINED".
|
||||
CVSS3ModifiedAttackVectorNotDefined CVSS3ModifiedAttackVector = "NOT_DEFINED"
|
||||
)
|
||||
|
||||
var cvss3ModifiedAttackVectorPattern = alternativesUnmarshal(
|
||||
string(CVSS3ModifiedAttackVectorNetwork),
|
||||
string(CVSS3ModifiedAttackVectorAdjacentNetwork),
|
||||
string(CVSS3ModifiedAttackVectorLocal),
|
||||
string(CVSS3ModifiedAttackVectorPhysical),
|
||||
string(CVSS3ModifiedAttackVectorNotDefined),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS3ModifiedAttackVector) UnmarshalText(data []byte) error {
|
||||
s, err := cvss3ModifiedAttackVectorPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS3ModifiedAttackVector(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS3ModifiedCia represents the modifiedCiaType in CVSS3.
|
||||
type CVSS3ModifiedCia string
|
||||
|
||||
const (
|
||||
// CVSS3ModifiedCiaNone is a constant for "NONE".
|
||||
CVSS3ModifiedCiaNone CVSS3ModifiedCia = "NONE"
|
||||
// CVSS3ModifiedCiaLow is a constant for "LOW".
|
||||
CVSS3ModifiedCiaLow CVSS3ModifiedCia = "LOW"
|
||||
// CVSS3ModifiedCiaHigh is a constant for "HIGH".
|
||||
CVSS3ModifiedCiaHigh CVSS3ModifiedCia = "HIGH"
|
||||
// CVSS3ModifiedCiaNotDefined is a constant for "NOT_DEFINED".
|
||||
CVSS3ModifiedCiaNotDefined CVSS3ModifiedCia = "NOT_DEFINED"
|
||||
)
|
||||
|
||||
var cvss3ModifiedCiaPattern = alternativesUnmarshal(
|
||||
string(CVSS3ModifiedCiaNone),
|
||||
string(CVSS3ModifiedCiaLow),
|
||||
string(CVSS3ModifiedCiaHigh),
|
||||
string(CVSS3ModifiedCiaNotDefined),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS3ModifiedCia) UnmarshalText(data []byte) error {
|
||||
s, err := cvss3ModifiedCiaPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS3ModifiedCia(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS3ModifiedPrivilegesRequired represents the modifiedPrivilegesRequiredType in CVSS3.
|
||||
type CVSS3ModifiedPrivilegesRequired string
|
||||
|
||||
const (
|
||||
// CVSS3ModifiedPrivilegesRequiredHigh is a constant for "HIGH".
|
||||
CVSS3ModifiedPrivilegesRequiredHigh CVSS3ModifiedPrivilegesRequired = "HIGH"
|
||||
// CVSS3ModifiedPrivilegesRequiredLow is a constant for "LOW".
|
||||
CVSS3ModifiedPrivilegesRequiredLow CVSS3ModifiedPrivilegesRequired = "LOW"
|
||||
// CVSS3ModifiedPrivilegesRequiredNone is a constant for "NONE".
|
||||
CVSS3ModifiedPrivilegesRequiredNone CVSS3ModifiedPrivilegesRequired = "NONE"
|
||||
// CVSS3ModifiedPrivilegesRequiredNotDefined is a constant for "NOT_DEFINED".
|
||||
CVSS3ModifiedPrivilegesRequiredNotDefined CVSS3ModifiedPrivilegesRequired = "NOT_DEFINED"
|
||||
)
|
||||
|
||||
var cvss3ModifiedPrivilegesRequiredPattern = alternativesUnmarshal(
|
||||
string(CVSS3ModifiedPrivilegesRequiredHigh),
|
||||
string(CVSS3ModifiedPrivilegesRequiredLow),
|
||||
string(CVSS3ModifiedPrivilegesRequiredNone),
|
||||
string(CVSS3ModifiedPrivilegesRequiredNotDefined),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS3ModifiedPrivilegesRequired) UnmarshalText(data []byte) error {
|
||||
s, err := cvss3ModifiedPrivilegesRequiredPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS3ModifiedPrivilegesRequired(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS3ModifiedScope represents the modifiedScopeType in CVSS3.
|
||||
type CVSS3ModifiedScope string
|
||||
|
||||
const (
|
||||
// CVSS3ModifiedScopeUnchanged is a constant for "UNCHANGED".
|
||||
CVSS3ModifiedScopeUnchanged CVSS3ModifiedScope = "UNCHANGED"
|
||||
// CVSS3ModifiedScopeChanged is a constant for "CHANGED".
|
||||
CVSS3ModifiedScopeChanged CVSS3ModifiedScope = "CHANGED"
|
||||
// CVSS3ModifiedScopeNotDefined is a constant for "NOT_DEFINED".
|
||||
CVSS3ModifiedScopeNotDefined CVSS3ModifiedScope = "NOT_DEFINED"
|
||||
)
|
||||
|
||||
var cvss3ModifiedScopePattern = alternativesUnmarshal(
|
||||
string(CVSS3ModifiedScopeUnchanged),
|
||||
string(CVSS3ModifiedScopeChanged),
|
||||
string(CVSS3ModifiedScopeNotDefined),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS3ModifiedScope) UnmarshalText(data []byte) error {
|
||||
s, err := cvss3ModifiedScopePattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS3ModifiedScope(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS3ModifiedUserInteraction represents the modifiedUserInteractionType in CVSS3.
|
||||
type CVSS3ModifiedUserInteraction string
|
||||
|
||||
const (
|
||||
// CVSS3ModifiedUserInteractionNone is a constant for "NONE".
|
||||
CVSS3ModifiedUserInteractionNone CVSS3ModifiedUserInteraction = "NONE"
|
||||
// CVSS3ModifiedUserInteractionRequired is a constant for "REQUIRED".
|
||||
CVSS3ModifiedUserInteractionRequired CVSS3ModifiedUserInteraction = "REQUIRED"
|
||||
// CVSS3ModifiedUserInteractionNotDefined is a constant for "NOT_DEFINED".
|
||||
CVSS3ModifiedUserInteractionNotDefined CVSS3ModifiedUserInteraction = "NOT_DEFINED"
|
||||
)
|
||||
|
||||
var cvss3ModifiedUserInteractionPattern = alternativesUnmarshal(
|
||||
string(CVSS3ModifiedUserInteractionNone),
|
||||
string(CVSS3ModifiedUserInteractionRequired),
|
||||
string(CVSS3ModifiedUserInteractionNotDefined),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS3ModifiedUserInteraction) UnmarshalText(data []byte) error {
|
||||
s, err := cvss3ModifiedUserInteractionPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS3ModifiedUserInteraction(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS3PrivilegesRequired represents the privilegesRequiredType in CVSS3.
|
||||
type CVSS3PrivilegesRequired string
|
||||
|
||||
const (
|
||||
// CVSS3PrivilegesRequiredHigh is a constant for "HIGH".
|
||||
CVSS3PrivilegesRequiredHigh CVSS3PrivilegesRequired = "HIGH"
|
||||
// CVSS3PrivilegesRequiredLow is a constant for "LOW".
|
||||
CVSS3PrivilegesRequiredLow CVSS3PrivilegesRequired = "LOW"
|
||||
// CVSS3PrivilegesRequiredNone is a constant for "NONE".
|
||||
CVSS3PrivilegesRequiredNone CVSS3PrivilegesRequired = "NONE"
|
||||
)
|
||||
|
||||
var cvss3PrivilegesRequiredPattern = alternativesUnmarshal(
|
||||
string(CVSS3PrivilegesRequiredHigh),
|
||||
string(CVSS3PrivilegesRequiredLow),
|
||||
string(CVSS3PrivilegesRequiredNone),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS3PrivilegesRequired) UnmarshalText(data []byte) error {
|
||||
s, err := cvss3PrivilegesRequiredPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS3PrivilegesRequired(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS3RemediationLevel represents the remediationLevelType in CVSS3.
|
||||
type CVSS3RemediationLevel string
|
||||
|
||||
const (
|
||||
// CVSS3RemediationLevelOfficialFix is a constant for "OFFICIAL_FIX".
|
||||
CVSS3RemediationLevelOfficialFix CVSS3RemediationLevel = "OFFICIAL_FIX"
|
||||
// CVSS3RemediationLevelTemporaryFix is a constant for "TEMPORARY_FIX".
|
||||
CVSS3RemediationLevelTemporaryFix CVSS3RemediationLevel = "TEMPORARY_FIX"
|
||||
// CVSS3RemediationLevelWorkaround is a constant for "WORKAROUND".
|
||||
CVSS3RemediationLevelWorkaround CVSS3RemediationLevel = "WORKAROUND"
|
||||
// CVSS3RemediationLevelUnavailable is a constant for "UNAVAILABLE".
|
||||
CVSS3RemediationLevelUnavailable CVSS3RemediationLevel = "UNAVAILABLE"
|
||||
// CVSS3RemediationLevelNotDefined is a constant for "NOT_DEFINED".
|
||||
CVSS3RemediationLevelNotDefined CVSS3RemediationLevel = "NOT_DEFINED"
|
||||
)
|
||||
|
||||
var cvss3RemediationLevelPattern = alternativesUnmarshal(
|
||||
string(CVSS3RemediationLevelOfficialFix),
|
||||
string(CVSS3RemediationLevelTemporaryFix),
|
||||
string(CVSS3RemediationLevelWorkaround),
|
||||
string(CVSS3RemediationLevelUnavailable),
|
||||
string(CVSS3RemediationLevelNotDefined),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS3RemediationLevel) UnmarshalText(data []byte) error {
|
||||
s, err := cvss3RemediationLevelPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS3RemediationLevel(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS3Scope represents the scopeType in CVSS3.
|
||||
type CVSS3Scope string
|
||||
|
||||
const (
|
||||
// CVSS3ScopeUnchanged is a constant for "UNCHANGED".
|
||||
CVSS3ScopeUnchanged CVSS3Scope = "UNCHANGED"
|
||||
// CVSS3ScopeChanged is a constant for "CHANGED".
|
||||
CVSS3ScopeChanged CVSS3Scope = "CHANGED"
|
||||
)
|
||||
|
||||
var cvss3ScopePattern = alternativesUnmarshal(
|
||||
string(CVSS3ScopeUnchanged),
|
||||
string(CVSS3ScopeChanged),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS3Scope) UnmarshalText(data []byte) error {
|
||||
s, err := cvss3ScopePattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS3Scope(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS3Severity represents the severityType in CVSS3.
|
||||
type CVSS3Severity string
|
||||
|
||||
const (
|
||||
// CVSS3SeverityNone is a constant for "NONE".
|
||||
CVSS3SeverityNone CVSS3Severity = "NONE"
|
||||
// CVSS3SeverityLow is a constant for "LOW".
|
||||
CVSS3SeverityLow CVSS3Severity = "LOW"
|
||||
// CVSS3SeverityMedium is a constant for "MEDIUM".
|
||||
CVSS3SeverityMedium CVSS3Severity = "MEDIUM"
|
||||
// CVSS3SeverityHigh is a constant for "HIGH".
|
||||
CVSS3SeverityHigh CVSS3Severity = "HIGH"
|
||||
// CVSS3SeverityCritical is a constant for "CRITICAL".
|
||||
CVSS3SeverityCritical CVSS3Severity = "CRITICAL"
|
||||
)
|
||||
|
||||
var cvss3SeverityPattern = alternativesUnmarshal(
|
||||
string(CVSS3SeverityNone),
|
||||
string(CVSS3SeverityLow),
|
||||
string(CVSS3SeverityMedium),
|
||||
string(CVSS3SeverityHigh),
|
||||
string(CVSS3SeverityCritical),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS3Severity) UnmarshalText(data []byte) error {
|
||||
s, err := cvss3SeverityPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS3Severity(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CVSS3UserInteraction represents the userInteractionType in CVSS3.
|
||||
type CVSS3UserInteraction string
|
||||
|
||||
const (
|
||||
// CVSS3UserInteractionNone is a constant for "NONE".
|
||||
CVSS3UserInteractionNone CVSS3UserInteraction = "NONE"
|
||||
// CVSS3UserInteractionRequired is a constant for "REQUIRED".
|
||||
CVSS3UserInteractionRequired CVSS3UserInteraction = "REQUIRED"
|
||||
)
|
||||
|
||||
var cvss3UserInteractionPattern = alternativesUnmarshal(
|
||||
string(CVSS3UserInteractionNone),
|
||||
string(CVSS3UserInteractionRequired),
|
||||
)
|
||||
|
||||
// UnmarshalText implements the [encoding.TextUnmarshaler] interface.
|
||||
func (e *CVSS3UserInteraction) UnmarshalText(data []byte) error {
|
||||
s, err := cvss3UserInteractionPattern(data)
|
||||
if err == nil {
|
||||
*e = CVSS3UserInteraction(s)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
|
@ -10,5 +10,6 @@
|
|||
package csaf
|
||||
|
||||
//go:generate go run ./generate_cvss_enums.go -o cvss20enums.go -i ./schema/cvss-v2.0.json -p CVSS20
|
||||
//go:generate go run ./generate_cvss_enums.go -o cvss30enums.go -i ./schema/cvss-v3.0.json -p CVSS30
|
||||
//go:generate go run ./generate_cvss_enums.go -o cvss31enums.go -i ./schema/cvss-v3.1.json -p CVSS31
|
||||
// Generating only enums for CVSS 3.0 and not for 3.1 since the enums of both of them
|
||||
// are identical.
|
||||
//go:generate go run ./generate_cvss_enums.go -o cvss3enums.go -i ./schema/cvss-v3.0.json -p CVSS3
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue