feat: add direct AWS KMS encryption for cardholder data#163
Open
BenJanecke wants to merge 1 commit intojuspay:mainfrom
Open
feat: add direct AWS KMS encryption for cardholder data#163BenJanecke wants to merge 1 commit intojuspay:mainfrom
BenJanecke wants to merge 1 commit intojuspay:mainfrom
Conversation
Allow cardholder data to be encrypted/decrypted directly by AWS KMS, eliminating all local key material. A new `aws_kms` mode for `external_key_manager` routes encrypt/decrypt calls through the KMS Encrypt/Decrypt APIs with per-entity encryption context binding. Also refactors AwsKmsClient to use a single encrypt/decrypt API that operates on raw bytes, moving base64/UTF-8 concerns to the SecretManager implementation.
e7ee491 to
0ffdb0c
Compare
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
#162
Adds a new
aws_kmsmode for theexternal_key_managerconfig that delegates all cardholder data encryption to AWS KMS — no encryption keys are ever generated, stored, or handled locally. This shiftscryptographic key management responsibilities to AWS KMS (a PCI DSS Level 1 validated service), significantly reducing the operator's PCI compliance scope and audit surface for key management controls.
KmsKeyManager/KmsCryptoManagerbehind the existingKeyProvider/CryptoOperationsManagertrait abstraction, requiring zero changes to route handlersAwsKmsClientto a singleencrypt/decryptAPI operating on raw bytes with optional encryption context; base64/UTF-8 handling moved to theSecretManagerimplkms-awsfeature flag with no new dependenciesConfiguration
Test plan