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

Validate uploaded BOMs against CycloneDX schema #3218

Closed
2 tasks done
nscuro opened this issue Nov 21, 2023 · 3 comments · Fixed by #3522
Closed
2 tasks done

Validate uploaded BOMs against CycloneDX schema #3218

nscuro opened this issue Nov 21, 2023 · 3 comments · Fixed by #3522
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@nscuro
Copy link
Member

nscuro commented Nov 21, 2023

Current Behavior

Uploaded BOMs are currently not validated against the CycloneDX schema.

Users who upload (unknowingly) invalid BOMs only get to know about that fact when inspecting the logs of the API server. Further, error logs from the BOM parser can be hard to understand. Instead of spewing out gibberish error messages, it should be stated clearly if the BOM is invalid to begin with.

Proposed Behavior

Validate uploaded BOMs against the CycloneDX schema synchronously, as an additional step of handling upload requests.

Users and clients should know immediately if the uploaded file is invalid and has no chance of being ingested.

This is already implemented in Hyades and merely needs backporting: https://github.com/DependencyTrack/hyades-apiserver/blob/ef39532e0b98962b7fc290902cb33edba52ade51/src/main/java/org/dependencytrack/resources/v1/BomResource.java#L438-L466

Note
There may be tools out there that generate BOMs that are valid JSON / XML, but not entirely schema conform. As a consequence, there will be users who will have to adjust / fix their tooling first. Dependency-Track should have an "escape latch" to disable validation for those users. However, validation should default to on.

Checklist

@nscuro nscuro added the enhancement New feature or request label Nov 21, 2023
@nscuro nscuro added this to the 4.11 milestone Nov 21, 2023
@melba-lopez
Copy link
Contributor

+1 on this.

  • Not all DT Users will have admin privileges or the knowledge about cyclonedx cli tool for further validation.
  • A general user should be able to get a toast notification that the BOM does not meet specification (and that is why the bom failed to upload).
  • Additionally, it would be helpful for non-admin users to be able to navigate within DT to upload the BOM to a specification validator, so that they may see where the problem resides and/or get output with this data.

If a 3rd party vendor, supplier, etc. provides a malformed SBOM, giving users the basic data of why and where the problem is would reduce time to remediation/analysis.

@jhlmco
Copy link

jhlmco commented Feb 3, 2024

There's plenty of tools to handle sbom validation. Perhaps just a response from dependency track saying "Malformed CycloneDX SBOM". I wouldn't duplicate what other tooling is doing.

nscuro added a commit to nscuro/dependency-track that referenced this issue Mar 3, 2024
nscuro added a commit to nscuro/dependency-track that referenced this issue Mar 3, 2024
@nscuro nscuro self-assigned this Mar 3, 2024
nscuro added a commit to nscuro/dependency-track that referenced this issue Mar 4, 2024
nscuro added a commit to nscuro/dependency-track that referenced this issue Mar 4, 2024
nscuro added a commit to nscuro/dependency-track that referenced this issue Mar 4, 2024
nscuro added a commit to nscuro/dependency-track that referenced this issue Mar 10, 2024
nscuro added a commit to nscuro/dependency-track that referenced this issue Mar 10, 2024
nscuro added a commit to nscuro/dependency-track that referenced this issue Mar 10, 2024
mikael-carneholm-2-wcar pushed a commit to mikael-carneholm-2-wcar/dependency-track that referenced this issue Mar 15, 2024
Copy link
Contributor

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants