Add local scan mode.

If the scan target server is localhost, Don't use SSH. #210
This commit is contained in:
Kota Kanbe
2017-01-12 16:35:11 +09:00
parent 910385b084
commit 20275a1063
18 changed files with 1857 additions and 207 deletions

View File

@@ -30,8 +30,8 @@ type StdoutWriter struct{}
// WriteScanSummary prints Scan summary at the end of scan
func (w StdoutWriter) WriteScanSummary(rs ...models.ScanResult) {
fmt.Printf("\n\n")
fmt.Printf("Scan Summary\n")
fmt.Printf("============\n")
fmt.Println("One Line Summary")
fmt.Println("================")
fmt.Printf("%s\n", toScanSummary(rs...))
}

View File

@@ -35,7 +35,7 @@ func toScanSummary(rs ...models.ScanResult) string {
table.Wrap = true
for _, r := range rs {
cols := []interface{}{
r.ServerName,
r.FormatServerName(),
fmt.Sprintf("%s%s", r.Family, r.Release),
fmt.Sprintf("%d CVEs", len(r.ScannedCves)),
r.Packages.ToUpdatablePacksSummary(),
@@ -51,7 +51,7 @@ func toOneLineSummary(rs ...models.ScanResult) string {
table.Wrap = true
for _, r := range rs {
cols := []interface{}{
r.ServerName,
r.FormatServerName(),
r.CveSummary(),
r.Packages.ToUpdatablePacksSummary(),
}