---
id: HSCP-T-001
titre: "Machine-readable component inventory, later than the last deployment"
titre_court: "Check the component inventory"
type: note
objet: test
langue: en
statut: brouillon
version: 0.1
verifie_le: 2026-11-22
traduit_de: LISEZ-MOI.md
traduit_de_version: 0.1
traduit_de_empreinte: 540e9bb7c6b37259
traduction: modèle de langue, glossaire catalogue/glossaire-en.yaml
source: traduction de LISEZ-MOI.md, version 0.1
sensibilite: interne
licence: Apache-2.0
gestes: [HSCP-G-160]
recette: HSCP-R-010
piece: inventaire
---

# Machine-readable component inventory, later than the last deployment

## What the test checks

The evidence item is the component inventory of a piece of software (SBOM), in JSON. The test accepts it if:

- it is a CycloneDX document (version 1.4, 1.5 or 1.6) or an SPDX document (version 2.2 or 2.3);
- it carries its production date (`metadata.timestamp` in CycloneDX, `creationInfo.created` in SPDX);
- it lists at least one component, and every component has a name and a version;
- its date is not earlier than the last declared deployment: an inventory older than what is running does not describe what is running.

A component without a `purl` is reported, without refusal.

## Running the test

```sh
python3 verifier.py inventaire.cdx.json --deploiement 2026-11-20T09:30:00Z
```

`--json` gives the same answer in JSON. Exit code: 0 evidence accepted, 1 evidence refused, 2 incorrect call. Python 3.10 or later, no dependency, no network access.

In continuous integration, run the test right after the inventory is produced, with the time of the current deployment.

## Producing the evidence

The test does not produce the inventory: free tools already do, for example Syft (`syft <image> -o cyclonedx-json`), cdxgen (`cdxgen -o bom.json`) or Trivy (`trivy image --format cyclonedx <image>`). The test checks what they produced.

## Examples

- `exemples/valide/`: a CycloneDX 1.6 inventory produced after the deployment. Accepted.
- `exemples/refuse/`: an SPDX 2.3 inventory produced eight days before the deployment, with one package without a version. Refused twice.

Each folder holds the command line in its `commande` file. `python3 lancer.py`, at the root of the tests, runs every example.

## What the test does not say

- It does not say whether the inventory is complete: a component missing from the inventory cannot be detected from the inventory alone.
- It does not say whether a component is vulnerable.
- It does not validate the document against the full CycloneDX or SPDX schema: it checks the fields the evidence needs.
