Giter VIP home page Giter VIP logo

Comments (12)

fnxpt avatar fnxpt commented on July 2, 2024 2

Ok I confirm its not working as expected, I will try to debug it later today

from dependency-track.

nscuro avatar nscuro commented on July 2, 2024

cc @fnxpt

@sec-p24 Can you please share the version of Trivy you're using? Also sharing the exact SBOM you're uploading could help in reproducing this.

from dependency-track.

sec-p24 avatar sec-p24 commented on July 2, 2024

My current production setup uses Trivy v0.49.1 to generate SBOM and Trivy v0.51.1 in server mode.
However I tested the same locally with both Trivy's v0.51.1 and the issue remains the same. I am attaching 2 SBOMs - one straight after it was generated with Trivy and the other one downloaded from Dependency Track UI (Download BOM -> Inventory).

After performing few additional tests I have noticed that when I access the Trivy server directly (through Trivy SBOM command, ommiting dtrack) then sometimes it parses the dtrack-proccessed SBOM file correctly, while other times it does not (like 50/50). When I upload the same file through Dependency Track, then it always fails it's assessment.

dt-processed-sbom.json
raw-trivy-sbom.json

from dependency-track.

fnxpt avatar fnxpt commented on July 2, 2024

When I try to run the sbom locally on trivy I get this.

Screenshot 2024-05-16 at 16 22 50

from dependency-track.

sec-p24 avatar sec-p24 commented on July 2, 2024

Trivy client logs:

$ trivy sbom --server http://localhost:7070 raw-trivy-sbom.json
2024-05-16T16:25:12.145+0200    INFO    Vulnerability scanning is enabled
2024-05-16T16:25:12.147+0200    INFO    Detected SBOM format: cyclonedx-json
2024-05-16T16:25:12.203+0200    WARN    This OS version is no longer supported by the distribution: alpine 3.12.0
2024-05-16T16:25:12.203+0200    WARN    The vulnerability detection may be insufficient because security updates are not provided

Trivy server logs:

$ docker run -p 7070:7070 aquasec/trivy:0.51.1 server --listen 0.0.0.0:7070
2024-05-16T14:25:01Z    INFO    Need to update DB
2024-05-16T14:25:01Z    INFO    Downloading DB...       repository="ghcr.io/aquasecurity/trivy-db:2"
2024-05-16T14:25:08Z    INFO    Listening 0.0.0.0:7070...
2024-05-16T14:25:12Z    INFO    Detected OS     family="alpine" version="3.12.0"
2024-05-16T14:25:12Z    INFO    [alpine] Detecting vulnerabilities...   os_version="3.12" repository="" pkg_num=31
2024-05-16T14:25:12Z    INFO    Number of language-specific files       num=0

from dependency-track.

fnxpt avatar fnxpt commented on July 2, 2024

Generated a new sbom for that image using trivy and it worked

Screenshot 2024-05-16 at 16 41 55

from dependency-track.

sec-p24 avatar sec-p24 commented on July 2, 2024

When I generated the SBOM for the same image as you did, uploading the file directly to Trivy server yielded different results than when it was uploaded to Dependency Track.
dtrack
trivy
trivy_server_logs

from dependency-track.

fnxpt avatar fnxpt commented on July 2, 2024

Do you see the requests from DT arriving to trivy?
With the image you mentioned yesterday I was able to get some result... not all of them (i will check why)... but Im getting results

Screenshot 2024-05-17 at 12 07 34

from dependency-track.

sec-p24 avatar sec-p24 commented on July 2, 2024

Few things to clarify.

  1. In my initial comment I generated SBOM for php:7.4.10-fpm-alpine docker image, not the trivy image itself.
  2. The from Trivy (see last screenshot from my previous message) suggest SBOM arrive correctly there. The same goes for Dependency Track API logs which suggest successful analysis:
2024-05-17 10:08:15,600 INFO [TrivyAnalysisTask] Starting Trivy vulnerability analysis task
2024-05-17 10:08:15,813 INFO [TrivyAnalysisTask] Trivy vulnerability analysis complete

If there is a better way to confirm the arrival, please let me know.
3. Anyway, notice that you are getting results from language-based component only, but not OS-related packages. Looks like the issue might with OS detection on Trivy side when the SBOM is passed from DT.

from dependency-track.

fnxpt avatar fnxpt commented on July 2, 2024

I think I found the issue, just need to do some testing...

from dependency-track.

fnxpt avatar fnxpt commented on July 2, 2024

@sec-p24 Issue fixed, PR is failing due to issues with dependencies
@nscuro any ideia what could be the issue, i saw in the logs that there were a few changes on the dependencies 2 days ago

for the php:7.4.10-fpm-alpine
Screenshot 2024-05-17 at 17 39 47

for the aquasec/trivy:0.51.1
Screenshot 2024-05-17 at 17 36 30

from dependency-track.

nscuro avatar nscuro commented on July 2, 2024

@fnxpt The build failures are related to #3726 and the corresponding changes in Alpine. I'll get that PR merged, then your build should pass.

from dependency-track.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.