-
-
Notifications
You must be signed in to change notification settings - Fork 96
Description
The CycloneDX Maven Plugin is currently generating deterministic serialNumber for SBOMs, which conflicts with the CycloneDX specification's recommendation for unique serialNumber.
According to the CycloneDX specification, every SBOM generated should have a unique serial number, even if its contents have not changed over time.
We had an issue because several SBOMs generated with the Plugin did not change its serialNumber since the SBOM itself did not change at all.
Now, looking at the coding of the Plugin I see that the generateSerialNumber function generates reproducable serialNumber.
cyclonedx-maven-plugin/src/main/java/org/cyclonedx/maven/BaseCycloneDxMojo.java
Lines 425 to 438 in ad5624e
| private String generateSerialNumber(List<Property> properties) { | |
| String gav = String.format("%s:%s:%s", project.getGroupId(), project.getArtifactId(), project.getVersion()); | |
| StringBuilder sb = new StringBuilder(gav); | |
| if (properties != null) { | |
| for(Property prop: properties) { | |
| sb.append(';'); | |
| sb.append(prop.getName()); | |
| sb.append('='); | |
| sb.append(prop.getValue()); | |
| } | |
| } | |
| UUID uuid = UUID.nameUUIDFromBytes(sb.toString().getBytes(StandardCharsets.UTF_8)); | |
| return String.format("urn:uuid:%s", uuid); | |
| } |
Could you please generate the serialNumber to not be deterministic to conform with the CycloneDX specification?