Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .altru/DECISIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@
- 2026-12-05: Signature features F1-F9 added to roadmap; priority F1 self-verifying record, F4 next step per gap, F6 release evidence; then F3 disproof-first verdicts.
- 2026-12-05: Operators sign their own evidence records; authors/ALTRU.dev never sign or vouch for verdicts.
- 2026-12-05: Release evidence (F6) = stdlib script + GitHub build provenance attestation (Sigstore, keyless) in the release workflow; actions pinned to commit SHAs.
- 2026-12-05: R1 classification order = CycloneDX 1.7 algorithmFamily, then weak/key/symmetric names, then lexical rules; composites (certs, keys, protocols) take the worst referenced class; CBOMkit dependency links followed. Unknown stays unknown.
- 2026-12-05: Hybrid rule gets its own relevance `hybrid_pqc` (was standardized_pqc_candidate).
- 2026-12-05: Fixtures are real third-party CBOMs committed unmodified with licenses noted; running external scanners on the VPS is not done from chat.
7 changes: 5 additions & 2 deletions .altru/STATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Updated: 2026-12-05

## Now
R0 complete. v0.1.0 released 2026-12-05 with release-evidence.json and SLSA provenance attestations for all three assets. Private vulnerability reporting on.
R1 done on branch altru/r1-cbom (CBOM import 1.6/1.7, export 1.7, inventory schema), version 0.2.0 pending merge and tag. 86 tests.

## Last session
- Chose open-core licensing; added LICENSE, NOTICE, LICENSING.md; removed LICENSE-DECISION.md.
Expand All @@ -12,9 +12,12 @@ R0 complete. v0.1.0 released 2026-12-05 with release-evidence.json and SLSA prov
- Oversized files now counted as skipped.

## Next
1. R1: CycloneDX CBOM import/export (see docs/ROADMAP.md, docs/BACKLOG.md).
1. Merge R1 PR, tag v0.2.0.
2. R2: claim templates, evidence requirement profiles, evaluator with disproof checks (F3), next steps (F4), plain-English claims (F5).

## Gotchas
- Open question for Val: keep GitHub Actions (CI + release attestation) or switch to local scripts (his earlier preference elsewhere).
- Sandbox can't reach raw.githubusercontent.com; fetch external files on the VPS and push them as a branch.
- VPS gh is 2.46 (no `gh attestation`); verify releases with a newer gh or the attestations REST API.
- Workflow files may need pushing from the VPS (token with `workflow` scope).
- Release evidence fails on a dirty tree, failed tests, or a tag/version mismatch by design.
Expand Down
5 changes: 5 additions & 0 deletions .altru/TASKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
- [x] Choose new CLI/product name and rename package (pqdocket)
- [x] Add signature features F1-F9 to roadmap

## R1 CBOM interop (specs/r1-cbom.md)
- [x] Classifier, importer, exporter, inventory schema - check: tests/test_cbom.py
- [x] Real fixtures (CBOMkit, CycloneDX examples) - check: tests/fixtures/cbom/README.md
- [ ] Tag v0.2.0 after merge

## Backlog
- Load rules from standards/registry.yaml
- Count files with unlisted extensions in the report
Expand Down
33 changes: 33 additions & 0 deletions .altru/specs/r1-cbom.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# R1 — CycloneDX CBOM import and export
Date: 2026-12-05 Size: Normal Status: done

## Goal
Read CBOMs from other tools into one normalized inventory with provenance, and write pqdocket's own findings as a valid CycloneDX 1.7 CBOM.

## What the user sees
- `pqdocket import tool-output.cbom.json [more.json ...] [--output inventory.json]`: an inventory listing every cryptographic asset with its quantum relevance, where it was found, and which tool and file it came from. Assets pqdocket cannot classify are shown as `unknown`, never dropped.
- `pqdocket scan PATH --format cbom [--output out.cdx.json]`: the scan as a CycloneDX 1.7 CBOM other tools can read.
- `pqdocket import` also accepts pqdocket's own CBOM, so scan -> CBOM -> import round-trips.

## Constraints
- Standard library only at runtime; `jsonschema` only in tests.
- Versions checked 2026-12-05: CycloneDX 1.7 schema (algorithmFamily and ellipticCurve enums in cryptography-defs.schema.json; `curve` deprecated), 1.6 still accepted.
- Every record keeps the original component unchanged (`source_component`), so nothing pqdocket does not interpret is lost.
- Deterministic export for the same scan (serial number and bom-refs derived from content).
- Lexical findings exported with `primitive: unknown` unless the rule implies one, and `pqdocket:confidence=low`; never claim more than the scan knows.

