feat(lazy-reencryption): Phase 2-4 — Core logic, password change, integration tests - #10
Open
Erik-Castro wants to merge 1 commit into
Open
feat(lazy-reencryption): Phase 2-4 — Core logic, password change, integration tests#10Erik-Castro wants to merge 1 commit into
Erik-Castro wants to merge 1 commit into
Conversation
…egration tests - Rewrite kek_rotate() to O(1) archive→generate→update, no secrets loop - Add lazy-migrate in ssm_secret_get() — decrypt with archived KEK, re-encrypt with current - Add safe-purge — auto-delete archive entry when all secrets migrated - Add ssm_kek_purge_archive() public API - Modify ssm_user_change_password() to re-wrap all archive entries - 15 tests: O(1) rotation, lazy-migrate, safe-purge, purge API, password change, concurrency
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR #2 of feature-branch-chain
feat/lazy-reencryption. Core implementation of lazy KEK re-encryption:Core Logic:
kek_rotate()→ O(1): archive current KEK → generate new → atomic version increment — no per-secret workssm_secret_get(): detects stalekek_version, looks up archived KEK, decrypts, re-encrypts with current KEK, updates row atomicallyCOUNTchecks if any secrets still reference old version; if zero, deletes archive entryPassword Change:
ssm_user_change_password()extended to re-wrap all archived KEK entries with new auth_hashPublic API:
ssm_kek_purge_archive(h, username)— manually purge fully-migrated archive entriesTests:
Type of Change
SDD Checklist
secure_erase/secure_bufferused for all sensitive dataunique_lockinssm_secret_getcovers both decrypt and lazy-migratedelete/freewithout RAII wrapperTesting Checklist
Related Issues
Part of SDD change
lazy-reencryption. PR #1 (#9) is the foundation.