Releases: goark/go-cvss
Releases · goark/go-cvss
v1.6.7
What's Changed
- docs: fix typo in README.md by @bernhardreiter in #38
- Bump up external packages by @spiegel-im-spiegel in #39
New Contributors
- @bernhardreiter made their first contribution in #38
Full Changelog: v1.6.6...v1.6.7
v1.6.6
What's Changed
- Fixed bug of Calculation of CVSSv2 Environmental score (issue #33) by @spiegel-im-spiegel in #36
Full Changelog: v1.6.5...v1.6.6
v1.6.5
What's Changed
- Adjusted calculation error of CVSSv2 Base score (issue #33) by @spiegel-im-spiegel in #35
Full Changelog: v1.6.4...v1.6.5
v1.6.4
What's Changed
- Fixed issue #31 and #33 by @spiegel-im-spiegel in #34
Full Changelog: v1.6.3...v1.6.4
v1.6.3
What's Changed
- Fixed that no error when misordered CVSSv2 vector string (issue #31) by @spiegel-im-spiegel in #32
Full Changelog: v1.6.2...v1.6.3
v1.6.2
What's Changed
- Fix encode CVSSv2 vector string when skip Temporal or Environmental (issue #28) by @spiegel-im-spiegel in #30
package main
import (
"fmt"
"github.com/goark/go-cvss/v2/metric"
)
func main() {
testcase := []struct {
name string
vector string
}{
// CVE-2003-0062 (cf. https://www.first.org/cvss/v2/guide 3.3.3)
{name: "full metrics", vector: "AV:L/AC:H/Au:N/C:C/I:C/A:C/E:POC/RL:OF/RC:C/CDP:H/TD:H/CR:M/IR:M/AR:M"},
{name: "Base only", vector: "AV:L/AC:H/Au:N/C:C/I:C/A:C"},
{name: "skip Environmental", vector: "AV:L/AC:H/Au:N/C:C/I:C/A:C/E:POC/RL:OF/RC:C"},
{name: "skip Temporal", vector: "AV:L/AC:H/Au:N/C:C/I:C/A:C/CDP:H/TD:H/CR:M/IR:M/AR:M"},
}
for _, tc := range testcase {
fmt.Println(tc.name)
vec, err := metric.NewEnvironmental().Decode(tc.vector)
fmt.Printf("\t-> vector: %v\n", vec)
fmt.Printf("\t-> err: %v\n", err)
fmt.Printf("\t-> Severity: %v (%v)\n", vec.Severity(), vec.Score())
}
}
Output (https://go.dev/play/p/3ZiGMPBxNY0):
full metrics
-> vector: AV:L/AC:H/Au:N/C:C/I:C/A:C/E:POC/RL:OF/RC:C/CDP:H/TD:H/CR:M/IR:M/AR:M
-> err: <nil>
-> Severity: High (7.5)
Base only
-> vector: AV:L/AC:H/Au:N/C:C/I:C/A:C
-> err: <nil>
-> Severity: Medium (6.2)
skip Environmental
-> vector: AV:L/AC:H/Au:N/C:C/I:C/A:C/E:POC/RL:OF/RC:C
-> err: <nil>
-> Severity: Medium (4.9)
skip Temporal
-> vector: AV:L/AC:H/Au:N/C:C/I:C/A:C/CDP:H/TD:H/CR:M/IR:M/AR:M
-> err: <nil>
-> Severity: High (8.1)
Full Changelog: v1.6.1...v1.6.2
v1.6.1
What's Changed
- Fixed error code if metric.*.Decode method is error (issue #28) by @spiegel-im-spiegel in #29
package main
import (
"errors"
"fmt"
"github.com/goark/go-cvss/cvsserr"
"github.com/goark/go-cvss/v2/metric"
)
func main() {
raw := "AV:N/AC:L/Au:N/C:N/I:N/A:C/E:F/RL:OF/RC:C"
vec, err := metric.NewEnvironmental().Decode(raw)
fmt.Printf("err: %v\n", err)
fmt.Printf("vector: %v\n", vec)
switch true {
case errors.Is(err, cvsserr.ErrNoEnvironmentalMetrics):
fmt.Printf("Severity (Temporal): %v (%v)\n", vec.Temporal.Severity(), vec.Temporal.Score())
case errors.Is(err, cvsserr.ErrNoTemporalMetrics):
fmt.Printf("Severity (Base): %v (%v)\n", vec.Base.Severity(), vec.Base.Score())
default:
fmt.Printf("Severity (Environmental): %v (%v)\n", vec.Severity(), vec.Score())
}
}
Full Changelog: v1.6.0...v1.6.1
v1.6.0
What's Changed
- Fixed *.Decode method when not enough metrics (issue ##26) by @spiegel-im-spiegel in #27
Full Changelog: v1.5.0...v1.6.0
v1.5.0
What's Changed
- Migrated v2/base to v2/metric package by @spiegel-im-spiegel in #25
Full Changelog: v1.4.6...v1.5.0
v1.4.6
What's Changed
- Fixd Metrics.Encode method when value of metric is "ND" (issue #23) by @spiegel-im-spiegel in #24
Full Changelog: v1.4.5...v1.4.6