Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

Convert CSAF to OSV with examples #1

Merged
merged 10 commits into from
Aug 26, 2024

Conversation

jasinner
Copy link
Contributor

@jasinner jasinner commented Aug 16, 2024

Parse Red Hat CSAF documents which are specific to a product and convert them to OSV format.

This will be used to convert Red Hat CSAF documents to OSV data hosted in a new location on Red Hat infrastructure.

This consolidates multiple vulnerabilities in an advisory to one OSV record for a Red Hat RPM based product. A severity for the OSV record is calculated by finding the highest CVSSv3 score of the fixed vulnerabilities. We only support RPM based products at this time because we expect a scanning tool using this data to utilize RPM schemantics to compare versions installed on Red Hat systems or containers with the fixed versions used in the OSV record.

It also consolidates references in the CSAF documents References section with references in the CSAF Vulnerabilities section to create a combined and deduplicated OSV record set of references.

Copy link
Owner

@andrewpollock andrewpollock left a comment

Choose a reason for hiding this comment

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

I started reviewing, then noticed you were pushing more commits, so thought I'd pause in case this is in flux. If that's the case, feel free to switch this to Draft until you're ready for me to review it completely, or I can do a review in pieces.

rhel_osv/csaf.py Show resolved Hide resolved
rhel_osv/csaf.py Outdated Show resolved Hide resolved
rhel_osv/csaf.py Outdated Show resolved Hide resolved
rhel_osv/csaf.py Outdated Show resolved Hide resolved
@jasinner jasinner marked this pull request as draft August 19, 2024 01:47
@jasinner jasinner force-pushed the cpe-suffix branch 2 times, most recently from 31818b8 to e5bd133 Compare August 19, 2024 05:51
@jasinner jasinner changed the title Adjust ecosystem to use CPEs Convert CSAF to OSV with examples Aug 19, 2024
rhel_osv/osv.py Outdated Show resolved Hide resolved
@jasinner jasinner marked this pull request as ready for review August 21, 2024 00:32
@jasinner
Copy link
Contributor Author

Once this is ready I can do a PR to ossf/osv-schema tools

Copy link
Owner

@andrewpollock andrewpollock left a comment

Choose a reason for hiding this comment

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

This is looking pretty good!

rhel_osv/csaf.py Outdated Show resolved Hide resolved
rhel_osv/csaf.py Outdated Show resolved Hide resolved
rhel_osv/csaf.py Outdated Show resolved Hide resolved
rhel_osv/osv.py Outdated Show resolved Hide resolved
csaf_converter.py Outdated Show resolved Hide resolved
csaf_converter.py Show resolved Hide resolved
Copy link
Owner

@andrewpollock andrewpollock left a comment

Choose a reason for hiding this comment

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

LGTM, with one thing about the ID prefix. Beautiful code, thanks for bearing with me on the review. I think this should be pretty readable and maintainable going forward and could potentially be contributed to the OSV-Schema repo.

rhel_osv/osv.py Outdated Show resolved Hide resolved
rhel_osv/osv.py Outdated Show resolved Hide resolved
Copy link
Owner

@andrewpollock andrewpollock left a comment

Choose a reason for hiding this comment

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

LGTM. Are you happy for me to merge this?

README.md Show resolved Hide resolved
README.md Show resolved Hide resolved
rhel_osv/csaf.py Outdated Show resolved Hide resolved
rhel_osv/osv.py Outdated Show resolved Hide resolved
schema-v1.6.3.json Outdated Show resolved Hide resolved
@jasinner
Copy link
Contributor Author

LGTM. Are you happy for me to merge this?

Yes, let's merge it

@andrewpollock andrewpollock merged commit c04804b into andrewpollock:main Aug 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants