Check provider logo

CloudFormation stack outputs do not contain secrets

cloudformation_stack_outputs_find_secrets

Severitycritical
by Prowler

CloudFormation stack Outputs are analyzed for hardcoded secrets-passwords, API keys, tokens-using pattern-based detection across output values. A finding indicates potential secret strings present within Outputs of the template or stack.

Risk

Secrets in Outputs are readable to anyone with stack metadata access, enabling credential theft, unauthorized API calls, and lateral movement. Exposure via consoles, exports, or CI logs undermines confidentiality and can lead to privilege escalation and data exfiltration.

Run this check with Prowler CLI

prowler aws --checks cloudformation_stack_outputs_find_secrets

Recommendation

Remove secrets from Outputs. Store credentials in Secrets Manager or Parameter Store and reference them via dynamic references; set NoEcho for sensitive parameters. Apply least privilege to view stack metadata, avoid exporting sensitive values, and add automated IaC secret scanning for defense in depth.

Remediation

CLI

aws cloudformation update-stack --stack-name <STACK_NAME> --template-body file://<TEMPLATE_WITHOUT_SENSITIVE_OUTPUTS>.yaml

Native IaC
Terraform
Other
  1. In the AWS Console, go to CloudFormation > Stacks and select the stack
  2. Click Update > Replace current template
  3. Upload or paste the template with any secret-bearing Outputs removed (do not output passwords/tokens/keys)
  4. Click Next through the wizard and choose Submit to apply the change set
  5. Verify the stack Outputs tab no longer shows sensitive values

Source Code

Resource Type

AwsCloudFormationStack

References