Skip to content
Public AWS AMI Risks: whoAMI and Golden AMIs

Public AWS AMI Risks: whoAMI and Golden AMIs

Blog.Qualys • November 17, 2026

Public Amazon Machine Images (AMIs) speed up deployment, but anyone can publish one, so they should never be trusted based on their name or description alone.

Malicious or misconfigured AMIs can carry vulnerable software, embedded malware, exposed credentials, or insecure configurations that compromise workloads as soon as they launch.

The whoAMI attack, disclosed by Datadog Security Labs, shows how attackers can publish look-alike images that get picked up by pipelines that don’t verify the AMI owner.

A single compromised source image can spread through Golden AMIs to every account, region, and workload built from it, and images that aren’t rebuilt regularly drift out of date.

Validating image owners, rebuilding Golden AMIs regularly, using AWS Allowed AMIs, and continuously monitoring with Qualys TotalCloud help keep malicious and misconfigured images out of production.

A developer or CI/CD pipeline searches for an Amazon Machine Image (AMI) using a familiar image name. If the workflow does not verify the image’s owner, it may select a malicious image that resembles a trusted one. This is the risk highlighted by Datadog Security Labs’ whoAMI research: an image-selection mistake can introduce a supply chain compromise before an application even starts running.

The impact extends beyond image selection. Malicious or misconfigured AMIs can introduce vulnerable software, embedded malware, exposed credentials, or insecure configurations into newly launched EC2 instances. When such images are incorporated into Golden AMI workflows and reused across environments, the resulting risks can propagate to multiple workloads.

Securing AMIs therefore requires more than checking a few cloud configuration settings. Organizations need to validate image provenance, assess image contents before deployment, secure infrastructure automation, and monitor workloads for signs of compromise.

This article examines the risks associated with public and misconfigured AMIs, analyzes relevant attack scenarios, maps supported behaviors to the MITRE ATT&CK framework, and explores how AWS security controls and Qualys capabilities can help reduce risk throughout the AMI lifecycle.

AMIs Provide the Foundation for EC2 Deployments

An Amazon Machine Image (AMI) is a template used to launch Amazon EC2 instances. It includes the operating system, installed software, configuration, and storage mappings needed to create an instance.

AMIs can be private or public:

Private AMIs are shared with authorized AWS accounts and are commonly used to maintain standardized, organization-approved images.

Public AMIs are available to AWS customers in the region where they are shared. They allow organizations to reuse community- or vendor-provided images, reducing the effort required to prepare new EC2 instances.

Security Risks of Public AMIs

Using public AMIs introduces multiple security risks because organizations rely on third-party-maintained software and configurations.

The primary risks include:

Outdated operating systems and vulnerable software packages

Embedded malware or cryptominers

Hardcoded credentials or sensitive configuration files

Accidental publication of internal AMIs

Image impersonation through misleading names or descriptions

Supply chain compromise through insecure Golden AMIs

Although these risks differ in execution, they all originate from inadequate validation of image provenance and insufficient governance throughout the AMI lifecycle.

1. Malicious Public AMIs

Public AMIs published by unknown or untrusted users can intentionally contain malicious components designed to compromise workloads immediately after deployment.

Attackers may embed malware directly into an AMI before publishing it. Once an EC2 instance is launched, malicious payloads execute automatically, allowing attackers to establish persistence, communicate with command-and-control (C2) infrastructure, deploy ransomware, or mine cryptocurrency.

Vulnerable or Weaponized Software

Instead of embedding malware directly, attackers may intentionally distribute images containing outdated software with known vulnerabilities. Once deployed, these vulnerabilities can be exploited remotely to gain unauthorized access or to escalate privileges.

Image Impersonation (whoAMI Attack)

Datadog Security Labs disclosed the whoAMI attack, in which attackers publish malicious AMIs with names that closely resemble trusted vendor images.

If developers or automation pipelines for AMIs by image name alone, without validating the image owner, a malicious image may be selected and deployed instead of the legitimate one.

This attack demonstrates that image metadata can serve as an effective attack vector even when the infrastructure code remains unchanged.

2. Misconfigured AMIs Can Introduce Inherited Security Weaknesses

An AMI need not be intentionally malicious to pose security risks. Images containing outdated software, exposed secrets, or insecure system settings can carry these weaknesses into newly launched EC2 instances.

Common examples include:

Unpatched operating systems and software packages

Hardcoded credentials or sensitive configuration files

Embedded SSH private keys

Insecure SSH authentication settings

Unnecessary services or insecure system configurations

These weaknesses can increase the attack surface of instances launched from the image. Depending on the configuration and surrounding security controls, they may expose workloads to unauthorized access, credential compromise, or exploitation of known vulnerabilities.

Security risks can also arise during deployment. For example, attaching an overly permissive IAM role to an EC2 instance can grant compromised workloads access to cloud resources beyond what they require. Similarly, accidentally sharing an internal AMI can expose an image to unauthorized parties.

3. Supply Chain Risks from Golden AMIs

Golden AMIs provide a standardized and secure baseline for enterprise deployments. However, if the source image is compromised, all derived images inherit the same vulnerabilities.

For example, if an organization creates a Golden AMI from:

an untrusted public AMI,

a vulnerable marketplace image, or

an internally compromised image,

Every EC2 instance launched from that Golden AMI inherits the same weaknesses.

This significantly amplifies the impact of a single compromised image by propagating vulnerabilities across multiple AWS accounts, regions, and production environments.

Even well-maintained Golden AMIs become outdated if they are not rebuilt regularly.

Organizations often patch running instances while continuing to deploy new workloads from older images. This creates inconsistent security baselines, leaving newly launched systems vulnerable to already-patched CVEs.

AMI Inventory and Lineage Challenges

Large enterprises frequently maintain hundreds of AMIs across multiple AWS accounts and Regions.

Without centralized inventory and lineage tracking, security teams struggle to determine:

which workloads originated from vulnerable images,

which Golden AMIs inherited vulnerabilities,

which production systems require immediate remediation.

Maintaining complete image lineage significantly improves incident response and vulnerability management.

The following ATT&CK techniques represent behaviors that may occur across the AMI attack scenarios discussed in this article. Not every technique is necessarily present in every attack.

End-to-End Attack Scenario

A realistic attack chain may unfold as follows:

An attacker publishes a malicious public AMI using a trusted-looking name.

A developer or CI/CD pipeline searches for an image without validating the owner.

The malicious image is selected and used to create an internal Golden AMI.

The Golden AMI is replicated across multiple AWS accounts and Regions.

New EC2 instances inherit the malicious software or insecure configurations.

Malware establishes persistence and communicates with attacker-controlled infrastructure.

Attackers steal credentials, escalate privileges, move laterally, and compromise additional cloud resources.

Deploying a malicious or misconfigured AMI can lead to:

Unauthorized access to EC2 instances

Cryptocurrency mining

Increased cloud costs

Lateral movement across AWS resources

Supply chain compromise

Regulatory and compliance violations

Mitigation and Best Practices

Organizations should prevent vulnerable AMIs from entering production by implementing strong governance controls.

Recommended practices include:

Assess AMIs for vulnerabilities before deployment using services such as Amazon Inspector or Qualys TotalCloud AMI Scan.

Build and regularly rebuild Golden AMIs through CI/CD pipelines.

Automate Golden AMI creation and validation through CI/CD pipelines, incorporating the latest operating system patches, security updates, and hardened configurations before images are approved and distributed. Periodically rebuild and retire outdated images to prevent version drift, which can cause newly launched EC2 instances to inherit unpatched software, known vulnerabilities, or deprecated security configurations. This helps maintain consistent security baselines across deployments.

Validate image provenance by verifying publisher identity and AMI owner IDs.

Always define the AMI owner ID to prevent name confusion attacks.

AWS warning when omitting owners:

Restrict public sharing of internally created AMIs.

Avoid making AMIs public unless necessary and ensure all sensitive data is removed beforehand.

Use AWS Allowed AMIs to enforce trusted image sources.

Utilize AWS’s Allowed AMIs feature to enforce trust boundaries and restrict instance launches to vetted image sources.

The core configuration for Allowed AMIs is the ImageCriteria configuration that defines the criteria for allowed AMIs. The following JSON structure shows the parameters that can be specified:

Treat AMIs as third-party software dependencies that require security review before approval.

Continuous monitoring is equally important.

Organizations should:

Monitor AWS CloudTrail for AMI creation, modification, sharing, and launch events.

Detect EC2 instances launched from unknown or unapproved AMIs.

Alert when AMIs become publicly accessible.

Monitor image usage across AWS accounts.

Enable drift detection for Golden AMIs.

Continuously scan deployed workloads for inherited vulnerabilities.

Governance and Lifecycle Management

Effective AMI governance extends beyond deployment.

Organizations should:

Maintain a centralized inventory of approved AMIs.

Track AMI lineage to understand parent-child image relationships.

Periodically review sharing permissions.

Remove obsolete or unused AMIs.

Integrate AMI validation into change management and deployment workflows.

Securing the AWS AMI Lifecycle with Qualys

Securing AMIs requires visibility and protection across multiple stages of the cloud deployment lifecycle. Organizations must assess images before deployment, identify infrastructure misconfigurations, monitor deployed workloads, and respond to potential threats.

Qualys provides capabilities across these stages through its TotalCloud CNAPP platform and complementary vulnerability management and endpoint security solutions.

1. Assess AMIs Before Deployment

Qualys TotalCloud provides an AMI Scan capability that uses snapshot-based scanning to assess Amazon Machine Images before deployment, without requiring an EC2 instance to be launched or an agent to be installed.

The assessment helps identify operating system vulnerabilities, missing patches, outdated software components, and configuration issues within AMIs.

Integrating AMI scanning into image-building and Golden AMI promotion workflows allows security teams to assess images before they are approved for production use. This helps reduce the likelihood of deploying images containing known security weaknesses.

However, vulnerability assessment alone does not establish the authenticity of an AMI publisher or guarantee that an image is free from malicious code. Organizations should continue to validate AMI ownership and publisher information using AWS-native controls.

2. Identify Infrastructure Misconfigurations Before Deployment

Qualys Infrastructure as Code (IaC) Security helps identify security misconfigurations in supported infrastructure templates before resources are deployed.

This complements AMI scanning by assessing the infrastructure deployment process, helping organizations identify configuration weaknesses that could expose EC2 workloads.

3. Strengthen Cloud Posture and Workload Security

Qualys TotalCloud combines Cloud Security Posture Management (CSPM), Cloud Workload Protection (CWP), and Cloud Infrastructure Entitlement Management (CIEM) capabilities to provide visibility into cloud security risks.

These capabilities help organizations:

Identify cloud misconfigurations, including relevant AMI exposure, encryption, and launch-permission issues.

Assess vulnerabilities across supported cloud workloads and prioritize remediation based on risk.

Identify excessive cloud permissions and risky identity relationships that could increase the impact of a compromised workload.

This helps security teams understand not only the security state of an AMI, but also the configuration and identity risks associated with the EC2 instances launched from it.

4. Remediate Vulnerabilities and Automate Security Workflows

Identifying vulnerabilities is only one part of securing the AMI lifecycle. Organizations must also ensure that identified weaknesses are addressed across running workloads and future image builds.

Qualys Vulnerability Management, Detection and Response (VMDR) helps identify and prioritize vulnerabilities across supported assets. Qualys Patch Management can support deploying applicable security patches to supported running workloads.

Qualys Flow and TotalCloud workflow automation capabilities can further help operationalize security findings through customized remediation workflows, incident routing, and supported integrations.

For Golden AMI environments, organizations should incorporate remediation into their image-building pipelines and periodically rebuild approved images to ensure that future deployments inherit updated security baselines.

Extending Image Security Across Multi-Cloud Environments

Although this article focuses on AWS AMIs, similar risks exist across cloud platforms wherever organizations use reusable machine images to provision workloads. Azure and Google Cloud Platform (GCP), for example, provide image services that allow teams to create, , and reuse standardized images across their environments.

The terminology and image-sharing mechanisms differ across providers, but the underlying security concerns remain similar: an image may contain outdated software, insecure configurations, or embedded sensitive information, while insufficient governance can expose internally maintained images or allow untrusted images to enter deployment workflows.

Across these platforms, organizations should maintain visibility into image metadata and apply consistent governance practices. This includes identifying image owners and sources, restricting access to approved images, reviewing sharing permissions, assessing image contents for vulnerabilities and exposed secrets, and periodically retiring outdated images.

For organizations operating in multi-cloud environments, centralized cloud security monitoring can help identify configuration weaknesses and exposure to vulnerabilities across image-related resources and the workloads launched from them. Qualys capabilities such as cloud posture assessment, image vulnerability scanning, infrastructure-as-code security, and workload protection can contribute to this broader security approach, subject to the supported cloud services and product configurations.

Treating machine images as part of the software supply chain, rather than simply as infrastructure artifacts, helps organizations apply consistent security governance from image creation through deployment and ongoing workload operation.

Public AMIs provide significant operational benefits, but they should never be trusted by default. As cloud-native deployments become increasingly automated, AMIs have become critical components of the software supply chain whose integrity directly affects the security of downstream workloads.

Securing the AMI lifecycle requires organizations to validate image sources, assess images for vulnerabilities before deployment, maintain governed Golden AMI workflows, and continuously monitor the workloads launched from them. AWS-native capabilities such as Allowed AMIs help restrict image usage to approved sources, while security solutions such as Qualys TotalCloud help identify image vulnerabilities, cloud misconfigurations, and risks across deployed workloads.

Start with your AMI selection process: review your existing image lookup and deployment workflows to ensure that every AMI is validated against an approved owner or source before use. Then assess the image for vulnerabilities before promoting it into your Golden AMI pipeline.

To strengthen visibility and security across your cloud environments, explore how Qualys TotalCloud supports cloud posture management, AMI vulnerability assessment, and ongoing workload security.

If you’re not yet using Qualys TotalCloud to assess AMIs before deployment, identify cloud misconfigurations, and monitor the workloads launched from them, start a free trial today.

Frequently Asked Questions (FAQs)

What is the whoAMI attack?

Attackers publish malicious AMIs with names that resemble trusted vendor images. Pipelines that by name and do not verify the owner can select the malicious image.

Is a public AMI safe if the name looks official?

No. Anyone can publish a public AMI. Trust comes from the owner ID and publisher, not the name or description.

What does Qualys TotalCloud AMI Scan check?

It uses snapshot-based scanning to assess an AMI before deployment, without launching an instance or installing an agent. It helps find operating system vulnerabilities, missing patches, outdated software, and configuration issues.

Does AMI Scan prove the image is not malicious?

No. It does not establish publisher authenticity or guarantee an image is free of malicious code. Validate ownership with AWS controls, including Allowed AMIs and owner ID.

Why rebuild Golden AMIs?

Patching running instances does not update the image. New launches from an old Golden AMI inherit already-patched CVEs. Rebuild and retire outdated images on a schedule.