From dd5a7920e58b73fbfed4ad231a776cab6602de01 Mon Sep 17 00:00:00 2001 From: Kota Kanbe Date: Tue, 9 May 2017 21:52:14 +0900 Subject: [PATCH] Add JSON Version --- models/models.go | 19 +++++++++++-------- scan/base.go | 1 + 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/models/models.go b/models/models.go index 92f1db54..5efc7028 100644 --- a/models/models.go +++ b/models/models.go @@ -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 diff --git a/scan/base.go b/scan/base.go index 8c8472ff..ba4dfe6d 100644 --- a/scan/base.go +++ b/scan/base.go @@ -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,