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

La dernière version linux Cyclonedx-cli valide avec succés le fichier json cycloneDX alors que CyberWatch détecte une erreur fatale lors de l'import #420

Open
freygagne opened this issue Feb 21, 2025 · 1 comment

Comments

@freygagne
Copy link

freygagne commented Feb 21, 2025

l’erreur interne retournée par Cyberwatch est la suivante:
TypeError (no implicit conversion of String into Integer):
Completed 500 Internal Server Error

La dernière version de l'outil linux Cyclonedx-cli a validé avec succès le fichier comme ci-dessous :
root@francois:# ./cyclonedx-linux validate --input-file SBOM_1.json
BOM validated successfully.

le fichier cycloneDx json est décrit ci_après:
{
"bomFormat" : "CycloneDX",
"specVersion" : "1.5",
"serialNumber" : "urn:uuid:a99c3eff-7254-496d-9685-8ab1155e928a",
"version" : 1,
"metadata" : {
"timestamp" : "2024-08-09T09:22:17Z",
"tools" : [
{
"vendor" : "OWASP",
"name" : "Dependency-Track",
"version" : "4.11.5"
}
],
"component" : {
"type" : "operating-system",
"bom-ref" : "d4e9e208-7ab7-45e5-a45e-ef4a54d92171",
"name" : "OS-WINDOWS10-SBOM",
"version" : "COTS de niveau 1"
}
}
}

Après investigation, La correction consiste à

  1. Remplacer au niveau du champs metadata les crochets [] (utilisés pour les tableaux) par des accolades {} (utilisées pour les objets) et
  2. Ajouter le record "components" puis rajouter d'autres accolades juste après.

"tools" : {
"components": [
{
"vendor" : "OWASP",
"name" : "Dependency-Track",
"version" : "4.11.5"
}
]
},

le winmerge du fichier à gauche après correction et à droite avant correction est en attachement.

Image

L'erreur non détéctée par cycloneDX-cli sous linux est il un bug de cet outil ?
Ou est un bug de CyberWatch qui devrait accepter ce fichier en import comme valide au regard du standard OWASP CycloneDX ?

@andreas-hilti
Copy link
Contributor

@freygagne Version 1.5 introduced a new format for tools using components and services, and deprecated the old one, see:
https://cyclonedx.org/docs/1.6/json/#metadata_tools_oneOf_i0_components
https://cyclonedx.org/docs/1.6/json/#tab-pane_metadata_tools_oneOf_i1
The left hand side is actually wrong because "vendor" is not an attribute of component (use maybe manufacturer). The right hand side is valid (even though it is deprecated).

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

No branches or pull requests

2 participants