Repository navigation
Add 2.0 CBOM fixtures for family-only observations - #1176
Conversation
Mehrn0ush
left a comment
There was a problem hiding this comment.
Hi @Lennonhaha.
Thanks.
The two fixtures cover the omitted-category case for a family-only ML-KEM and SM2 observation, with no nistQuantumSecurityLevel and no namespaced property.
The controls from the PR description (bogus family, level 7, explicit 0) aren’t in the commit, so they’re local checks. Could you add the command or script and the schema revision to the PR description? That keeps them reproducible and separate from the committed fixtures.
I left inline comments on both description values: they state the assessment was not performed, but omission establishes nothing about that. The suggested wording describes only the recorded observation.
|
The workflows on this PR are stopped at @Mehrn0ush @jkowalleck when one of you has a moment, could you approve the pending workflow run so the fixtures get a real CI result? The branch is now some way behind |
if in doubt, just rebase :-) |
|
Hi Jan, Thank you so much for the proactive help! Yes, please go ahead and rebase and re-run the ajv matrix. Also, could you please approve the pending workflows (it says 1 workflow awaiting approval)? A huge thanks to @Mehrn0ush for the detailed review. The distinction between "omitted" and "not assessed" is spot on, and I appreciate the careful reading. Let me know if anything else is needed from my side before merging. Thanks again! |
055d96d to
1c538db
Compare
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
CI/QA tests are failing https://github.com/CycloneDX/specification/actions/runs/43894718646/job/133396007088?pr=1176#step:5:369 ff
test /home/runner/work/specification/specification/tools/src/test/resources/2.0/valid-cbom-family-only-mlkem-2.0.json ...
!!! ERROR: Unexpected validation error
schema: /home/runner/work/specification/specification/schema/2.0/cyclonedx-2.0.schema.json
for file: /home/runner/work/specification/specification/tools/src/test/resources/2.0/valid-cbom-family-only-mlkem-2.0.json
error: [
{
instancePath: '/inventories/0/subject',
schemaPath: '#/additionalProperties',
keyword: 'additionalProperties',
params: { additionalProperty: 'bom-ref' },
message: 'must NOT have additional properties',
schema: false,
parentSchema: {
type: 'object',
title: 'Component',
required: [Array],
additionalProperties: false,
properties: [Object],
allOf: [Array]
},
data: {
'bom-ref': 'subject-mlkem-family-only',
type: 'application',
name: 'family-only observation: ML-KEM',
version: '1.0'
}
},
{
instancePath: '/inventories/0/subject',
schemaPath: '#/required',
keyword: 'required',
params: { missingProperty: 'ref' },
parentSchema: {
type: 'object',
title: 'Component',
required: [Array],
additionalProperties: false,
properties: [Object],
allOf: [Array]
},
data: {
'bom-ref': 'subject-sm2-family-only',
type: 'application',
name: 'family-only observation: SM2',
version: '1.0'
}
},
{
instancePath: '/inventories/0/subject',
schemaPath: '#/required',
keyword: 'required',
params: { missingProperty: 'ref' },
message: "must have required property 'ref'",
schema: [ 'ref' ],
parentSchema: {
type: 'object',
title: 'Component Reference',
description: 'A reference to a component declared elsewhere, such as in the definitions registry, in another position of the same document, or in another document via BOM-Link. A reference includes the referenced component exactly as declared: every position that references the same component includes an identical component. Where the inclusion context differs, such as a different scope or quantity, declare the component inline instead.',
required: [Array],
additionalProperties: false,
properties: [Object]
},
data: {
'bom-ref': 'subject-sm2-family-only',
type: 'application',
name: 'family-only observation: SM2',
version: '1.0'
}
},
{
instancePath: '/inventories/0/subject',
schemaPath: '#/properties/subject/oneOf',
keyword: 'oneOf',
params: { passingSchemas: null },
message: 'must match exactly one schema in oneOf',
schema: [ [Object], [Object] ],
parentSchema: {
title: 'Subject',
description: 'The subject whose inventory this statement declares. Either a concrete component or a reference using bom-link or `refId` to a component declared elsewhere, such as in the definitions.',
oneOf: [Array]
},
data: {
'bom-ref': 'subject-sm2-family-only',
type: 'application',
name: 'family-only observation: SM2',
version: '1.0'
}
}
]
|
|
Two fixtures for the case discussed in CycloneDX#1175: an algorithm family is observed, the parameter set is unknown, and no NIST category was assessed. - nistQuantumSecurityLevel is omitted, not set to 0: 0 means "none of the categories are met", which is a different and stronger claim - no custom namespaced property encodes assessment status, so the fixtures stay valid against the 2.0 schema on their own - the names carry the valid- prefix because AbstractJsonSchemaVerificationTest only picks up resources whose names start with "valid" or "invalid" Validated with ajv 8.20 against both the bundled and the modular 2.0 schema. Controls confirm the validation is not vacuous: a bogus algorithmFamily is rejected, nistQuantumSecurityLevel = 7 is rejected, = 0 is accepted. Signed-off-by: 刘天赫 <[email protected]>
Both family-only fixtures said the omission existed "because the assessment was not performed". That is the same inference this fixture pair is meant to disprove: omission records that no assertion was made, and says nothing about whether an assessment happened. It also implied SM2 cannot be assessed. Adopt the reviewer's wording, which describes only the recorded observation: Algorithm family observed without a recorded parameter set or asserted NIST security strength category. Omission of nistQuantumSecurityLevel does not establish whether an assessment was performed. No schema or structural change; the two description strings are the only edit. Validated against schema/2.0/cyclonedx-2.0-bundled.schema.json from 2.0-dev 76f185c with ajv 8.20.0 (draft 2020-12): both fixtures valid, bogus algorithmFamily rejected, level 7 rejected, explicit level 0 accepted. Signed-off-by: 刘天赫 <[email protected]>
… examples CycloneDX#1113 renamed bom-ref to refId across the 2.0 schema and its test data. These two fixtures still used bom-ref, so once 2.0-dev moved on, the component definition rejected them as an additional property and the subject failed its oneOf against both component and componentReference. The subject here is an inline component, not a reference to one, so refId is the right field; a reference would need ref plus a definition elsewhere, which would change what the examples demonstrate. Verified against this commit's schema with the repository's own functional harness (tools/src/test/js/schema-v2, v2.0): both fixtures fail before the change with the reported additionalProperties/missing ref/oneOf errors, and both pass after it. Signed-off-by: 刘天赫 <[email protected]>
1c538db to
a548a83
Compare
|
Updated — thanks for the pointer to #1113. Both fixtures now use Also rebased onto current Verified locally against this commit's schema with the repo's own harness (
One unrelated thing I hit while running it: on Windows the harness silently tests nothing. |
…erged The README says the output aligns with a CycloneDX 1.7 clarification and cites the issue and the PR, which is honest but easy to misread as "accepted by the specification repo". This adds a short "Listed in" block with the two entries that are actually merged, and nothing else: - CycloneDX/tool-center#170 (merged 2026-11-05, merged by jkowalleck) - RiccardoBiosas/awesome-cbom#1 (merged 2026-10-08, merged by RiccardoBiosas) Deliberately not included: CycloneDX/specification#1176 (open, changes requested), #1177 (open), #1015 (an issue, and not ours). A listing is a listing; the block says so, so a reader does not have to infer the difference between "listed" and "endorsed". Signed-off-by: 刘天赫 <[email protected]>
|
Hi @jkowalleck, I have updated the branch with the latest As mentioned in my previous update, both fixtures now use The PR is currently blocked by your previous "Changes requested" status and the 11 workflows awaiting maintainer approval. Could you please take a final look, dismiss the block, and approve the workflows so the CI can run and we can get this merged? Thanks for your time and guidance! |
|
Re-checked CI before pinging: the 9 red Each of them scans The same jobs fail on other PRs against Happy to rebase once the branch is green, or to keep the fixtures inert until then. If the fixtures themselves are acceptable, a re-review would be welcome; if the timing isn't right, I'm fine marking this draft and tracking it as an issue instead. |
|
dont worry about filing linter tests - they are well-known and addressed in #1058 |
|
Thanks — noted, I won’t file anything for those. |
Hi @Mehrn0ush,
As discussed in #1175, here are two 2.0 fixtures for family-only observations, where the NIST category is omitted rather than asserted.
valid-cbom-family-only-mlkem-2.0.json—algorithmFamily: "ML-KEM",primitive: "kem", no parameter setvalid-cbom-family-only-sm2-2.0.json—algorithmFamily: "SM2",primitive: "signature"Per your guidance, neither fixture carries a
nistQuantumSecurityLevelvalue, and neither uses a custom namespaced property, so they validate against the 2.0 schema alone. That keeps the distinction you drew: omission makes no claim, while0means none of the categories are met.Both live under
tools/src/test/resources/2.0and use thevalid-prefix, becauseAbstractJsonSchemaVerificationTestonly loads resources whose names start withvalidorinvalid; a free-form name would be silently skipped.The commit carries a DCO sign-off.
Local verification controls
Per your review request, here is exactly what was run, against which revision, and what it produced. The controls are local checks only — they are not committed as fixtures.
Schema revision:
2.0-devat76f185c45deb28c98b2555da9c752b9d43f50ecd, fileschema/2.0/cyclonedx-2.0-bundled.schema.json($idhttps://cyclonedx.org/schema/2.0/cyclonedx-2.0-bundled.schema.json,$schemadraft 2020-12).Validator: ajv 8.20.0 with ajv-formats 3.0.1,
new Ajv2020({ strict: false, validateSchema: false, allErrors: true }). The companion schemas (cryptography-defs,behavior-taxonomy,spdx,jsf-0.82) are registered fromschema/under bothhttps://cyclonedx.org/schema/<name>andhttps://cyclonedx.org/schema/2.0/<name>;validateSchemais disabled because the two draft-07 companions cannot be meta-validated by a 2020-12 instance.Result (exit code 0, five cases):
valid-cbom-family-only-mlkem-2.0.jsonas committedvalid-cbom-family-only-sm2-2.0.jsonas committedalgorithmFamily: "ML-KEM-NOT-A-FAMILY"nistQuantumSecurityLevel: 7nistQuantumSecurityLevel: 0One caveat so the claim is not overstated: ajv-formats 3.0.1 does not provide
iri-referenceoridn-email, and Ajv reports those as ignored. No field in these two fixtures uses either format, and the structural assertions above are unaffected, but those two formats are not enforced by this local run.Change since the first revision
The initial descriptions said the omission existed "because the assessment was not performed", which asserts an assessment status that omission cannot establish, and implies SM2 cannot be assessed. Both now use your suggested wording verbatim:
Happy to adjust naming, placement or scope if you would prefer a different layout.
Follow-up (2026-11-26)
The
refIdrename is now complete (0bom-refremaining). The previous CI failure was fixed in the subsequent commit.refIdeach and 0bom-ref;schema/2.0/modules/cyclonedx-component-2.0.schema.jsonon2.0-devitself definesrefId(8 occurrences, 0bom-ref), so the fixtures match the schema, not a local convention.run 43894718646, jobtest 2.0, head1c538dba, 2026-11-16T15:19Z) wasparams: { additionalProperty: 'bom-ref' }→ERROR: "test:v2.0:t3-json-schema-functional" exited with 2. That is the same defect, and the rename landed afterwards inccffdc8a.action_required(fork approval), so no run has executed against the fixed commit yet.Could you approve the pending workflow runs (or re-run
test 2.0onccffdc8a) so the fix is backed by a green run rather than by inspection alone?