## Acceptance checks
- [x] Imports all 3 CBOMkit outputs and all 5 CycloneDX examples without error; record count equals cryptographic-asset count.
- [x] Each record has provenance: source file sha256, spec version, tool (or `unknown`), bom-ref, occurrences.
- [x] Classification uses algorithmFamily first, then the lexical rules on name and parameter set; ML-KEM/ML-DSA/SLH-DSA are never classed as quantum-vulnerable; unclassifiable assets are `unknown`.
- [x] Exported CBOM validates against the official CycloneDX 1.7 schema offline.
- [x] Round trip: scan -> CBOM -> import keeps every finding's path, line and family.
- [x] Inventory validates against `schemas/inventory.schema.json`.
- [x] Malformed input (not JSON, not CycloneDX, wrong types) fails with a clear message, not a traceback.
- [x] pytest, ruff, mypy clean.

## Out of scope
- XML or protobuf CycloneDX; SPDX.
- Merging duplicate assets across tools (R3 evidence graph).
- Claims and verdicts (R2).
- Running other scanners.
20 changes: 17 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,20 @@ pqdocket scan . --format json --output pqc-report.json
pytest
```

## Current capabilities (R0)
## Working with CBOMs
pqdocket reads and writes CycloneDX CBOMs, so it works with the inventories other scanners already produce.

```bash
# Export your scan as a CycloneDX 1.7 CBOM
pqdocket scan . --format cbom --output my-app.cdx.json

# Import CBOMs from any tool (CBOMkit, Keylens, xgrep, pqdocket...) into one inventory
pqdocket import cbomkit-output.json my-app.cdx.json --output inventory.json
```

The inventory gives every cryptographic asset a quantum-relevance class, where it was found, and which file and tool it came from, and keeps the original component unchanged. Classification uses the CBOM's `algorithmFamily` first (CycloneDX 1.7), then names and parameters; certificates, keys and protocols take the most serious class among the algorithms they reference. Anything it can't classify is listed as `unknown`, never as safe.

## Current capabilities (R0, R1)
- Recursive local source scan for initial cryptographic indicators.
- Line-level evidence, rule IDs, confidence, and file SHA-256.
- JSON report output and versioned schema.
Expand All @@ -35,10 +48,11 @@ pytest
- Strict, versioned report schema (1.1.0), validated in CI.
- CI on Python 3.11 to 3.14 (lint, type check, tests, self-scan).
- Every release ships its own evidence record (`release-evidence.json`) and a signed build provenance attestation.
- Tests for representative detection and false-positive cases.
- CycloneDX CBOM import (1.6, 1.7) into a normalized, versioned inventory (`schemas/inventory.schema.json`), and CBOM export (1.7) validated against the official CycloneDX schema.
- Tests for representative detection and false-positive cases, plus real CBOMs from CBOMkit and the official CycloneDX examples.

## Not implemented
CBOM import/export; claims and assurance evaluator; signed evidence records for user verdicts; semantic/data-flow analysis; lockfile/SBOM correlation; TLS/SSH/VPN/certificate inspection; runtime-use verification; PQC correctness/interoperability tests; risk scoring; migration automation; dashboard; GitHub App.
Claims and assurance evaluator; signed evidence records for user verdicts; semantic/data-flow analysis; lockfile/SBOM correlation; TLS/SSH/VPN/certificate inspection; runtime-use verification; PQC correctness/interoperability tests; risk scoring; migration automation; dashboard; GitHub App.

## Layout
- `docs/`: product, architecture, threat model, assurance, risk, roadmap, backlog.
Expand Down
10 changes: 6 additions & 4 deletions docs/BACKLOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
- [x] Cut first release `v0.1.0`.

## R1 — Interoperability
- [ ] CycloneDX CBOM importer with provenance.
- [ ] CycloneDX CBOM exporter for built-in scanner findings.
- [ ] Normalized inventory schema (versioned).
- [ ] Fixtures: CBOMs from at least two external tools.
- [x] CycloneDX CBOM importer (1.6, 1.7) with provenance and unchanged source components.
- [x] CycloneDX 1.7 CBOM exporter for built-in scanner findings, validated against the official schema.
- [x] Normalized inventory schema (versioned, 1.0.0).
- [x] Fixtures: real CBOMkit outputs (Keycloak, Kafka, Flink) and official CycloneDX examples.
- [ ] Fixture from a second scanner's own output (e.g. Keylens or xgrep run on a sample repo).
- [ ] Merge the same asset reported by several tools (R3 evidence graph).
- [ ] Load rules and classifications from `standards/registry.yaml`.

## R2 — Claims and evaluator
Expand Down
Loading