Check ID:
Provider: AWS
Service:
Severity: HIGH
Categories:
Resource type:
ec2_launch_template_no_secretsProvider: AWS
Service:
ec2Severity: HIGH
Categories:
secretsResource type:
AwsEc2LaunchTemplateWhat this check verifies
EC2 launch template user data is analyzed across versions to identify embedded secrets-hard-coded passwords, tokens, API keys, or private keys-within the startup scripts or configuration supplied to instances.Risk
Secrets in user data can be read by identities able to view launch templates, eroding confidentiality. Exposed credentials enable unauthorized API actions, data exfiltration, and lateral movement. Past template versions retain leaked values, complicating rotation and recovery.Recommendation
Keep user data free of secrets. Retrieve sensitive values at runtime from AWS Secrets Manager or SSM Parameter StoreSecureString using instance roles.
Enforce least privilege, rotate to short-lived credentials, and review template history; if exposure occurred, rotate affected secrets.
Remediation
- Terraform
- Native IaC
- Dashboard steps
References
- https://docs.aws.amazon.com/secretsmanager/latest/userguide/intro.html
- https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html
- https://support.icompaas.com/support/solutions/articles/62000233727-ensure-no-secrets-are-hardcoded-in-ec2-launch-templates
Where this check fires
This check runs on every scheduled scan against your AWS account. Findings appear at Cloud Security → Findings filterable byCheck ID = ec2_launch_template_no_secrets. To re-evaluate after a fix, hit Run now on the account’s schedule under Cloud Security → Schedules — the next scan re-checks this control and marks the finding fixed or keeps it persistent.
← Back to AWS checks