add Library Scan (with image scan) (#829)

* add static container image scan

* server has many staticContainers

* use go module

* for staticContainer

* fix typo

* fix setErrs error

* change name : StaticContainer -> Image

* add scan -images-only flag

* fix makefile

* fix makefile for go module

* use rpmcmd instead of rpm

* add scrutinizer.yml

* change scrutinizer.yml

* fix scrutinizer.yml

* fix scrutinizer.yml

* fix scrutinizer.yml

* fix scrutinizer.yml

* delete scrutinizer

* add report test

* add sourcePackages and Arch

* fix for sider

* fix staticContainer -> image

* init scan library

* add library scan for servers

* fix tui bug

* fix lint error

* divide WpPackageFixStats and LibraryPackageFixedIns

* fix error

* Delete libManager_test.go

* stop use alpine os if err occurred in container

* merge upstream/master

* Delete libManager.go

* update goval-dictionary

* fix go.mod

* update Readme

* add feature : auto detect lockfiles
This commit is contained in:
Tomoya Amachi
2019-06-12 18:50:07 +09:00
committed by Kota Kanbe
parent 10942f7c08
commit abcea1a14d
22 changed files with 1531 additions and 1161 deletions

View File

@@ -19,6 +19,8 @@ package models
import (
"time"
"github.com/knqyf263/trivy/pkg/vulnsrc/vulnerability"
)
// CveContents has CveContent
@@ -226,7 +228,7 @@ func NewCveContentType(name string) CveContentType {
return Oracle
case "ubuntu":
return Ubuntu
case "debian":
case "debian", vulnerability.DebianOVAL:
return Debian
case "redhat_api":
return RedHatAPI
@@ -238,6 +240,16 @@ func NewCveContentType(name string) CveContentType {
return WPVulnDB
case "amazon":
return Amazon
case vulnerability.NodejsSecurityWg:
return NodeSec
case vulnerability.PythonSafetyDB:
return PythonSec
case vulnerability.RustSec:
return RustSec
case vulnerability.PhpSecurityAdvisories:
return PhpSec
case vulnerability.RubySec:
return RubySec
default:
return Unknown
}
@@ -283,6 +295,21 @@ const (
// WPVulnDB is WordPress
WPVulnDB CveContentType = "wpvulndb"
// NodeSec : for JS
NodeSec CveContentType = "node"
// PythonSec : for PHP
PythonSec CveContentType = "python"
// PhpSec : for PHP
PhpSec CveContentType = "php"
// RubySec : for Ruby
RubySec CveContentType = "ruby"
// RustSec : for Rust
RustSec CveContentType = "rust"
// Unknown is Unknown
Unknown CveContentType = "unknown"
)
@@ -303,6 +330,11 @@ var AllCveContetTypes = CveContentTypes{
SUSE,
DebianSecurityTracker,
WPVulnDB,
NodeSec,
PythonSec,
PhpSec,
RubySec,
RustSec,
}
// Except returns CveContentTypes except for given args