@@ -229,6 +229,25 @@ def to_cyclonedx(self) -> dict:
229229
230230 cdx_components .append (cdx_component )
231231
232+ # Build scan summary properties
233+ scan_properties = [
234+ {"name" : "trusera:total_components" , "value" : str (self .summary .total_components )},
235+ {
236+ "name" : "trusera:critical_count" ,
237+ "value" : str (self .summary .by_severity .get ("critical" , 0 )),
238+ },
239+ {"name" : "trusera:high_count" , "value" : str (self .summary .by_severity .get ("high" , 0 ))},
240+ {
241+ "name" : "trusera:medium_count" ,
242+ "value" : str (self .summary .by_severity .get ("medium" , 0 )),
243+ },
244+ {"name" : "trusera:low_count" , "value" : str (self .summary .by_severity .get ("low" , 0 ))},
245+ {
246+ "name" : "trusera:scan_duration_seconds" ,
247+ "value" : f"{ self .summary .scan_duration_seconds :.2f} " ,
248+ },
249+ ]
250+
232251 return {
233252 "bomFormat" : "CycloneDX" ,
234253 "specVersion" : "1.6" ,
@@ -249,6 +268,7 @@ def to_cyclonedx(self) -> dict:
249268 }
250269 ]
251270 },
271+ "properties" : scan_properties ,
252272 },
253273 "components" : cdx_components ,
254274 }
0 commit comments