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

Trivy output split "target" into "target" and "system" #332

Open
mrueg opened this issue Dec 16, 2019 · 5 comments
Open

Trivy output split "target" into "target" and "system" #332

mrueg opened this issue Dec 16, 2019 · 5 comments
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. priority/backlog Higher priority than priority/awaiting-more-evidence.

Comments

@mrueg
Copy link
Contributor

mrueg commented Dec 16, 2019

Target currently consists of the image name and the detected system in parentheses. This makes it harder to parse when using the json bits.

Can we split this up into two variables in the report struct?

"Target" to maintain compatibility containing the scanned image name
and a new variable "system" or "operating_system" with the detected system that was in parentheses.

@mrueg mrueg added the kind/deprecation Categorizes issue or PR as related to a feature/enhancement marked for deprecation. label Dec 16, 2019
@knqyf263
Copy link
Collaborator

It sounds a nice idea. Also, we need to think of application dependencies such as Gemfile.lock and package-lock.json.

@mrueg
Copy link
Contributor Author

mrueg commented Dec 17, 2019

Or maybe the other way around, keep target and add an imagename to the struct?

@knqyf263
Copy link
Collaborator

knqyf263 commented Dec 19, 2019

In that case, you can't get an OS name. Does it work for you?

@mrueg
Copy link
Contributor Author

mrueg commented Dec 19, 2019

I'm trying to map something to the keys specified in Gitlab's container scanning report json - vulnerabilities[].location.operating_system The operating system that contains the vulnerable package.
and
vulnerabilities[].location.image | The Docker image that was analyzed. Optional.

Target seems to contain both.

An Image key from trivy could map easily to .image.
The Target key could provide info on the Operating System, Language-level Package Manager, etc.

See:
https://docs.gitlab.com/ee/user/application_security/container_scanning/#reports-json-format

@heidemn
Copy link

heidemn commented Feb 1, 2020

What about something like the following.
(Optionally, TargetType + TargetSubType could be merged.)

// Target = Debian packages in Ubuntu image
TargetImage:    "repo.org/image:1.2.3",
TargetType:     "OS",
TargetSubType:  "dpkg",
TargetOS:       "ubuntu 18.04"
// Target = NPM application dependencies
TargetImage:    "repo.org/image:1.2.3",
TargetType:     "AppDependencies",
TargetSubType:  "npm",
TargetFile:     "/app/package-lock.json"

@knqyf263 knqyf263 added kind/feature Categorizes issue or PR as related to a new feature. priority/backlog Higher priority than priority/awaiting-more-evidence. and removed kind/deprecation Categorizes issue or PR as related to a feature/enhancement marked for deprecation. labels Apr 30, 2020
liamg pushed a commit that referenced this issue Jun 7, 2022
* fix(hooks): exclude go from filtering

* Limited scope to individual packages

Co-authored-by: Teppei Fukuda <[email protected]>
liamg pushed a commit that referenced this issue Jun 7, 2022
* fix(hooks): exclude go from filtering

* Limited scope to individual packages

Co-authored-by: Teppei Fukuda <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
Status: No status
Development

No branches or pull requests

4 participants