Skip to content

Decrypt SecureString parameters in SsmProvider - #19

Merged
billfreeman44 merged 1 commit into
masterfrom
fix-ssm-securestring
Jul 21, 2026
Merged

Decrypt SecureString parameters in SsmProvider#19
billfreeman44 merged 1 commit into
masterfrom
fix-ssm-securestring

Conversation

@billfreeman44

Copy link
Copy Markdown
Member

Found via the signup-captcha rollout: auth-cognito's new PreSignUp trigger reads its Turnstile secret with ssmString from a SecureString param, and got the raw KMS ciphertext — Cloudflare siteverify rejected it with invalid-input-secret. Every existing ssmString consumer reads String params, so this never surfaced.

WithDecryption: true is a no-op for String parameters and decrypts SecureString; the AWS-managed aws/ssm key requires no extra IAM for principals that can already ssm:GetParameter.

🤖 Generated with Claude Code

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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 call GetParameterCommand({ Name, WithDecryption: true }).
  • Update the SsmProvider unit test to assert WithDecryption: true is sent.
  • Document the behavior change in README.md and CHANGELOG.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.

@billfreeman44
billfreeman44 merged commit 33bce1c into master Jul 21, 2026
10 checks passed
@billfreeman44
billfreeman44 deleted the fix-ssm-securestring branch July 21, 2026 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants