Add JSON Version

This commit is contained in:
Kota Kanbe
2017-05-09 21:52:14 +09:00
committed by kota kanbe
parent cfb848918f
commit dd5a7920e5
2 changed files with 12 additions and 8 deletions

View File

@@ -26,6 +26,9 @@ import (
cvedict "github.com/kotakanbe/go-cve-dictionary/models"
)
// JSONVersion is JSON Version
const JSONVersion = "0.3.0"
// ScanResults is slice of ScanResult.
type ScanResults []ScanResult
@@ -50,14 +53,14 @@ type ScanResults []ScanResult
// ScanResult has the result of scanned CVE information.
type ScanResult struct {
ScannedAt time.Time
Lang string
ServerName string // TOML Section key
Family string
Release string
Container Container
Platform Platform
ScannedAt time.Time
JSONVersion string
Lang string
ServerName string // TOML Section key
Family string
Release string
Container Container
Platform Platform
// Scanned Vulns by SSH scan + CPE + OVAL
ScannedCves VulnInfos

View File

@@ -298,6 +298,7 @@ func (l *base) convertToModel() models.ScanResult {
// }
return models.ScanResult{
JSONVersion: models.JSONVersion,
ServerName: l.ServerInfo.ServerName,
ScannedAt: time.Now(),
Family: l.Distro.Family,