aboutsummaryrefslogtreecommitdiff
path: root/internal/cvss/v3key.go
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2022-02-04 00:35:31 -0500
committerPaul Duncan <pabs@pablotron.org>2022-02-04 00:35:31 -0500
commit9c17b97cd0f83be3fff9fa4e87fd1d29052ea616 (patch)
tree0d97030a0d0c3ad983be281ce89f80571338887f /internal/cvss/v3key.go
parent92400d731546557d110c9c3cc3906d700f83dda8 (diff)
downloadcvez-9c17b97cd0f83be3fff9fa4e87fd1d29052ea616.tar.bz2
cvez-9c17b97cd0f83be3fff9fa4e87fd1d29052ea616.zip
rename to github.com/pablotron/cvez, remove internal libs
Diffstat (limited to 'internal/cvss/v3key.go')
-rw-r--r--internal/cvss/v3key.go116
1 files changed, 0 insertions, 116 deletions
diff --git a/internal/cvss/v3key.go b/internal/cvss/v3key.go
deleted file mode 100644
index 653c2da..0000000
--- a/internal/cvss/v3key.go
+++ /dev/null
@@ -1,116 +0,0 @@
-package cvss
-
-//go:generate stringer -linecomment -type=v3Key
-
-// CVSS v3 metric key
-type v3Key byte
-
-const (
- v3AttackVector v3Key = iota // AV
- v3AttackComplexity // AC
- v3PrivilegesRequired // PR
- v3UserInteraction // UI
- v3Scope // S
- v3Confidentiality // C
- v3Integrity // I
- v3Availability // A
- v3ExploitCodeMaturity // E
- v3RemediationLevel // RL
- v3ReportConfidence // RC
- v3ConfidentialityRequirement // CR
- v3IntegrityRequirement // IR
- v3AvailabilityRequirement // AR
- v3ModifiedAttackVector // MAV
- v3ModifiedAttackComplexity // MAC
- v3ModifiedPrivilegesRequired // MPR
- v3ModifiedUserInteraction // MUI
- v3ModifiedScope // MS
- v3ModifiedConfidentiality // MC
- v3ModifiedIntegrity // MI
- v3ModifiedAvailability // MA
-
- v3InvalidKey // invalid
-)
-
-// CVSS v3 metric key info lut
-var v3Keys = map[v3Key]struct {
- Name string
- Category Category
-} {
- v3AttackVector: { "Attack Vector", Base },
- v3AttackComplexity: { "Attack Complexity", Base },
- v3PrivilegesRequired: { "Privileges Required", Base },
- v3UserInteraction: { "User Interaction", Base },
- v3Scope: { "Scope", Base },
- v3Confidentiality: { "Confidentiality", Base },
- v3Integrity: { "Integrity", Base },
- v3Availability: { "Availability", Base },
- v3ExploitCodeMaturity: { "Exploit Code Maturity", Temporal },
- v3RemediationLevel: { "Remediation Level", Temporal },
- v3ReportConfidence: { "Report Confidence", Temporal },
- v3ConfidentialityRequirement: { "Confidentiality Requirement", Environmental },
- v3IntegrityRequirement: { "Integrity Requirement", Environmental },
- v3AvailabilityRequirement: { "Availability Requirement", Environmental },
- v3ModifiedAttackVector: { "Modified Attack Vector", Environmental },
- v3ModifiedAttackComplexity: { "Modified Attack Complexity", Environmental },
- v3ModifiedPrivilegesRequired: { "Modified Privileges Required", Environmental },
- v3ModifiedUserInteraction: { "Modified User Interaction", Environmental },
- v3ModifiedScope: { "Modified Scope", Environmental },
- v3ModifiedConfidentiality: { "Modified Confidentiality", Environmental },
- v3ModifiedIntegrity: { "Modified Integrity", Environmental },
- v3ModifiedAvailability: { "Modified Availability", Environmental },
-}
-
-// // metric key IDs lut
-// var v3KeyIds = map[string]v3Key {
-// "AV": v3AttackVector,
-// "AC": v3AttackComplexity,
-// "PR": v3PrivilegesRequired,
-// "UI": v3UserInteraction,
-// "S": v3Scope,
-// "C": v3Confidentiality,
-// "I": v3Integrity,
-// "A": v3Availability,
-// "E": v3ExploitCodeMaturity,
-// "RL": v3RemediationLevel,
-// "RC": v3ReportConfidence,
-// "CR": v3ConfidentialityRequirement,
-// "IR": v3IntegrityRequirement,
-// "AR": v3AvailabilityRequirement,
-// "MAV": v3ModifiedAttackVector,
-// "MAC": v3ModifiedAttackComplexity,
-// "MPR": v3ModifiedPrivilegesRequired,
-// "MUI": v3ModifiedUserInteraction,
-// "MS": v3ModifiedScope,
-// "MC": v3ModifiedConfidentiality,
-// "MI": v3ModifiedIntegrity,
-// "MA": v3ModifiedAvailability,
-// }
-//
-// // Get metric key from string.
-// func getV3KeyFromString(s string) (v3Key, error) {
-// k, ok := v3KeyIds[s]
-// if ok {
-// return k, nil
-// } else {
-// return v3InvalidKey, newBadKey(V30, s)
-// }
-// }
-
-// Get metric key name.
-func (k v3Key) Name() string {
- if data, ok := v3Keys[k]; ok {
- return data.Name
- } else {
- return "invalid"
- }
-}
-
-// Get metric key category.
-func (k v3Key) Category() Category {
- if data, ok := v3Keys[k]; ok {
- return data.Category
- } else {
- return InvalidCategory
- }
-}