Skip to content

feat: inventory X.509 certificates for CycloneDX CBOM output #5190

Description

@AAH20

What would you like to be added?

Add an opt-in file cataloger that discovers public X.509 certificates in container images and filesystems and represents them as cryptographic assets in CycloneDX 1.6+ output.

A possible initial scope:

  • recognize PEM and DER encoded X.509 certificates, including PEM bundles
  • parse with Go's crypto/x509 and encoding/pem
  • record the certificate fingerprint, subject, issuer, serial number, validity period, public-key algorithm and size/curve, signature algorithm, key usage, extended key usage, CA flag, and source locations
  • use a stable certificate fingerprint for identity so the same certificate at multiple paths is deduplicated while its locations remain observable
  • emit the assets using CycloneDX cryptoProperties for formats that support CBOM
  • ignore private-key contents and avoid serializing secret material
  • make malformed or unsupported certificates non-fatal
  • keep output deterministic

I think the clean model is a first-class Syft cryptographic-asset collection populated by catalogers and consumed by format encoders, rather than making the CycloneDX encoder perform discovery. I would appreciate maintainer guidance on that boundary before implementing it.

The initial implementation would deliberately cover certificate inventory only. Discovery of private/public keys, SSH material, keystores, cryptographic libraries/API usage, and live TLS endpoints can be considered separately.

Why is this needed?

Organizations preparing for post-quantum cryptography migration first need a reliable inventory of where classical cryptography is deployed. Container images and filesystems commonly contain trust stores, service certificates, CA certificates, and application-specific certificate bundles, but this material is absent from conventional package-only SBOMs.

Syft already performs repeatable filesystem and image discovery and emits CycloneDX. Adding certificate inventory would let the same established scan produce the first useful slice of a Cryptography Bill of Materials, without requiring another inventory agent or a separate manual collection process.

This would support concrete workflows such as:

  • identifying RSA and elliptic-curve certificate dependencies for migration planning
  • finding expired, not-yet-valid, unexpectedly duplicated, or unusually long-lived certificates
  • comparing cryptographic inventory across builds
  • attaching a machine-readable CBOM to release evidence
  • mapping certificates back to packages, files, and container layers in later iterations

This cataloger should report inventory facts, not label a certificate as a vulnerability or make a compliance determination.

Additional context

NIST's NCCoE migration guidance identifies cryptographic asset discovery and inventory as an early step in migration to post-quantum cryptography:

CycloneDX 1.6 introduced CBOM support for algorithms, certificates, keys, protocols, and related cryptographic properties:

Suggested acceptance tests include PEM, DER, certificate bundles, duplicate certificates at different paths, malformed input, CA and end-entity certificates, expired certificates, RSA/ECDSA/Ed25519 certificates, private-key files being ignored, and deterministic serialization.

I am willing to implement the initial certificate cataloger and tests once the preferred internal model and output boundary are agreed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions