Last updated
Last updated
Plaintext or hard-coded secrets can be found in many resources throughout AWS if there is poor hygiene in the management of secrets.
CloudFormation is an AWS infrastructure-as-code solution written in JSON or YAML
Secrets can end up hard-coded in EC2 user-data and can easily be discovered either with the action ec2:DescribeInstanceAttribute
or by querying the IMDS service
Version 2 of IMDS requires obtaining a token first
EC2 Launch Templates allow for defining consistent configurations (Security Groups, IMDS, Instance types, User Data, etc.) for any EC2 that uses the template
So User Data can also be found in the templates
EBS Snapshots are backups of EC2 instances and may have secrets and credentials stored on them
EBS snapshots are regional so make sure to check each region
Environment variables are commonly used for storing data used by the lambda function
The code of the function may also contain information
RDS Snapshots are backups of RDS instances and may contain valuable data
RDS snapshots are regional so make sure to check each region
SSM Documents allow you to run automations and commands on EC2s and may contain sensitive data
You can reference Systems Manager parameters in your scripts, commands, SSM documents, and configuration and automation workflows
If the data is not encrypted and/or you have access to decrypt the data, Terraform State files often contain secrets, credentials, and information about the cloud environment
See also
See also
See also
While not an AWS resource, Terraform State files are commonly stored in
Tips and tricks for discovering secrets in AWS