Skip to content

Encrypt bootstrap SSM parameter to survive org re-encryption policies#6857

Open
HeathHopkins wants to merge 1 commit intoanomalyco:devfrom
HeathHopkins:encrypt-bootstrap-ssm-parameter
Open

Encrypt bootstrap SSM parameter to survive org re-encryption policies#6857
HeathHopkins wants to merge 1 commit intoanomalyco:devfrom
HeathHopkins:encrypt-bootstrap-ssm-parameter

Conversation

@HeathHopkins
Copy link
Copy Markdown

Closes #6856

Summary

  • Change the /sst/bootstrap SSM parameter from String to SecureString and read it with WithDecryption: true
  • Prevents breakage when an AWS organization policy automatically re-encrypts unencrypted SSM parameters
  • Matches the pattern already used by the passphrase parameter in the same file

Motivation

Some AWS organizations enforce policies that automatically convert unencrypted SSM parameters to SecureString. Once this happens, the bootstrap parameter becomes unreadable because SST calls GetParameter with WithDecryption: false, which returns encrypted ciphertext instead of the plaintext JSON.

Changes

Two changes in pkg/project/provider/aws.go inside Bootstrap():

  1. GetParameter for /sst/bootstrap: WithDecryption changed from false to true
  2. PutParameter for /sst/bootstrap: Type changed from ParameterTypeString to ParameterTypeSecureString

Backward Compatibility

This is safe for existing deployments with unencrypted String bootstrap parameters:

  • Reading: From the AWS docs, WithDecryption "is ignored for String and StringList parameter types." Existing unencrypted parameters are returned identically.
  • Writing: The parameter is only rewritten when the bootstrap version advances. At that point, PutParameter with Overwrite: true allows changing the type from String to SecureString seamlessly.

  Change the /sst/bootstrap SSM parameter from String to SecureString and
  read it with WithDecryption: true. This prevents breakage when an AWS
  organization policy automatically re-encrypts unencrypted SSM parameters.

  Backward-compatible: WithDecryption is a no-op for existing String
  parameters, and PutParameter with Overwrite allows upgrading String to
  SecureString on the next bootstrap version bump.

  Matches the pattern already used by the passphrase parameter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some orgs force SSM Parameter encryption which breaks the bootstrap version check

1 participant