Add crypto inventory and proposed-profile config boundary (K01, #5) #59
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
primatekuntech/rag-rust!59
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/5-crypto-config"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Refs #5
What
Adds the crypto inventory and the versioned, purpose-based profile boundary for K01, without implementing any crypto protocol.
crates/crypto-config(std-only, no dependencies; a test enforces it):Purpose, a compiled-in catalog (setdev-synthetic.1, five profiles, allProposed), andProfileSet::from_envwhich fails closed on a missing, unknown, untrimmed, duplicate-purpose, missing-purpose or not-approved set. Errors never echo the input.cm1:<profile-id>:<key-ref>(KeyRef,CryptoMetadata,ProfileSet::resolve) for rotation and migration.KeyRefrefuses secret-shaped values. Nothing persists these yet.INVENTORY: 22 entries covering all 11 SRS criterion-11 components, each with peers, protocols, provider/version, key refs, data scope/lifetime, owner, evidence and migration state; unsupported or unassessed PQ endpoints are tracked (PqStatushas no "protected" variant, so a PQ claim cannot be written down).docs/security/crypto-inventory.mdis generated byrender()and compared byte for byte by a test (UPDATE_CRYPTO_INVENTORY=1regenerates);docs/security/crypto-profile.mddocuments the boundary.rag-apistartup now requiresCRYPTO_PROFILE_SET(after the RAG_ENV and loopback guards, before any database connection)..env.exampleupdated.Things to know
rag-apistartup enforces the set today.rag-migrate(the one binary that can run with verify-full TLS in production) does not readCRYPTO_PROFILE_SET; gating it is left to K02/K03 and the docs say so.Approveduntil D01 decisions land (OD-04 profile, ID-10 approver); both stay open indocs/decisions.md, with evidence added only.Cargo.lock. Corrections found on the way: Postgres and SMTP use compiled-inwebpki-roots, not the platform store; session digests usesha2while the profile namedring(the profile now names both). Not verified: negotiated TLS version and key-exchange group (marked unmeasured), and the "unless a root certificate is supplied in the URL" hedge.UPDATE_CRYPTO_INVENTORY=1 cargo test -p rag-crypto-config --test inventory_docafter editingINVENTORY.Verification
cargo test -p rag-crypto-config: 32 unit + 1 boundary + 3 doc tests;cargo test -p rag-api --test startup: 7/7;cargo clippy --workspace --all-targets -- -D warningsandcargo fmt --all --checkclean.scripts/coverage.sh rust(real PostgreSQL): 91.36% workspace line coverage (minimum 80%), 0 failed suites. Changed files: inventory.rs 99.5%, metadata.rs 100%, profile.rs 83.6%.||) and the migrate-binary scope gap; both fixed, with the cell-count test failing first. Pass 1 re-check of the fixes was clean.Not in this PR
rag-migrateand other binaries; any approved profile; KMS/HSM; audit event at boot.KeyRefshape heuristic.🤖 Generated with Claude Code
amiryahaya referenced this pull request2026-10-26 13:56:26 +01:00