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

docs/vuln.json #237

Closed
wants to merge 3 commits into from
Closed

docs/vuln.json #237

wants to merge 3 commits into from

Conversation

bagder
Copy link
Member

@bagder bagder commented May 1, 2023

Generate and provide CVE information in JSON format

Sample: vuln.txt

Interested in feedback on all details of this.

@icing
Copy link

icing commented May 1, 2023

Seems to contain all relevant information. One could enhance individual records with links to the project or its general security policy. Just to be more descriptive and stand-alone.

@jamietanna
Copy link

What are your thoughts on producing these in the form of https://ossf.github.io/osv-schema/ to allow easy consumption by things like https://osv.dev ?

@dfandrich
Copy link
Collaborator

That's what I just came her to say, too. Might as well use an existing schema that tools are already written to injest.

@bagder
Copy link
Member Author

bagder commented May 1, 2023

  • fields like ecosystem and purl I don't know what to provide for
  • we can't seem to be able to provide a compatible "severity" because we don't do CVSS score and the schema doesn't allow for the basic low/medium/high/critical style we use ?!

@bagder
Copy link
Member Author

bagder commented May 1, 2023

Current look: vuln.txt

@dfandrich
Copy link
Collaborator

dfandrich commented May 1, 2023 via email

@dfandrich
Copy link
Collaborator

dfandrich commented May 1, 2023 via email

@bagder
Copy link
Member Author

bagder commented May 1, 2023

A purl is easy to create

Is it? I don't understand what we should use for curl as I don't recognize we are in any of the mentioned ecosystems.

What about just arbitrarily assigning a CVSS score for each of low/medium/high and just use those

I'll try that!

I think you want the curl vulnerability ID as the "id" field

We don't have any other id than the CVE for our vulnerabilities!

The current output also fails a JSON parser validation:

Using what validator? I loaded that version with Firefox with no problems.

Current version: vuln.txt

@dfandrich
Copy link
Collaborator

dfandrich commented May 1, 2023 via email

@bagder
Copy link
Member Author

bagder commented May 1, 2023

I was talking about IDs like adv_20161102A

They are gone since 9602930, August 2018

@bagder
Copy link
Member Author

bagder commented May 1, 2023

The latest version of curl would have a PURL of @.***_0_1

So are we always referencing the latest curl version as a "purl" in all vulnerabilities? Or is the package different in different issues? It seems weird to me, either take!

@bagder
Copy link
Member Author

bagder commented May 1, 2023

This validates with jq 1.6 for me!

@dfandrich
Copy link
Collaborator

dfandrich commented May 1, 2023 via email

@bagder
Copy link
Member Author

bagder commented May 2, 2023

Is it GitHub that replaces a lot of the content in the previous comment with asterisks? It isn't very helpful.

bagder added a commit that referenced this pull request May 2, 2023
Generate and provide CVE information in JSON format

Inspired by https://ossf.github.io/osv-schema/

Closes #237
@bagder
Copy link
Member Author

bagder commented May 2, 2023

I added a very rudimentary purl field. I can't figure out what more to add there.

@bagder
Copy link
Member Author

bagder commented May 2, 2023

This is how it looks now: vuln.txt

@dfandrich
Copy link
Collaborator

It looks like Github is censoring my e-mails. Here are the PURLs again, in order, via the web form this time:

pkg:docker/curlimages/curl@244df1c61696?arch=amd64
    pkg:github/curl/curl@curl-8_0_1
    pkg:generic/cacert@2023-04-02?download_url=https://curl.se/ca/cacert.pem
    pkg:docker/alpine@3.16.2
        pkg:apk/alpine/busybox@1.35.0-r1
        pkg:apk/alpine/musl@1.2.3-r4
        pkg:apk/alpine/zlib@1.2.13-r0
pkg:generic/busybox@1.35.0?download_url=https://busybox.net/downloads/busybox-1.35.0.tar.bz2

@bagder
Copy link
Member Author

bagder commented May 2, 2023

pkg:github/curl/curl@curl-8_0_1

This shows the problem I've tried to mention:

  1. this refers to 8.0.1, not generically "curl". When we talk about a problem that affects 100 curl versions, which of those versions should the purl identifier point to? Or should it point to the latest so that we always update all issues when we do a new release?
  2. this refers to a tag on GitHub which is not our actual releases, it's the state of the files when we generated the release - which is why I think we need to go with "generic" and not "github"

Generate and provide CVE information in JSON format

Inspired by https://ossf.github.io/osv-schema/

Closes #237
@bagder
Copy link
Member Author

bagder commented May 2, 2023

This is how it looks now vuln.txt

@bagder
Copy link
Member Author

bagder commented May 2, 2023

Now this also creates a single JSON file for every flaw, accessible by replacing .html in the URL with .json.

@bagder
Copy link
Member Author

bagder commented May 2, 2023

The plan: I will merge this and let it deploy on the site. It will give everyone a chance to test it out "live" and then we can iterate from that point to further polish it. As I am sure we can.

@bagder bagder closed this in b4a759b May 2, 2023
@bagder bagder deleted the bagder/vuln-json branch May 2, 2023 08:47
@dfandrich
Copy link
Collaborator

I looked at this part of the OSV spec and the PURL spec and I see what they're trying to do here. The ecosystem+name fields are completely redundant with the purl field (I'm guessing PURL came later so they retrofitted it in). They're using it to identify a package in a distribution without specifying a version; they're using the ranges field for the versions. It looks like the idea is for Debian to say The package pkg:deb/debian/curl is affected by a security vulnerability; these are the specific versions affected: X. Because the package needs to be unambiguously specified, they limit in the spec the type of PURLs allowed to exclude pkg:generic/X since there's no way to unambiguously specify a package with that one without also specifying a version. The spec also makes ecosystem and name mandatory fields, but without allowing any value for ecosystem that is suitable for curl. So, technically speaking, despite the name, the Open Source Vulnerability Format cannot be used for curl in a compliant manner.

I'll ask OSV about this.

@bagder
Copy link
Member Author

bagder commented May 2, 2023

I could also add that I didn't add schema_version and probably something else so our JSON objects are not fully compliant.

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.

4 participants