Decrypt SecureString parameters in SsmProvider - #19
Merged
Conversation
GetParameter without WithDecryption returns the raw KMS ciphertext for SecureString parameters; callers got garbage instead of the secret. No-op for String parameters. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes SsmProvider so that ssmString correctly reads decrypted values from SSM Parameter Store SecureString parameters by always setting WithDecryption: true on GetParameterCommand. This aligns runtime behavior with how config consumers expect “string” parameters to resolve (plaintext), and prevents downstream integrations (e.g., Cloudflare Turnstile) from receiving KMS ciphertext.
Changes:
- Update
SsmProvider.get()to callGetParameterCommand({ Name, WithDecryption: true }). - Update the
SsmProviderunit test to assertWithDecryption: trueis sent. - Document the behavior change in
README.mdandCHANGELOG.md.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| README.md | Documents that SsmProvider uses WithDecryption: true and returns decrypted values for SecureString. |
| lib/providers/ssm.spec.js | Updates expectations to ensure WithDecryption: true is included in the SSM request. |
| lib/providers/ssm.js | Implements the fix by enabling decryption for SSM GetParameter reads. |
| CHANGELOG.md | Adds a 3.1.1 entry describing the SecureString decryption fix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Found via the signup-captcha rollout: auth-cognito's new PreSignUp trigger reads its Turnstile secret with
ssmStringfrom a SecureString param, and got the raw KMS ciphertext — Cloudflare siteverify rejected it withinvalid-input-secret. Every existingssmStringconsumer reads String params, so this never surfaced.WithDecryption: trueis a no-op for String parameters and decrypts SecureString; the AWS-managedaws/ssmkey requires no extra IAM for principals that can alreadyssm:GetParameter.🤖 Generated with Claude Code