detector: Add LayerID to detect vulns (#419)

* detector/alpine: Add LayerID to detect vulns

Signed-off-by: Simarpreet Singh <simar@linux.com>

* amazon: Add LayerID to DetectedVulns

Signed-off-by: Simarpreet Singh <simar@linux.com>

* debian: Add LayerID to DetectVulns + tests

Signed-off-by: Simarpreet Singh <simar@linux.com>

* oracle: Add LayerID to DetectVulns + tests

Signed-off-by: Simarpreet Singh <simar@linux.com>

* photon: Add LayerID to DetectVulns + tests

Signed-off-by: Simarpreet Singh <simar@linux.com>

* redhat: Add LayerID to DetectVulns + tests

Signed-off-by: Simarpreet Singh <simar@linux.com>

* suse: Add LayerID to DetectVulns + tests

Signed-off-by: Simarpreet Singh <simar@linux.com>

* ubuntu: Add LayerID to DetectVulns + tests

Signed-off-by: Simarpreet Singh <simar@linux.com>

* integration: Fix integration tests to include LayerID

Signed-off-by: Simarpreet Singh <simar@linux.com>

* fix(rpc): add layer_id

* fix(rpc): insert layer_id to the struct

* fix(extractor): add cleanup function

* fix(library): add layer ID to detected vulnerabilities

* test: update mocks

* chore(mod): point to the feature branch of fanal

* mod: Point to fanal/master

Signed-off-by: Simarpreet Singh <simar@linux.com>

* scan_test: Include LayerID as part of the assertion

Signed-off-by: Simarpreet Singh <simar@linux.com>

* docker_engine_test.go: Update an error message to conform with fanal/master.

Signed-off-by: Simarpreet Singh <simar@linux.com>

Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
This commit is contained in:
Teppei Fukuda
2020-03-04 19:55:16 +02:00
committed by GitHub
parent 18b80e3781
commit aca31dffb3
69 changed files with 3565 additions and 271 deletions

View File

@@ -126,7 +126,7 @@ func TestConvertFromRpcLibraries(t *testing.T) {
tests := []struct {
name string
args args
want []ptypes.Library
want []ftypes.LibraryInfo
}{
{
name: "happy path",
@@ -136,9 +136,9 @@ func TestConvertFromRpcLibraries(t *testing.T) {
{Name: "bar", Version: "4.5.6"},
},
},
want: []ptypes.Library{
{Name: "foo", Version: "1.2.3"},
{Name: "bar", Version: "4.5.6"},
want: []ftypes.LibraryInfo{
{Library: ptypes.Library{Name: "foo", Version: "1.2.3"}},
{Library: ptypes.Library{Name: "bar", Version: "4.5.6"}},
},
},
}