T1525
Implant Internal Image
Adversaries may implant cloud or container images with malicious code to establish persistence after gaining access to an environment. AWS AMIs, GCP Images, Azure Images, and container registries such as ECR, ACR, and Docker Hub private registries can be backdoored. Unlike uploading malware to external infrastructure, this technique focuses on modifying or creating images within a victim's own cloud environment. If the infrastructure provisioning pipeline is configured to always pull the latest image, a backdoored image ensures persistent access to any newly spun-up instance.
Microsoft Sentinel / Defender
kusto
let AwsImageOps = dynamic([
"CreateImage", "RegisterImage", "CopyImage", "ImportImage",
"ModifyImageAttribute", "ImportSnapshot", "CreateSnapshot",
"PutImage", "BatchDeleteImage", "InitiateLayerUpload", "CompleteLayerUpload"
]);
let AzureImageOps = dynamic([
"microsoft.compute/images/write",
"microsoft.compute/galleries/images/versions/write",
"microsoft.containerregistry/registries/push/action",
"microsoft.containerregistry/registries/importimage/action",
"microsoft.compute/virtualmachines/capture/action"
]);
// AWS EC2 / ECR image operations ingested via AWS CloudTrail connector
AWSCloudTrail
| where TimeGenerated > ago(24h)
| where EventSource in ("ec2.amazonaws.com", "ecr.amazonaws.com")
| where EventName in (AwsImageOps)
| extend ActorIdentity = UserIdentityArn
| extend ActorType = UserIdentityType
| extend SourceIP = SourceIpAddress
| extend IsRootActor = (UserIdentityType =~ "Root")
| extend IsExternalIP = (SourceIpAddress !startswith "10." and SourceIpAddress !startswith "192.168." and SourceIpAddress !startswith "172." and SourceIpAddress !startswith "fd" and SourceIpAddress != "AWS Internal")
| extend RequestedResource = tostring(parse_json(RequestParameters).name)
| project TimeGenerated, Platform="AWS", EventName, ActorIdentity, ActorType, SourceIP,
IsRootActor, IsExternalIP, RequestedResource, RequestParameters, UserAgent
| union (
// Azure Compute and Container Registry image operations
AzureActivity
| where TimeGenerated > ago(24h)
| where tolower(OperationNameValue) in (AzureImageOps)
| where ActivityStatusValue =~ "Succeeded"
| extend ActorIdentity = Caller
| extend SourceIP = CallerIpAddress
| extend IsExternalIP = (CallerIpAddress !startswith "10." and CallerIpAddress !startswith "192.168." and CallerIpAddress !startswith "172.")
| extend RequestedResource = tostring(parse_json(tostring(Properties)).resource)
| project TimeGenerated, Platform="Azure", EventName=OperationNameValue, ActorIdentity,
ActorType="AzureIdentity", SourceIP, IsRootActor=false, IsExternalIP,
RequestedResource, RequestParameters=tostring(Properties), UserAgent=""
)
| sort by TimeGenerated desc high severity
medium confidence
Data Sources
Cloud: Cloud Service Modification AWS CloudTrail Azure Activity Log Cloud: Cloud Storage Object Modification
Required Tables
AWSCloudTrail AzureActivity
False Positives
- CI/CD pipeline automation creating golden AMIs or base container images as part of a legitimate image build and push workflow (e.g., Packer, GitHub Actions, Jenkins pipelines)
- Cloud operations engineers capturing VM images for disaster recovery, golden image refresh, or compliance-mandated snapshots
- Infrastructure-as-code tools (Terraform, Pulumi, CDK) creating or modifying images during automated provisioning runs
- Container registry mirroring jobs that replicate approved public images into an internal private registry for air-gapped or compliance use
- Security teams creating forensic images from compromised instances as part of an incident response workflow
Last updated: 2026-03-15 Research depth: deep
References (11)
- https://attack.mitre.org/techniques/T1525/
- https://rhinosecuritylabs.com/aws/cloud-container-attack-tool/
- https://github.com/RhinoSecurityLabs/ccat
- https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami-ebs.html
- https://docs.aws.amazon.com/AmazonECR/latest/userguide/image-push.html
- https://docs.microsoft.com/en-us/azure/container-registry/container-registry-intro
- https://cloud.google.com/compute/docs/images/create-delete-deprecate-private-images
- https://learn.microsoft.com/en-us/azure/sentinel/data-connectors/amazon-web-services
- https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference.html
- https://sysdig.com/blog/container-image-scanning/
- https://falco.org/docs/rules/default-macros/
Unlock Pro Content
Get the full detection package for T1525 including response playbook, investigation guide, and atomic red team tests.
Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance