Coverage for csaf/vuln_types.py: 100.00%

120 statements  

« prev     ^ index     » next       coverage.py v7.4.1, created at 2024-02-04 16:28:45 +00:00

1"""CVSS 2/3.0/3.1 general definitions.""" 

2 

3from __future__ import annotations 

4 

5from enum import Enum 

6from typing import Annotated 

7 

8from pydantic import Field, RootModel 

9 

10 

11class AccessVectorType(Enum): 

12 network = 'NETWORK' 

13 adjacent_network = 'ADJACENT_NETWORK' 

14 local = 'LOCAL' 

15 

16 

17class AccessComplexityType(Enum): 

18 high = 'HIGH' 

19 medium = 'MEDIUM' 

20 low = 'LOW' 

21 

22 

23class AuthenticationType(Enum): 

24 multiple = 'MULTIPLE' 

25 single = 'SINGLE' 

26 none = 'NONE' 

27 

28 

29class CiaType(Enum): 

30 none = 'NONE' 

31 low = 'LOW' 

32 high = 'HIGH' 

33 

34 

35class ExploitabilityType(Enum): 

36 unproven = 'UNPROVEN' 

37 proof_of_concept = 'PROOF_OF_CONCEPT' 

38 functional = 'FUNCTIONAL' 

39 high = 'HIGH' 

40 not_defined = 'NOT_DEFINED' 

41 

42 

43class RemediationLevelType(Enum): 

44 official_fix = 'OFFICIAL_FIX' 

45 temporary_fix = 'TEMPORARY_FIX' 

46 workaround = 'WORKAROUND' 

47 unavailable = 'UNAVAILABLE' 

48 not_defined = 'NOT_DEFINED' 

49 

50 

51class ReportConfidenceType(Enum): 

52 unconfirmed = 'UNCONFIRMED' 

53 uncorroborated = 'UNCORROBORATED' 

54 confirmed = 'CONFIRMED' 

55 not_defined = 'NOT_DEFINED' 

56 

57 

58class CollateralDamagePotentialType(Enum): 

59 none = 'NONE' 

60 low = 'LOW' 

61 low_medium = 'LOW_MEDIUM' 

62 medium_high = 'MEDIUM_HIGH' 

63 high = 'HIGH' 

64 not_defined = 'NOT_DEFINED' 

65 

66 

67class TargetDistributionType(Enum): 

68 none = 'NONE' 

69 low = 'LOW' 

70 medium = 'MEDIUM' 

71 high = 'HIGH' 

72 not_defined = 'NOT_DEFINED' 

73 

74 

75class CiaRequirementType(Enum): 

76 low = 'LOW' 

77 medium = 'MEDIUM' 

78 high = 'HIGH' 

79 not_defined = 'NOT_DEFINED' 

80 

81 

82class AttackVectorType(Enum): 

83 network = 'NETWORK' 

84 adjacent_network = 'ADJACENT_NETWORK' 

85 local = 'LOCAL' 

86 physical = 'PHYSICAL' 

87 

88 

89class ModifiedAttackVectorType(Enum): 

90 network = 'NETWORK' 

91 adjacent_network = 'ADJACENT_NETWORK' 

92 local = 'LOCAL' 

93 physical = 'PHYSICAL' 

94 not_defined = 'NOT_DEFINED' 

95 

96 

97class AttackComplexityType(Enum): 

98 high = 'HIGH' 

99 low = 'LOW' 

100 

101 

102class ModifiedAttackComplexityType(Enum): 

103 high = 'HIGH' 

104 low = 'LOW' 

105 not_defined = 'NOT_DEFINED' 

106 

107 

108class PrivilegesRequiredType(Enum): 

109 high = 'HIGH' 

110 low = 'LOW' 

111 none = 'NONE' 

112 

113 

114class ModifiedPrivilegesRequiredType(Enum): 

115 high = 'HIGH' 

116 low = 'LOW' 

117 none = 'NONE' 

118 not_defined = 'NOT_DEFINED' 

119 

120 

121class UserInteractionType(Enum): 

122 none = 'NONE' 

123 required = 'REQUIRED' 

124 

125 

126class ModifiedUserInteractionType(Enum): 

127 none = 'NONE' 

128 required = 'REQUIRED' 

129 not_defined = 'NOT_DEFINED' 

130 

131 

132class ScopeType(Enum): 

133 unchanged = 'UNCHANGED' 

134 changed = 'CHANGED' 

135 

136 

137class ModifiedScopeType(Enum): 

138 unchanged = 'UNCHANGED' 

139 changed = 'CHANGED' 

140 not_defined = 'NOT_DEFINED' 

141 

142 

143class ModifiedCiaType(Enum): 

144 none = 'NONE' 

145 low = 'LOW' 

146 high = 'HIGH' 

147 not_defined = 'NOT_DEFINED' 

148 

149 

150class ExploitCodeMaturityType(Enum): 

151 unproven = 'UNPROVEN' 

152 proof_of_concept = 'PROOF_OF_CONCEPT' 

153 functional = 'FUNCTIONAL' 

154 high = 'HIGH' 

155 not_defined = 'NOT_DEFINED' 

156 

157 

158class ConfidenceType(Enum): 

159 unknown = 'UNKNOWN' 

160 reasonable = 'REASONABLE' 

161 confirmed = 'CONFIRMED' 

162 not_defined = 'NOT_DEFINED' 

163 

164 

165class ScoreType(RootModel[Annotated[float, Field(ge=0.0, le=10.0)]]): 

166 pass 

167 

168 

169class SeverityType(Enum): 

170 none = 'NONE' 

171 low = 'LOW' 

172 medium = 'MEDIUM' 

173 high = 'HIGH' 

174 critical = 'CRITICAL'