vet/pkg/common/identifier_url.go
2025-04-11 21:19:02 +00:00

19 lines
485 B
Go

package common
import (
"fmt"
"strings"
)
func GetCveReferenceURL(cve string) string {
return fmt.Sprintf("https://cve.mitre.org/cgi-bin/cvename.cgi?name=%s", cve)
}
func GetCweReferenceURL(cwe string) string {
return fmt.Sprintf("https://cwe.mitre.org/data/definitions/%s.html", strings.TrimPrefix(cwe, "CWE-")) // CWE Require only the number, ie. CWE-123 -> 123
}
func GetGhsaReferenceURL(ghsa string) string {
return fmt.Sprintf("https://github.com/advisories/%s", ghsa)
}