From a3db90027c189e0efe919d8819c25c4231c50ef1 Mon Sep 17 00:00:00 2001 From: Spiegel Date: Tue, 27 Sep 2022 20:41:27 +0900 Subject: [PATCH] Update credit --- README.md | 2 +- v2/base/base.go | 15 +-------------- v2/base/base_test.go | 2 ++ v2/base/metric-a.go | 25 ++++++------------------- v2/base/metric-ac.go | 25 ++++++------------------- v2/base/metric-au.go | 25 ++++++------------------- v2/base/metric-av.go | 25 ++++++------------------- v2/base/metric-c.go | 25 ++++++------------------- v2/base/metric-i.go | 25 ++++++------------------- v2/base/metrics-e.go | 12 +++++++----- v2/base/metrics-rc.go | 12 +++++++----- v2/base/metrics-rl.go | 12 +++++++----- v2/base/severity.go | 19 +++---------------- v2/cvss.go | 15 +-------------- 14 files changed, 65 insertions(+), 174 deletions(-) diff --git a/README.md b/README.md index 11c9e47..a08d841 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Importing CVSS vector and scoring. -- Supoort CVSS version 3.0 and 3.1 +- Supoort CVSS v2, v3.0 and v3.1 - Exporting CVSS information with template string **Migrated repository to [github.com/goark/go-cvss][go-cvss]** diff --git a/v2/base/base.go b/v2/base/base.go index 6dd1472..c8d590e 100644 --- a/v2/base/base.go +++ b/v2/base/base.go @@ -153,17 +153,4 @@ func (m *Metrics) TemporalScore() float64 { return math.Round(m.Score()*m.E.Value()*m.RL.Value()*m.RC.Value()*10) / 10 } -/* Copyright 2018-2020 Spiegel - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +/* Copyright 2022 luxifer */ diff --git a/v2/base/base_test.go b/v2/base/base_test.go index d9a730e..f948ae5 100644 --- a/v2/base/base_test.go +++ b/v2/base/base_test.go @@ -438,3 +438,5 @@ func TestDecode(t *testing.T) { }) } } + +/* Copyright 2022 luxifer */ diff --git a/v2/base/metric-a.go b/v2/base/metric-a.go index ace2594..8ca8245 100644 --- a/v2/base/metric-a.go +++ b/v2/base/metric-a.go @@ -2,10 +2,10 @@ package base import "strings" -//AvailabilityImpact is metric type for Base Metrics +// AvailabilityImpact is metric type for Base Metrics type AvailabilityImpact int -//Constant of AvailabilityImpact result +// Constant of AvailabilityImpact result const ( AvailabilityImpactUnknown AvailabilityImpact = iota AvailabilityImpactNone @@ -25,7 +25,7 @@ var availabilityImpactValueMap = map[AvailabilityImpact]float64{ AvailabilityImpactComplete: 0.66, } -//GetAvailabilityImpact returns result of AvailabilityImpact metric +// GetAvailabilityImpact returns result of AvailabilityImpact metric func GetAvailabilityImpact(s string) AvailabilityImpact { s = strings.ToUpper(s) for k, v := range availabilityImpactMap { @@ -43,7 +43,7 @@ func (ai AvailabilityImpact) String() string { return "" } -//Value returns value of AvailabilityImpact metric +// Value returns value of AvailabilityImpact metric func (ai AvailabilityImpact) Value() float64 { if v, ok := availabilityImpactValueMap[ai]; ok { return v @@ -51,22 +51,9 @@ func (ai AvailabilityImpact) Value() float64 { return 0.0 } -//IsDefined returns false if undefined result value of metric +// IsDefined returns false if undefined result value of metric func (ai AvailabilityImpact) IsDefined() bool { return ai != AvailabilityImpactUnknown } -/* Copyright 2018 Spiegel - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +/* Copyright 2022 luxifer */ diff --git a/v2/base/metric-ac.go b/v2/base/metric-ac.go index def5c52..9992a19 100644 --- a/v2/base/metric-ac.go +++ b/v2/base/metric-ac.go @@ -2,10 +2,10 @@ package base import "strings" -//AccessComplexity is metric type for Base Metrics +// AccessComplexity is metric type for Base Metrics type AccessComplexity int -//Constant of AccessComplexity result +// Constant of AccessComplexity result const ( AccessComplexityUnknown AccessComplexity = iota AccessComplexityHigh @@ -25,7 +25,7 @@ var accessComplexityValueMap = map[AccessComplexity]float64{ AccessComplexityLow: 0.71, } -//GetAccessComplexity returns result of AccessComplexity metric +// GetAccessComplexity returns result of AccessComplexity metric func GetAccessComplexity(s string) AccessComplexity { s = strings.ToUpper(s) for k, v := range accessComplexityMap { @@ -43,7 +43,7 @@ func (ac AccessComplexity) String() string { return "" } -//Value returns value of AccessComplexity metric +// Value returns value of AccessComplexity metric func (ac AccessComplexity) Value() float64 { if v, ok := accessComplexityValueMap[ac]; ok { return v @@ -51,22 +51,9 @@ func (ac AccessComplexity) Value() float64 { return 0.0 } -//IsDefined returns false if undefined result value of metric +// IsDefined returns false if undefined result value of metric func (ac AccessComplexity) IsDefined() bool { return ac != AccessComplexityUnknown } -/* Copyright 2018 Spiegel - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +/* Copyright 2022 luxifer */ diff --git a/v2/base/metric-au.go b/v2/base/metric-au.go index 4a44d50..1aa8b5d 100644 --- a/v2/base/metric-au.go +++ b/v2/base/metric-au.go @@ -2,10 +2,10 @@ package base import "strings" -//Authentication is metric type for Base Metrics +// Authentication is metric type for Base Metrics type Authentication int -//Constant of Authentication result +// Constant of Authentication result const ( AuthenticationUnknown Authentication = iota AuthenticationNone @@ -25,7 +25,7 @@ var authenticationValueMap = map[Authentication]float64{ AuthenticationMultiple: 0.45, } -//GetAuthentication returns result of Authentication metric +// GetAuthentication returns result of Authentication metric func GetAuthentication(s string) Authentication { s = strings.ToUpper(s) for k, v := range authenticationMap { @@ -43,7 +43,7 @@ func (av Authentication) String() string { return "" } -//Value returns value of Authentication metric +// Value returns value of Authentication metric func (av Authentication) Value() float64 { if v, ok := authenticationValueMap[av]; ok { return v @@ -51,22 +51,9 @@ func (av Authentication) Value() float64 { return 0.0 } -//IsDefined returns false if undefined result value of metric +// IsDefined returns false if undefined result value of metric func (av Authentication) IsDefined() bool { return av != AuthenticationUnknown } -/* Copyright 2018 Spiegel - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +/* Copyright 2022 luxifer */ diff --git a/v2/base/metric-av.go b/v2/base/metric-av.go index e14bbee..5b50e66 100644 --- a/v2/base/metric-av.go +++ b/v2/base/metric-av.go @@ -2,10 +2,10 @@ package base import "strings" -//AccessVector is metric type for Base Metrics +// AccessVector is metric type for Base Metrics type AccessVector int -//Constant of AccessVector result +// Constant of AccessVector result const ( AccessVectorUnknown AccessVector = iota AccessVectorLocal @@ -25,7 +25,7 @@ var accessVectorValueMap = map[AccessVector]float64{ AccessVectorNetwork: 1, } -//GetAccessVector returns result of AccessVector metric +// GetAccessVector returns result of AccessVector metric func GetAccessVector(s string) AccessVector { s = strings.ToUpper(s) for k, v := range accessVectorMap { @@ -43,7 +43,7 @@ func (av AccessVector) String() string { return "" } -//Value returns value of AccessVector metric +// Value returns value of AccessVector metric func (av AccessVector) Value() float64 { if v, ok := accessVectorValueMap[av]; ok { return v @@ -51,22 +51,9 @@ func (av AccessVector) Value() float64 { return 0.0 } -//IsDefined returns false if undefined result value of metric +// IsDefined returns false if undefined result value of metric func (av AccessVector) IsDefined() bool { return av != AccessVectorUnknown } -/* Copyright 2018 Spiegel - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +/* Copyright 2022 luxifer */ diff --git a/v2/base/metric-c.go b/v2/base/metric-c.go index c60b28f..9edf7fc 100644 --- a/v2/base/metric-c.go +++ b/v2/base/metric-c.go @@ -2,10 +2,10 @@ package base import "strings" -//ConfidentialityImpact is metric type for Base Metrics +// ConfidentialityImpact is metric type for Base Metrics type ConfidentialityImpact int -//Constant of ConfidentialityImpact result +// Constant of ConfidentialityImpact result const ( ConfidentialityImpactUnknown ConfidentialityImpact = iota ConfidentialityImpactNone @@ -25,7 +25,7 @@ var confidentialityImpactValueMap = map[ConfidentialityImpact]float64{ ConfidentialityImpactComplete: 0.66, } -//GetConfidentialityImpact returns result of ConfidentialityImpact metric +// GetConfidentialityImpact returns result of ConfidentialityImpact metric func GetConfidentialityImpact(s string) ConfidentialityImpact { s = strings.ToUpper(s) for k, v := range confidentialityImpactMap { @@ -43,7 +43,7 @@ func (ci ConfidentialityImpact) String() string { return "" } -//Value returns value of ConfidentialityImpact metric +// Value returns value of ConfidentialityImpact metric func (ci ConfidentialityImpact) Value() float64 { if v, ok := confidentialityImpactValueMap[ci]; ok { return v @@ -51,22 +51,9 @@ func (ci ConfidentialityImpact) Value() float64 { return 0.0 } -//IsDefined returns false if undefined result value of metric +// IsDefined returns false if undefined result value of metric func (ci ConfidentialityImpact) IsDefined() bool { return ci != ConfidentialityImpactUnknown } -/* Copyright 2018 Spiegel - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +/* Copyright 2022 luxifer */ diff --git a/v2/base/metric-i.go b/v2/base/metric-i.go index f057f70..d757397 100644 --- a/v2/base/metric-i.go +++ b/v2/base/metric-i.go @@ -2,10 +2,10 @@ package base import "strings" -//IntegrityImpact is metric type for Base Metrics +// IntegrityImpact is metric type for Base Metrics type IntegrityImpact int -//Constant of IntegrityImpact result +// Constant of IntegrityImpact result const ( IntegrityImpactUnknown IntegrityImpact = iota IntegrityImpactNone @@ -25,7 +25,7 @@ var integrityImpactValueMap = map[IntegrityImpact]float64{ IntegrityImpactComplete: 0.66, } -//GetIntegrityImpact returns result of IntegrityImpact metric +// GetIntegrityImpact returns result of IntegrityImpact metric func GetIntegrityImpact(s string) IntegrityImpact { s = strings.ToUpper(s) for k, v := range integrityImpactMap { @@ -43,7 +43,7 @@ func (ii IntegrityImpact) String() string { return "" } -//Value returns value of IntegrityImpact metric +// Value returns value of IntegrityImpact metric func (ii IntegrityImpact) Value() float64 { if v, ok := integrityImpactValueMap[ii]; ok { return v @@ -51,22 +51,9 @@ func (ii IntegrityImpact) Value() float64 { return 0.0 } -//IsDefined returns false if undefined result value of metric +// IsDefined returns false if undefined result value of metric func (ii IntegrityImpact) IsDefined() bool { return ii != IntegrityImpactUnknown } -/* Copyright 2018 Spiegel - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +/* Copyright 2022 luxifer */ diff --git a/v2/base/metrics-e.go b/v2/base/metrics-e.go index bb2ae0e..9270e40 100644 --- a/v2/base/metrics-e.go +++ b/v2/base/metrics-e.go @@ -2,10 +2,10 @@ package base import "strings" -//Exploitability is metric type for Temporal Metrics +// Exploitability is metric type for Temporal Metrics type Exploitability int -//Constant of Exploitability result +// Constant of Exploitability result const ( ExploitabilityNotDefined Exploitability = iota ExploitabilityUnproven @@ -30,7 +30,7 @@ var exploitabilityValueMap = map[Exploitability]float64{ ExploitabilityHigh: 1, } -//GetExploitability returns result of Exploitability metric +// GetExploitability returns result of Exploitability metric func GetExploitability(s string) Exploitability { s = strings.ToUpper(s) for k, v := range exploitabilityMap { @@ -48,7 +48,7 @@ func (ai Exploitability) String() string { return "" } -//Value returns value of Exploitability metric +// Value returns value of Exploitability metric func (ai Exploitability) Value() float64 { if v, ok := exploitabilityValueMap[ai]; ok { return v @@ -56,7 +56,9 @@ func (ai Exploitability) Value() float64 { return 1 } -//IsDefined returns false if undefined result value of metric +// IsDefined returns false if undefined result value of metric func (ai Exploitability) IsDefined() bool { return ai != ExploitabilityNotDefined } + +/* Copyright 2022 luxifer */ diff --git a/v2/base/metrics-rc.go b/v2/base/metrics-rc.go index 4776d11..8b9f61f 100644 --- a/v2/base/metrics-rc.go +++ b/v2/base/metrics-rc.go @@ -2,10 +2,10 @@ package base import "strings" -//ReportConfidence is metric type for Temporal Metrics +// ReportConfidence is metric type for Temporal Metrics type ReportConfidence int -//Constant of ReportConfidence result +// Constant of ReportConfidence result const ( ReportConfidenceNotDefined ReportConfidence = iota ReportConfidenceUnconfirmed @@ -27,7 +27,7 @@ var reportConfidenceValueMap = map[ReportConfidence]float64{ ReportConfidenceConfirmed: 1, } -//GetReportConfidence returns result of ReportConfidence metric +// GetReportConfidence returns result of ReportConfidence metric func GetReportConfidence(s string) ReportConfidence { s = strings.ToUpper(s) for k, v := range reportConfidenceMap { @@ -45,7 +45,7 @@ func (ai ReportConfidence) String() string { return "" } -//Value returns value of ReportConfidence metric +// Value returns value of ReportConfidence metric func (ai ReportConfidence) Value() float64 { if v, ok := reportConfidenceValueMap[ai]; ok { return v @@ -53,7 +53,9 @@ func (ai ReportConfidence) Value() float64 { return 1 } -//IsDefined returns false if undefined result value of metric +// IsDefined returns false if undefined result value of metric func (ai ReportConfidence) IsDefined() bool { return ai != ReportConfidenceNotDefined } + +/* Copyright 2022 luxifer */ diff --git a/v2/base/metrics-rl.go b/v2/base/metrics-rl.go index c26d77b..5478f72 100644 --- a/v2/base/metrics-rl.go +++ b/v2/base/metrics-rl.go @@ -2,10 +2,10 @@ package base import "strings" -//RemediationLevel is metric type for Temporal Metrics +// RemediationLevel is metric type for Temporal Metrics type RemediationLevel int -//Constant of RemediationLevel result +// Constant of RemediationLevel result const ( RemediationLevelNotDefined RemediationLevel = iota RemediationLevelOfficialFix @@ -30,7 +30,7 @@ var remediationLevelValueMap = map[RemediationLevel]float64{ RemediationLevelUnavailable: 1, } -//GetRemediationLevel returns result of RemediationLevel metric +// GetRemediationLevel returns result of RemediationLevel metric func GetRemediationLevel(s string) RemediationLevel { s = strings.ToUpper(s) for k, v := range remediationLevelMap { @@ -48,7 +48,7 @@ func (ai RemediationLevel) String() string { return "" } -//Value returns value of RemediationLevel metric +// Value returns value of RemediationLevel metric func (ai RemediationLevel) Value() float64 { if v, ok := remediationLevelValueMap[ai]; ok { return v @@ -56,7 +56,9 @@ func (ai RemediationLevel) Value() float64 { return 1 } -//IsDefined returns false if undefined result value of metric +// IsDefined returns false if undefined result value of metric func (ai RemediationLevel) IsDefined() bool { return ai != RemediationLevelNotDefined } + +/* Copyright 2022 luxifer */ diff --git a/v2/base/severity.go b/v2/base/severity.go index b9fc92c..a8bacf8 100644 --- a/v2/base/severity.go +++ b/v2/base/severity.go @@ -1,9 +1,9 @@ package base -//Severity is severity for Base Metrics +// Severity is severity for Base Metrics type Severity int -//Constant of severity +// Constant of severity const ( SeverityUnknown Severity = iota SeverityLow @@ -11,17 +11,4 @@ const ( SeverityHigh ) -/* Copyright 2018 Spiegel - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +/* Copyright 2022 luxifer */ diff --git a/v2/cvss.go b/v2/cvss.go index 8e925ab..efbadfb 100644 --- a/v2/cvss.go +++ b/v2/cvss.go @@ -22,17 +22,4 @@ func (c *CVSS) ImportBaseVector(v string) error { return nil } -/* Copyright 2018 Spiegel - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +/* Copyright 2022 luxifer */