Repository navigation
Closed
Description
The README advertises "🔐 Job Encryption & PII Protection" (AES-256-GCM / ChaCha20-Poly1305, field-level PII protection, retention policies), but with the encryption feature enabled payloads are stored and processed in plaintext.
What happens today
Job::with_encryption(config)andJob::with_pii_fields(..)store the config on theJobstruct, but nothing acts on it.- No enqueue, batch-enqueue or update query in
src/queue/postgres.rsorsrc/queue/mysql.rswritesis_encrypted,encryption_key_id,encryption_algorithm,encrypted_payload,encryption_nonce,encryption_tag,encryption_metadata,payload_hash,pii_fields,retention_policy,retention_delete_atorencrypted_at. The columns from migration 011 are always NULL/false. JobRow::into_jobreads those columns back (build_encryption_config,build_encrypted_payload,parse_retention_policy), but they're never populated.- Nothing encrypts on enqueue or decrypts before the worker's handler runs.
EncryptionEngineandKeyManagerwork on their own, but the queue never calls them.
A user who enables encryption for PII believes sensitive data is encrypted at rest, and it isn't. That's a security and compliance problem.
Expected
- On enqueue (single and batch): if a job has an
EncryptionConfig, encrypt the payload (or only thepii_fields) with the configured engine/key. Store the ciphertext inencrypted_payloadwith nonce, tag, key id, algorithm and metadata, setis_encrypted, and don't store the plaintext payload (store a redacted placeholder inpayload). - On dequeue /
get_job: decrypt transparently before the job reaches the handler, and fail the job with a clear error if the key is unavailable. - Retention policies (
retention_delete_at) are enforced by a cleanup path. - PostgreSQL/MySQL parity, with integration tests on both that check the stored row holds no plaintext.
- Without the feature or a config, behaviour is unchanged.
Part of #7. Found during the clippy workstream (#10, which left a TODO(#7) on JobRow).
Metadata
Metadata
Assignees
Labels
No labels
Activity
feat(encryption): encrypt job payloads at rest (#11)
feat(encryption): encrypt job payloads at rest (#11)
feat(encryption): encrypt job payloads at rest (#11) (#36)