Skip to content

Conversation

@ppkarwasz
Copy link
Contributor

This change introduces the generate_openvex.py script, which converts the VEX.cyclonedx.xml file into a compliant OpenVEX JSON document.

Highlights

  • Adds a Python script to automate VEX conversion from CycloneDX format to OpenVEX.
  • Generates a fully populated OpenVEX document based on vulnerability analysis data in VEX.cyclonedx.xml.

Additional Fixes

  • Corrects a non-unique serialNumber (UUID) that was mistakenly copy-pasted from commons-bcel.
  • Removes unintended indentation from the explanation text, ensuring valid Markdown formatting.

Check list

  • I used AI to create any part of, or all of, this pull request.
  • Each commit in the pull request should have a meaningful subject line and body. Note that a maintainer may squash commits during the merge process.

This change introduces the `generate_openvex.py` script, which converts the `VEX.cyclonedx.xml` file into a compliant OpenVEX JSON document.

### Highlights

* Adds a Python script to automate VEX conversion from CycloneDX format to OpenVEX.
* Generates a fully populated OpenVEX document based on vulnerability analysis data in `VEX.cyclonedx.xml`.

### Additional Fixes

* Corrects a non-unique `serialNumber` (UUID) that was mistakenly copy-pasted from `commons-bcel`.
* Removes unintended indentation from the explanation text, ensuring valid Markdown formatting.
@@ -0,0 +1,177 @@
#!/usr/bin/env python3
Copy link
Member

Choose a reason for hiding this comment

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

Hi @ppkarwasz
This seems like a bad idea because all 20+ components will need this duplicated. It seems we should have an "empty" VEX statement for components without issues to affirm that we are OK there. We have TWO plug-ins already for this kind of housekeeping (we really should have a single one), can't we stick stuff like this in there?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Which plugin do you think would be the best?

As an alternative we can also move the VEX-es into a separate repo, where we can also store the Python scripts to generate them. What do you think? A single repo would also allow us to update VEX entries for all Commons components at once.

Copy link
Member

@garydgregory garydgregory Jul 31, 2025

Choose a reason for hiding this comment

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

What do you think about putting this in commons-build-plugin?

That plugin generates files already like the release notes, read me, and some site XML files. This would allow us to also generate the security page with VEX information! Super 👌!

Requiring Python is not great, the plug-in generates files without Python.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I could write a Maven Site Plugin that generates the OpenVEX.

Since it is experimental and might be used by projects other than Commons, I'll write a prototype either in sbom-enforcer or vex-generation-toolset: it will be easier to publish and it can be easier to drop support for it, if it ends up not being useful.

@ppkarwasz ppkarwasz marked this pull request as draft July 31, 2025 12:30
@@ -0,0 +1,177 @@
#!/usr/bin/env python3
import xml.etree.ElementTree as ET
Copy link
Member

Choose a reason for hiding this comment

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

This file is missing its Apache license header which blows up the build's RAT check. Run 'mvn' solo to run the default Maven goal 😉

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.

2 participants