Remove commented out code
This commit is contained in:
@@ -58,7 +58,5 @@ func Parse(path string) ([]string, error) {
|
||||
}
|
||||
}
|
||||
}
|
||||
//TODO remove
|
||||
// sort.Strings(cpes)
|
||||
return cpes, nil
|
||||
}
|
||||
|
||||
@@ -131,7 +131,6 @@ func (v CveContents) Cvss2Scores() (values []CveContentCvss) {
|
||||
|
||||
// MaxCvss2Score returns Max CVSS V2 Score
|
||||
func (v CveContents) MaxCvss2Score() CveContentCvss {
|
||||
//TODO Severity Ubuntu, Debian...
|
||||
order := []CveContentType{NVD, RedHat, JVN}
|
||||
max := 0.0
|
||||
value := CveContentCvss{
|
||||
|
||||
@@ -127,9 +127,6 @@ func (api cvedictClient) FetchCveDetails(cveIDs []string) (cveDetails cve.CveDet
|
||||
return []cve.CveDetail{},
|
||||
fmt.Errorf("Failed to fetch CVE. err: %v", errs)
|
||||
}
|
||||
|
||||
//TODO
|
||||
// sort.Sort(cveDetails)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -156,10 +153,6 @@ func (api cvedictClient) FetchCveDetailsFromCveDB(cveIDs []string) (cveDetails c
|
||||
cveDetails = append(cveDetails, cveDetail)
|
||||
}
|
||||
}
|
||||
|
||||
//TODO
|
||||
// order by CVE ID desc
|
||||
// sort.Sort(cveDetails)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -136,13 +136,6 @@ func fillCveDetail(r *models.ScanResult) error {
|
||||
}
|
||||
}
|
||||
}
|
||||
//TODO Remove
|
||||
// sort.Slice(r.ScannedCves, func(i, j int) bool {
|
||||
// if r.ScannedCves[j].CveContents.CvssV2Score() == r.ScannedCves[i].CveContents.CvssV2Score() {
|
||||
// return r.ScannedCves[j].CveContents.CvssV2Score() < r.ScannedCves[i].CveContents.CvssV2Score()
|
||||
// }
|
||||
// return r.ScannedCves[j].CveContents.CvssV2Score() < r.ScannedCves[i].CveContents.CvssV2Score()
|
||||
// })
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -237,91 +237,6 @@ func formatFullPlainText(r models.ScanResult) string {
|
||||
return fmt.Sprintf("%s\n%s", header, table)
|
||||
}
|
||||
|
||||
// type distroLink struct {
|
||||
// title string
|
||||
// url string
|
||||
// }
|
||||
|
||||
// distroLinks add Vendor URL of the CVE to table
|
||||
// func distroLinks(cveInfo models.CveInfo, osFamily string) []distroLink {
|
||||
// cveID := cveInfo.VulnInfo.CveID
|
||||
// switch osFamily {
|
||||
// case "rhel", "centos":
|
||||
// links := []distroLink{
|
||||
// {
|
||||
// "RHEL-CVE",
|
||||
// fmt.Sprintf("%s/%s", redhatSecurityBaseURL, cveID),
|
||||
// },
|
||||
// }
|
||||
// for _, advisory := range cveInfo.DistroAdvisories {
|
||||
// aidURL := strings.Replace(advisory.AdvisoryID, ":", "-", -1)
|
||||
// links = append(links, distroLink{
|
||||
// // "RHEL-errata",
|
||||
// advisory.AdvisoryID,
|
||||
// fmt.Sprintf(redhatRHSABaseBaseURL, aidURL),
|
||||
// })
|
||||
// }
|
||||
// return links
|
||||
// case "oraclelinux":
|
||||
// links := []distroLink{
|
||||
// {
|
||||
// "Oracle-CVE",
|
||||
// fmt.Sprintf(oracleSecurityBaseURL, cveID),
|
||||
// },
|
||||
// }
|
||||
// for _, advisory := range cveInfo.DistroAdvisories {
|
||||
// links = append(links, distroLink{
|
||||
// // "Oracle-ELSA"
|
||||
// advisory.AdvisoryID,
|
||||
// fmt.Sprintf(oracleELSABaseBaseURL, advisory.AdvisoryID),
|
||||
// })
|
||||
// }
|
||||
// return links
|
||||
// case "amazon":
|
||||
// links := []distroLink{
|
||||
// {
|
||||
// "RHEL-CVE",
|
||||
// fmt.Sprintf("%s/%s", redhatSecurityBaseURL, cveID),
|
||||
// },
|
||||
// }
|
||||
// for _, advisory := range cveInfo.DistroAdvisories {
|
||||
// links = append(links, distroLink{
|
||||
// // "Amazon-ALAS",
|
||||
// advisory.AdvisoryID,
|
||||
// fmt.Sprintf(amazonSecurityBaseURL, advisory.AdvisoryID),
|
||||
// })
|
||||
// }
|
||||
// return links
|
||||
// case "ubuntu":
|
||||
// return []distroLink{
|
||||
// {
|
||||
// "Ubuntu-CVE",
|
||||
// fmt.Sprintf("%s/%s", ubuntuSecurityBaseURL, cveID),
|
||||
// },
|
||||
// //TODO Ubuntu USN
|
||||
// }
|
||||
// case "debian":
|
||||
// return []distroLink{
|
||||
// {
|
||||
// "Debian-CVE",
|
||||
// fmt.Sprintf("%s/%s", debianTrackerBaseURL, cveID),
|
||||
// },
|
||||
// // TODO Debian dsa
|
||||
// }
|
||||
// case "FreeBSD":
|
||||
// links := []distroLink{}
|
||||
// for _, advisory := range cveInfo.DistroAdvisories {
|
||||
// links = append(links, distroLink{
|
||||
// "FreeBSD-VuXML",
|
||||
// fmt.Sprintf(freeBSDVuXMLBaseURL, advisory.AdvisoryID),
|
||||
// })
|
||||
// }
|
||||
// return links
|
||||
// default:
|
||||
// return []distroLink{}
|
||||
// }
|
||||
// }
|
||||
|
||||
func cweURL(cweID string) string {
|
||||
return fmt.Sprintf("https://cwe.mitre.org/data/definitions/%s.html",
|
||||
strings.TrimPrefix(cweID, "CWE-"))
|
||||
|
||||
18
util/util.go
18
util/util.go
@@ -147,21 +147,3 @@ func Distinct(ss []string) (distincted []string) {
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// VendorLink returns a URL of the given OS family and CVEID
|
||||
//TODO
|
||||
// func VendorLink(family, cveID string) string {
|
||||
// cType := models.NewCveContentType(family)
|
||||
// switch cType {
|
||||
// case models.RedHat:
|
||||
// return "https://access.redhat.com/security/cve/" + cveID
|
||||
// case models.Debian:
|
||||
// return "https://security-tracker.debian.org/tracker/" + cveID
|
||||
// case models.Ubuntu:
|
||||
// return "http://people.ubuntu.com/~ubuntu-security/cve/" + cveID
|
||||
// // case models.FreeBSD:
|
||||
// // return "http://people.ubuntu.com/~ubuntu-security/cve/" + cveID
|
||||
// }
|
||||
|
||||
// return ""
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user