[Feature] Provide a governed key-vault and key-lifecycle capability #2

Closed
opened 2026-07-30 17:34:18 +02:00 by zemion · 2 comments
Owner

Implement the module-neutral key custody layer after the threat model is accepted.

Acceptance criteria

  • Stable capability contracts cover key creation/import, wrapping, rotation, revocation, destruction scheduling, recovery, and status/provenance.
  • Key material never crosses module capability boundaries as plaintext.
  • Tenant/scope isolation, policy provenance, recent-auth requirements, quorum recovery, and audit-safe events are enforced.
  • Providers can be local development, deployment KMS/HSM, or client-held without callers importing provider modules.
  • Secret values are redacted from logs, APIs, events, exceptions, and diagnostics.
  • Test vectors, failure injection, migration, backup/restore, and key-loss behavior are covered.
Implement the module-neutral key custody layer after the threat model is accepted. ## Acceptance criteria - Stable capability contracts cover key creation/import, wrapping, rotation, revocation, destruction scheduling, recovery, and status/provenance. - Key material never crosses module capability boundaries as plaintext. - Tenant/scope isolation, policy provenance, recent-auth requirements, quorum recovery, and audit-safe events are enforced. - Providers can be local development, deployment KMS/HSM, or client-held without callers importing provider modules. - Secret values are redacted from logs, APIs, events, exceptions, and diagnostics. - Test vectors, failure injection, migration, backup/restore, and key-loss behavior are covered.
Author
Owner

Codex State: progress

Summary

  • Implemented provider-neutral opaque key-operation contracts and SQL lifecycle state for provision/import references, rotation, revocation, destruction scheduling, status, recovery quorum, current high-assurance checks, audit-safe events, idempotency, outcome-unknown handling, and reconciliation.
  • This remains open because no concrete local/KMS/HSM/client-held cryptographic provider, provider conformance suite/test vectors, or target backup/restore and key-loss drill has been selected and proven.

Changed Files

  • src/govoplan_encryption/backend/service.py
  • src/govoplan_encryption/backend/db/models.py
  • src/govoplan_core/core/encryption.py

Verification

  • Encryption lifecycle/failure/recovery suite passed in GovOPlaN/govoplan-encryption@858c41d.

Suggested status label: status/in-progress

## Codex State: progress ### Summary - Implemented provider-neutral opaque key-operation contracts and SQL lifecycle state for provision/import references, rotation, revocation, destruction scheduling, status, recovery quorum, current high-assurance checks, audit-safe events, idempotency, outcome-unknown handling, and reconciliation. - This remains open because no concrete local/KMS/HSM/client-held cryptographic provider, provider conformance suite/test vectors, or target backup/restore and key-loss drill has been selected and proven. ### Changed Files - `src/govoplan_encryption/backend/service.py` - `src/govoplan_encryption/backend/db/models.py` - `src/govoplan_core/core/encryption.py` ### Verification - `Encryption lifecycle/failure/recovery suite passed in GovOPlaN/govoplan-encryption@858c41d.` Suggested status label: `status/in-progress`
zemion added
status
in-progress
and removed
status
ready
labels 2026-08-01 21:06:08 +02:00
Author
Owner

Codex State: done

Summary

  • Completed the provider-neutral key-material, key-vault, content-cipher, recovery, lifecycle, provenance, and disable-preflight contracts.
  • Added the bundled local_aesgcm server-envelope provider with AES-256-GCM, opaque SQL-wrapped vault/content keys, idempotent operations, rotation, revocation, scheduled cryptographic destruction, tenant binding, and failure injection.
  • Added real SQLite backup/restore and wrong-key/key-loss coverage. This closes the governed server-side reference implementation; it does not claim E2EE, HSM/KMS custody, or external certification.

Changed Files

  • src/govoplan_encryption/backend/local_provider.py
  • src/govoplan_encryption/backend/service.py
  • src/govoplan_encryption/backend/migrations/versions/e5b7c9d1f3a4_v0114_local_crypto_provider.py
  • tests/test_local_provider.py
  • docs/ENCRYPTION_BOUNDARY.md

Verification

  • 14 Encryption tests passed.
  • GovOPlaN consolidated focused module, migration, composition, and optional-permutation checks passed.
  • Pushed as 42f35f8; Core contracts are in 972c681.
## Codex State: done ### Summary - Completed the provider-neutral key-material, key-vault, content-cipher, recovery, lifecycle, provenance, and disable-preflight contracts. - Added the bundled local_aesgcm server-envelope provider with AES-256-GCM, opaque SQL-wrapped vault/content keys, idempotent operations, rotation, revocation, scheduled cryptographic destruction, tenant binding, and failure injection. - Added real SQLite backup/restore and wrong-key/key-loss coverage. This closes the governed server-side reference implementation; it does not claim E2EE, HSM/KMS custody, or external certification. ### Changed Files - `src/govoplan_encryption/backend/local_provider.py` - `src/govoplan_encryption/backend/service.py` - `src/govoplan_encryption/backend/migrations/versions/e5b7c9d1f3a4_v0114_local_crypto_provider.py` - `tests/test_local_provider.py` - `docs/ENCRYPTION_BOUNDARY.md` ### Verification - `14 Encryption tests passed.` - `GovOPlaN consolidated focused module, migration, composition, and optional-permutation checks passed.` - `Pushed as 42f35f8; Core contracts are in 972c681.`
zemion removed the codex/ready
status
in-progress
labels 2026-08-02 03:46:53 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: GovOPlaN/govoplan-encryption#2