T1525: Implant Internal Image
Adversaries may implant cloud or container images with malicious code to establish persistence after gaining access to an environment. Amazon Web Services (AWS) Amazon Machine Images (AMIs), Google Cloud Platform (GCP) Images, and Azure Images as well as popular container runtimes such as Docker can be implanted or backdoored. Unlike Upload Malware, this technique focuses on adversaries implanting an image in a registry within a victim’s environment. Depending on how the infrastructure is provisioned, this could provide persistent access if the infrastructure provisioning tool is instructed to always use the latest image.
A tool has been developed to facilitate planting backdoors in cloud container images. If an adversary has access to a compromised AWS instance, and permissions to list the available container images, they may implant a backdoor such as a Web Shell.
Detection
ID | DS0007 | Data source and component | Image: Image Creation | Description | Monitor interactions with images and containers by users to identify ones that are added anomalously. |
---|
ID | DS0007 | Data source and component | Image: Image Metadata | Description | Periodically baseline virtual machine images to identify malicious modifications or additions. |
---|
ID | DS0007 | Data source and component | Image: Image Modification | Description | Monitor interactions with images and containers by users to identify ones that are modified anomalously. In containerized environments, changes may be detectable by monitoring the Docker daemon logs or setting up and monitoring Kubernetes audit logs depending on registry configuration. |
---|
Mitigation
ID | M1045 | Name | Code Signing | Description | Several cloud service providers support content trust models that require container images be signed by trusted sources. |
---|
ID | M1026 | Name | Privileged Account Management | Description | Limit permissions associated with creating and modifying platform images or containers based on the principle of least privilege. |
---|
ID | M1047 | Name | Audit | Description | Periodically check the integrity of images and containers used in cloud deployments to ensure they have not been modified to include malicious software. |
---|