Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

detector: Add LayerID to detect vulns #419

Merged
merged 18 commits into from
Mar 4, 2020

Conversation

simar7
Copy link
Member

@simar7 simar7 commented Feb 27, 2020

This PR adds LayerID info to detected vulnerabilities.

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

@simar7 simar7 requested a review from knqyf263 February 27, 2020 04:22
@simar7 simar7 self-assigned this Feb 27, 2020
Copy link
Collaborator

@knqyf263 knqyf263 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me so far. You supported only Alpine, but you need to support all of OSes such as Red Hat and Debian. Then, you need to fix integration tests.

go.mod Outdated Show resolved Hide resolved
@simar7 simar7 changed the base branch from json_cache to master February 28, 2020 00:31
@simar7 simar7 changed the base branch from master to json_cache February 28, 2020 00:31
@simar7 simar7 changed the base branch from json_cache to master February 28, 2020 00:37
Signed-off-by: Simarpreet Singh <simar@linux.com>
Signed-off-by: Simarpreet Singh <simar@linux.com>
Signed-off-by: Simarpreet Singh <simar@linux.com>
Signed-off-by: Simarpreet Singh <simar@linux.com>
Signed-off-by: Simarpreet Singh <simar@linux.com>
Signed-off-by: Simarpreet Singh <simar@linux.com>
Signed-off-by: Simarpreet Singh <simar@linux.com>
Signed-off-by: Simarpreet Singh <simar@linux.com>
@simar7 simar7 force-pushed the add-layer-id-to-detected-vulns branch from 091939a to ddfb936 Compare February 28, 2020 00:45
Signed-off-by: Simarpreet Singh <simar@linux.com>
@simar7
Copy link
Member Author

simar7 commented Feb 28, 2020

@knqyf263 the integration tests for client-server seem to be failing. I had a quick look at them and I think they might be failing because of they are using a testdata cache db, which is probably saved with vulnerability without LayerID in them. How can I re-generate that testdata db?

@knqyf263
Copy link
Collaborator

DB does not have layer ID. It should have only vulnerability information.

@knqyf263
Copy link
Collaborator

knqyf263 commented Mar 3, 2020

@simar7 I've fixed the problem.

@simar7
Copy link
Member Author

simar7 commented Mar 4, 2020

Lgtm!

@simar7 simar7 marked this pull request as ready for review March 4, 2020 15:52
simar7 added 2 commits March 4, 2020 08:27
Signed-off-by: Simarpreet Singh <simar@linux.com>
Signed-off-by: Simarpreet Singh <simar@linux.com>
…master.

Signed-off-by: Simarpreet Singh <simar@linux.com>
@simar7 simar7 requested a review from knqyf263 March 4, 2020 17:40
@knqyf263 knqyf263 merged commit aca31df into master Mar 4, 2020
@simar7 simar7 deleted the add-layer-id-to-detected-vulns branch March 4, 2020 17:55
GuaoGuao pushed a commit to GuaoGuao/trivy that referenced this pull request Jun 24, 2020
* 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>
liamg pushed a commit that referenced this pull request Jun 7, 2022
* 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>
josedonizetti pushed a commit to josedonizetti/trivy that referenced this pull request Jun 24, 2022
…rity#419)

Signed-off-by: Liam Galvin <liam.galvin@aquasec.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants