Join our Newsletter — 33% off our NHI Course
Home› Guides› How to find plaintext secrets in SSM Parameter…
Guide Secrets Management

How to find plaintext secrets in SSM Parameter Store and convert them to SecureString: find, migrate and rotate

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 28 November 2026 13 min read
On this page

Many AWS accounts keep database passwords, API keys and tokens in Systems Manager Parameter Store as plain String parameters, where anyone allowed to read the parameter sees the value and nothing about the parameter marks it as sensitive. This runbook shows how to find those parameters, how to move them to SecureString given that Parameter Store does not let you change a parameter's type in place, how to deal with the plaintext left in version history, and how to stop new ones appearing. It also covers who can read a SecureString once you have one, because the default key gives every principal in the account decryption rights. It is written for cloud security and platform engineers. The wider Systems Manager security model is in the AWS Systems Manager Security Guide; this page is the find-and-fix task.

This is an independent guide from NHI Mgmt Group, based on AWS's public documentation as of November 2026. It is not sponsored or reviewed by AWS. Product features change, so confirm settings against AWS's current documentation.

Key takeaways

  • Metadata finds the candidates without reading values. DescribeParameters with a Type filter of String or StringList lists every unencrypted parameter, and names such as password, token or apikey point to the likely secrets.
  • You cannot convert a parameter in place. AWS documents that changing a String to a SecureString is not supported: you create a new parameter, move consumers to it and delete the old one.
  • History keeps the old plaintext. GetParameterHistory returns the value of each retained version (up to 100), so overwriting a value does not remove what was there before.
  • A plaintext secret should be treated as exposed. Anyone who could call GetParameter, GetParametersByPath or GetParameterHistory may have seen it, so rotate the underlying credential as part of the fix.
  • SecureString with aws/ssm is only a partial fix. AWS states every principal in the account can use the aws/ssm key, so read access is still decided by SSM permissions alone; use a customer managed key where readers must be limited.

When you need this

Run this task when you inherit an account, after a cloud posture review flags Parameter Store, before granting a new team or tool read access to a parameter path, and as a recurring hygiene check. It applies equally to parameters created by hand, by infrastructure as code and by deployment tools, which often write configuration and credentials side by side under the same path.

The risk is concrete. A String parameter is returned in clear to any caller with a matching ssm:GetParameter* permission, and AWS documents that GetParametersByPath is authorised against the path requested rather than each parameter returned, so a broad path read pulls everything beneath it. Plaintext values also appear in tool output, CLI histories and logs wherever they are fetched.

Parameter types and what each protects

Type or optionValue at restWho can read the valueFit for secrets
StringNot encrypted by Parameter Store with your keyAnyone with ssm:GetParameter* on the parameter or an ancestor pathNo
StringListAs String, comma-separated valuesAs StringNo
SecureString with aws/ssmEncrypted with the AWS managed keyAnyone with ssm:GetParameter* who passes WithDecryption, because all principals in the account can use the keyPartly: encrypted and marked sensitive, but no second gate
SecureString with a customer managed keyEncrypted with your symmetric KMS keyPrincipals with ssm:GetParameter* and kms:Decrypt on the keyYes

AWS documents some details that matter for the migration. Only symmetric KMS keys can encrypt parameters. Standard tier SecureString values (up to 4 KB) are encrypted with a direct KMS Encrypt call, while advanced tier values (up to 8 KB) use envelope encryption with GenerateDataKey. A standard parameter can move to advanced, but not back. Parameter names and other metadata are never encrypted, so a name like /prod/payments/stripe-secret-key discloses what the value is to anyone who can list parameters.

Before you start

  • Two roles, kept separate: a discovery role with ssm:DescribeParameters only, which sees metadata and never values, and a tightly held review role with ssm:GetParameter on the candidate list, used only to confirm content.
  • Every Region: Parameter Store is regional, so repeat discovery in every enabled Region, including ones you do not expect to use.
  • Consumer map: the ability to search infrastructure as code, Lambda and ECS configuration, EC2 user data and application code for parameter names, so you know what breaks when a name changes.
  • A customer managed key: a symmetric KMS key per environment or application, with a key policy naming the roles that will read and write the new parameters. See the AWS KMS Security Guide.
  • Credential owners: for each secret you expect to find, who can rotate it at the source system (database, SaaS provider, internal service).

Step-by-step: find, migrate and rotate

  1. List unencrypted parameters. Call aws ssm describe-parameters with a ParameterFilters entry of Key=Type,Option=Equals,Values=String, then repeat for StringList. Page through with NextToken: AWS notes results are best effort and a page can contain fewer than MaxResults (up to 50) even when more exist. Record Name, Type, Tier, LastModifiedUser and LastModifiedDate.
  2. Rank by name. Flag names containing terms such as password, passwd, pwd, secret, token, apikey, api_key, private, credential, connection, dsn or webhook. Names give a first cut but miss secrets stored under neutral names such as /app/config.
  3. Confirm content with the review role. For flagged parameters and any JSON or connection-string style configuration blobs, fetch values with the review role and test them with secret detection patterns (provider key prefixes, private key headers, URLs with embedded credentials) and an entropy check. Run this in a controlled environment, do not write values to disk or logs, and record only the parameter name and the kind of secret found. See the Developer Secret Scanning Triage guide for classifying hits.
  4. Check history as well as the current value. Run get-parameter-history on parameters that are now harmless but were edited: a String that holds a placeholder today may hold a real password in an earlier version. Include history hits in your findings.
  5. Find the consumers. Search for each parameter name in templates and code. CloudTrail GetParameter, GetParameters and GetParametersByPath events show which roles read the parameter or its path recently.
  6. Create the replacement SecureString. Because the type cannot be changed, create a new parameter, for example /prod/payments/db-password-v2 or a new path such as /secure/prod/payments/db-password, with --type SecureString and --key-id set to your customer managed key. Omitting KeyId uses the AWS managed key. Use a fresh value from the rotation in step 8 where you can, so the new parameter never holds the exposed one.
  7. Move consumers. Update each consumer to the new name and to request decryption (WithDecryption in SDK calls). For CloudFormation, use the {{resolve:ssm-secure:name:version}} dynamic reference; AWS documents it only for a fixed list of properties (for example AWS::RDS::DBInstance MasterUserPassword) and states CloudFormation never stores the resolved value. Grant each consumer role kms:Decrypt on the key, ideally with a kms:EncryptionContext:PARAMETER_ARN condition naming the parameter.
  8. Rotate the credential. Change the password or key at the source system, write the new value to the SecureString, and confirm consumers pick it up. Treat this as mandatory for anything that sat in a String parameter that more than its owner could read.
  9. Remove the old parameter. When CloudTrail shows no reads of the old name over a full business cycle, delete it with delete-parameter. Then call get-parameter-history on the old name and confirm it returns ParameterNotFound, so you know no retained version still holds the plaintext. If you must reuse the exact name, AWS asks you to wait at least 30 seconds after deletion before creating it again.
  10. Record the change. Log the old name, new name, key used, consumers moved, rotation date and deletion date, as evidence for the review.

Decision guidance

SituationOptionTrade-off
Secret read by many roles in one account, no need to separate readersSecureString with aws/ssmNo key policy to maintain; SSM permissions are the only gate
Readers must be limited, or the secret is high valueSecureString with a customer managed keyKMS cost and key policy work; adds a second, independent gate
Secret needs scheduled rotation, versions with staging labels, or cross-account sharing by resource policyMove it to AWS Secrets Manager insteadDifferent API and cost model; see How to set up automatic rotation in AWS Secrets Manager
Value is not sensitive (feature flags, endpoints, AMI IDs)Keep as StringCheapest and simplest; keep it out of secret paths so reviews stay clean
  • New name or same name: a new name lets old and new run side by side and gives a clean rollback; reusing the name avoids consumer changes but forces a delete, a short outage window and the loss of rollback.
  • Small and large estates: in one account with a handful of parameters, fix by hand in one change window. Across an AWS Organization, run discovery centrally from a security account role in every member account and Region, and track fixes per owning team.

Verify it worked, and roll back

  • Type check: re-run the describe-parameters filter. Secret-named parameters should no longer appear as String, and the KeyId of new SecureString parameters should show your customer managed key rather than alias/aws/ssm.
  • Read check: a call without WithDecryption should return ciphertext, and a role without kms:Decrypt on the key should be refused decryption.
  • Consumer check: CloudTrail shows reads of the new name from every expected role and no reads of the old name.
  • Rollback: while the old parameter exists, point a failing consumer back at it. After deletion, rollback means writing the current value into a new parameter, so delete only after the business-cycle check. Keep the KMS key enabled: AWS lists a disabled or pending deletion key as a cause of InvalidKeyId errors.

Who can read a SecureString afterwards

Converting the type does not narrow who can read. AWS points out three behaviours that catch teams out:

  • Every read action needs its own control. Parameter Store authorises GetParameter, GetParameters, GetParametersByPath and GetParameterHistory separately. AWS warns that a principal denied the first three but allowed GetParameterHistory still sees current values, including SecureString values. Use ssm:GetParameter* in deny statements.
  • Path reads cover the whole subtree. A principal allowed GetParametersByPath on /prod receives /prod/payments/db-password even if another statement denies that parameter for other actions. To protect a branch, deny GetParametersByPath on every ancestor path, including /.
  • The default key decrypts for everyone in the account. To stop use of aws/ssm entirely, AWS suggests explicitly denying kms:Decrypt and kms:GenerateDataKey on its ARN.

For a structured review of policy wildcards, see How to find AWS IAM policies with wildcard actions.

Prevent recurrence and measure

  • Infrastructure as code checks: fail pipeline policy checks for AWS::SSM::Parameter or Terraform aws_ssm_parameter resources of type String whose names match secret terms, and for literal secret values in templates.
  • Deny by path: reserve a path such as /secure/ for secrets and use SCPs or permissions boundaries to block ssm:PutParameter under it except through approved deployment roles.
  • Change monitoring: alert on CloudTrail PutParameter events that create String parameters under secret paths, and on GetParameterHistory calls against secret paths by unexpected roles.

Metrics (sample targets, set your own):

  • Number of String or StringList parameters confirmed to contain secrets, trending to zero.
  • Percentage of SecureString parameters on a customer managed key, for paths classed as high value.
  • Percentage of migrated secrets rotated at the source after migration.
  • Median days from discovery to deletion of the old plaintext parameter.
  • Number of roles with GetParametersByPath on / or another root path.

Where identity fits

The readers of these parameters are mostly non-human identities: EC2 instance roles, Lambda execution roles, ECS task roles and deployment roles. Instance roles on managed nodes often receive wide ssm:GetParameters rights so that agents work, which quietly makes them readers of every plaintext value. Treat each reader as an identity with an owner and a scope, and see the How to audit who can read secrets in AWS Secrets Manager runbook for the same effective-access method applied to Secrets Manager.

Framework mapping

FrameworkReferenceHow this task supports it
NIST SP 800-53 Rev 5IA-5(7) No Embedded Unencrypted Static AuthenticatorsRemoves stored plaintext credentials
NIST SP 800-53 Rev 5SC-28 Protection of Information at Rest; SC-12 Cryptographic Key Establishment and ManagementEncrypts values under a managed key
NIST SP 800-53 Rev 5AC-6 Least PrivilegePath scoping and KMS key policy limit readers
NIST CSF 2.0PR.DS-01; PR.AA-05Data at rest protected; permissions managed with least privilege
ISO/IEC 27001:2022 Annex AA.5.17 Authentication information; A.8.24 Use of cryptographySecret authentication information stored protected
MITRE ATT&CK v20T1555.006 Cloud Secrets Management Stores; T1552.001 Credentials In FilesReduces credentials an attacker can read from cloud stores and configuration

Common failure patterns

  • Overwriting the value and calling it fixed. The old plaintext stays in version history and remains readable through GetParameterHistory until the parameter is deleted.
  • Converting without rotating. Encryption protects the value from now on; it does nothing about copies already read by people, tools and logs while it was plaintext.
  • Stopping at the AWS managed key. With aws/ssm, any principal with SSM read rights can decrypt, so a broad ssm:GetParameter* grant still exposes the secret.
  • Denying GetParameter alone. GetParameters, GetParametersByPath and GetParameterHistory stay open unless denied too.
  • Checking only names. Secrets in JSON configuration blobs and connection strings under neutral names are missed unless values are scanned.
  • Checking one Region. Parameters left in a test Region from an old deployment are a common blind spot.

Practitioner checklist

  • Run describe-parameters with Type filters for String and StringList in every Region.
  • Rank by name, then confirm content with a separate, tightly held review role.
  • Check version history of edited parameters for earlier plaintext secrets.
  • Map consumers from code, templates and CloudTrail before changing names.
  • Create new SecureString parameters with a customer managed key, scoped by path.
  • Rotate every credential that sat in plaintext.
  • Delete old parameters after a full business cycle and confirm history is gone.
  • Deny ssm:GetParameter* and ancestor-path GetParametersByPath where branches must be protected.
  • Add pipeline checks that block String parameters under secret paths.

Standards and references

Related NHI Mgmt Group resources: AWS Systems Manager Security Guide · Cloud Secrets Managers Guide · AWS KMS Security Guide · How to audit who can read secrets in AWS Secrets Manager

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.