Skip to content

R1: CycloneDX CBOM import and export - #8

Merged
altrudev merged 4 commits into
mainfrom
altru/r1-cbom
Dec 5, 2026
Merged

altrudev merged 4 commits into
mainfrom
altru/r1-cbom

Conversation

@altrudev

@altrudev altrudev commented Dec 5, 2026

Copy link
Copy Markdown
Owner

R1: pqdocket now reads and writes CycloneDX CBOMs, so it works with the inventories other scanners already produce instead of competing with them.

What's new

  • pqdocket import a.json b.json --output inventory.json: reads CycloneDX 1.6 and 1.7 CBOMs into one normalized inventory (new schemas/inventory.schema.json, v1.0.0). Every record carries:

    • its quantum-relevance class
    • where it was found
    • provenance: source file hash, spec version, tools, bom-ref
    • the original component, unchanged
  • Classification order:

    1. CycloneDX 1.7 algorithmFamily
    2. Known weak, key and symmetric names
    3. pqdocket's lexical rules

    Certificates, keys and protocols take the most serious class among the algorithms they reference, including CBOMkit's dependency links. Anything unclassifiable stays unknown.

  • pqdocket scan --format cbom: exports a deterministic CycloneDX 1.7 CBOM, validated against the official schema in tests, that round-trips through import.

  • Scanner fix found with real data: Java names like SHA256withRSA, SHA384withECDSA, SHA1withDSA and RSAPublicKey were missed. Fixed, with regression tests.

  • New class: hybrid groups (X25519MLKEM768) now get their own class, hybrid_pqc.

Real fixtures (unmodified, licenses noted in tests/fixtures/cbom/README.md)

  • CBOMkit outputs for Keycloak, Kafka and Flink (Apache-2.0)
  • Official CycloneDX CBOM examples, 1.6 and 1.7 (CC0)
  • Official CycloneDX 1.6/1.7 JSON schemas for offline validation (Apache-2.0)

On these, the importer reads every cryptographic asset (91 in total). The only unknowns are genuinely undecidable entries: a bare "TLS", "RAW", "PRIVATE KEY", and keys with no linked algorithm.

Checks

  • pytest: 92 passed (38 new)
  • ruff check .: clean
  • mypy src: clean
  • CLI end to end: scan to CBOM to import, merged with a CBOMkit file

Not in this PR

  • A fixture from a second scanner's own run (Keylens/xgrep). That needs running their code, which I didn't do from chat.
  • Merging the same asset reported by several tools (R3).

Version bumped to 0.2.0. After merge, tag v0.2.0 to release.


Generated by Claude Code

Unmodified CBOMkit outputs (Keycloak, Kafka, Flink; Apache-2.0), official
CycloneDX CBOM examples (CC0) and the CycloneDX 1.6/1.7 JSON schemas
(Apache-2.0) for offline import and export tests.
- SHA256withRSA, SHA384withECDSA, SHA1withDSA and RSAPublicKey-style
  identifiers were missed by the RSA, ECDSA and DSA rules; found while
  importing real CBOMkit output
- Hybrid ML-KEM groups (X25519MLKEM768) now report quantum_relevance
  hybrid_pqc instead of the pure post-quantum value
- pqdocket import: reads CycloneDX 1.6 and 1.7 CBOMs from any tool into a
  normalized inventory (schema 1.0.0) with provenance per record (source
  file hash, spec version, tools, bom-ref, occurrences) and the original
  component kept unchanged
- Classification: CycloneDX 1.7 algorithmFamily first, then names and
  lexical rules; certificates, keys and protocols take the most serious
  class among referenced algorithms, following CBOMkit dependency links;
  anything unclassifiable stays unknown
- pqdocket scan --format cbom: deterministic CycloneDX 1.7 CBOM, validated
  in tests against the official schema; round-trips through import
- Clear errors for malformed input
@altrudev
altrudev merged commit 8928fe6 into main Dec 5, 2026
4 checks passed
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

Successfully merging this pull request may close these issues.

1 participant