Skip to content

Commit

Permalink
feat(redhat): add cve URL
Browse files Browse the repository at this point in the history
  • Loading branch information
knqyf263 committed Jan 17, 2021
1 parent 2968c5b commit 6eed521
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/vulnsrc/redhat/redhat.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import (
const (
redhatDir = "redhat"
platformFormat = "Red Hat Enterprise Linux %s"

resourceURL = "https://access.redhat.com/hydra/rest/securitydata/cve/%s.json"
)

var (
Expand Down Expand Up @@ -160,16 +162,16 @@ func (vs VulnSrc) putAdvisoryDetail(tx *bolt.Tx, cve RedhatCVE) error {
func (vs VulnSrc) putVulnerabilityDetail(tx *bolt.Tx, cve RedhatCVE) error {
cvssScore, _ := strconv.ParseFloat(cve.Cvss.CvssBaseScore, 64)
cvss3Score, _ := strconv.ParseFloat(cve.Cvss3.Cvss3BaseScore, 64)

title := strings.TrimPrefix(strings.TrimSpace(cve.Bugzilla.Description), cve.Name)
references := append(cve.References, fmt.Sprintf(resourceURL, cve.Name))

vuln := types.VulnerabilityDetail{
CvssScore: cvssScore,
CvssVector: cve.Cvss.CvssScoringVector,
CvssScoreV3: cvss3Score,
CvssVectorV3: cve.Cvss3.Cvss3ScoringVector,
Severity: severityFromThreat(cve.ThreatSeverity),
References: cve.References,
References: references,
Title: strings.TrimSpace(title),
Description: strings.TrimSpace(strings.Join(cve.Details, "")),
}
Expand Down

0 comments on commit 6eed521

Please sign in to comment.