Skip to content

Encryption follow-ups: bind ciphertext to job id, config section, scheduled retention purge #38

Closed

Description

@CodingAnarchy

Follow-ups from #36, which closes #11 (payload encryption at rest).

  • Bind ciphertext to the job. The encrypted payload isn't bound to its job id or queue, so someone with write access to the database can swap two jobs' encrypted_payload / nonce / tag columns, and each decrypts as the other job's data. Use AEAD associated data (e.g. job_id || queue_name || key_id || algorithm) and verify it on decrypt. Keep the ability to read payloads written before the change (version marker in encryption_metadata).
  • HammerworkConfig encryption section. The engine is configured only in code (JobQueue::with_encryption). Add a config section (algorithm, key source, key id, compression, retention defaults) consumed by JobQueue::from_config, consistent with feat: wire HammerworkConfig into the library #6.
  • Scheduled retention purge. purge_expired_encrypted_jobs / cargo hammerwork maintenance purge-encrypted must be run manually. Offer an opt-in periodic purge in WorkerPool, like the stale-job reaper from fix(worker): panic isolation, error backoff, supervision, graceful shutdown and job leases #21.
  • TestQueue encryption, so users' unit tests exercise the same redaction and decryption paths.
  • Reading archived encrypted jobs. get_job on an archived encrypted job can't decrypt until the job is restored. Document this or support decrypt-on-read for archived rows.

Part of #7.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions