Coder Social home page Coder Social logo

Comments (6)

willmurphyscode avatar willmurphyscode commented on June 16, 2024 1

Hi @jonjohnsonjr, thanks for offering to help with this!

The code changes to make are really in Syft. Essentially, Syft should make 2 changes:

  1. The metadata Syft emits about Go packages should include what experiments are enabled, so that this information isn't lost
  2. Syft should trim the stdlib / go version to a valid semver version (remove the space and everything after.)

The definition of the Go package metadata is here: https://github.com/anchore/syft/blob/6107e5e2ad6e60f3f74ff4d3b2ca2ccffbed26ed/syft/pkg/golang.go#L4 - this definition likely needs new fields to hold information about the experiments, and then they need to be populated.

The function that scans the go binary for build info and other information is here: https://github.com/anchore/syft/blob/3023a5a7bc870f70a3dd24213d795516288ca0df/syft/pkg/cataloger/golang/scan_binary.go#L22 - I'm not certain exactly the right factoring for where we should trim the version info and capture the metadata, but this function is in the neighborhood.

Happy to discuss further! Please let me know if you have any questions.

from grype.

tgerla avatar tgerla commented on June 16, 2024

Hi @jonjohnsonjr, thanks for the report! It looks like today we take that field as-is but we need to probably parse out the flags after the X:. We might need to find a place to record those flags somewhere. We'll put this in the backlog for a fix. Let us know if you're interested in working on it and we can help get you started.

from grype.

luhring avatar luhring commented on June 16, 2024

Just adding an explicit note that this causes false negatives, too. The Go stdlib usually accounts for a large surface area in vuln-matching a Go binary, so situations where Grype doesn't take the stdlib into account would mean missing any number of vulns if Go experiments are used. Also IIUC there are worlds where using Go experiments is much more common, such as to support FIPS.

from grype.

jonjohnsonjr avatar jonjohnsonjr commented on June 16, 2024

Let us know if you're interested in working on it and we can help get you started.

I can take a stab at it if you can point me in the approximate direction 🙏

from grype.

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.