Build Image on Host T1612
- Tactic
- Stealth
- Platform
- Containers
- Version
- 2.0
- Created
- 30 March 2021
- Last modified
- 12 May 2026
- Contributors
- Assaf Morag, @MoragAssaf, Team Nautilus Aqua Security; Roi Kol, @roykol1, Team Nautilus Aqua Security; Michael Katchinskiy, @michael64194968, Team Nautilus Aqua Security; Vishwas Manral, McAfee
Adversaries may build a container image directly on a host to bypass defenses that monitor for the retrieval of malicious images from a public registry. A remote build request may be sent to the Docker API that includes a Dockerfile that pulls a vanilla base image, such as alpine, from a public or local registry and then builds a custom image upon it.[1]
Offense vs defense T1612
Is defensive coverage keeping up with adversary use? Eight counts, each ranked against all 697 ATT&CK techniques. Attack sits left, defense right, so a shape leaning left means adversaries are better documented here than defenders are equipped. Hover any spoke for its percentile and the share of techniques that have more. The timeline below shows when each side arrived.
Build Image on Host detection strategy DET0459
MITRE names one behaviour worth catching for this technique and breaks it into 1 analytic, one per platform. Each carries the log sources it needs and the fields you tune per environment.
Detection Strategy for Build Image on Host
AN1261 · Containers
Detection of container image build activity directly on the host using Docker or Kubernetes APIs. Defenders may observe Docker build requests, anomalous Dockerfile instructions (such as downloading code from unknown IPs), or creation of new images followed by immediate deployment. This behavior chain typically consists of an unexpected image creation event correlated with outbound network communication to non-standard or untrusted destinations.
Log sources
The data this analytic draws on. You do not need every component — each one you already collect covers part of it. Each links to its ATT&CK record.
| Data component | Name | Channel |
|---|---|---|
| Image CreationDC0015 | docker:daemon | docker build or POST /build API request |
| Network Connection CreationDC0082 | NSM:Flow | outbound connections from host during or immediately after image build |
Tunable fields
MITRE calls these the analytic’s mutable elements: the thresholds and filters you set for your own environment.
| Field | What you tune |
|---|---|
| RegistryAllowList | Defines trusted registries for image pulls/builds. Builds referencing unapproved registries may indicate adversary behavior. |
| NewImageThreshold | Threshold for number of new custom images created in a given time window. Exceeding this threshold may indicate malicious builds. |
| TimeWindow | Defines correlation window (e.g., 5m) between suspicious build activity and subsequent network traffic anomalies. |
Audit images deployed within the environment to ensure they do not contain any malicious components.
Limit communications with the container service to local Unix sockets or remote access via SSH. Require secure port access to communicate with the APIs over TLS by disabling unauthenticated access to the Docker API on port 2375. Instead, communicate with the Docker API over TLS on port 2376.
Deny direct remote access to internal systems through the use of network proxies, gateways, and firewalls.
Ensure containers are not running as root by default. In Kubernetes environments, consider defining Pod Security Standards that prevent pods from running privileged containers.
Tests from Atomic Red Team (MIT licence) · technique definition