For the complete documentation index, see llms.txt. This page is also available as Markdown.
Cortex CloudApplication Security

EC2 user data exposes secrets misconfiguration detected in code

Rule Details

Cortex AppSec Rule ID

APPSEC_AWS_46

Category - Subcategory

Public Exposure - Encryption And Protocols

Provider

AWS

Severity

HIGH

Framework

CloudFormation, Serverless, Terraform, Terraform Plan

Impact

User Data is a metadata field of an EC2 instance that allows custom code to run after the instance is launched. It contains code exposed to any entity which has the most basic access to EC2, even read-only configurations. This code is not encrypted. Removing secrets from easily-accessed unencrypted places reduces the risk of passwords, private keys and more from being exposed to third parties.

How to Fix

Resource: AWS::EC2::Instance

  • Argument: Properties.UserData [source,go]


Resources: Instance: Type: AWS::EC2::Instance Properties: ...

  • UserData: "..."


Last updated

Was this helpful?