Cross-source coverage
T1612 / ATT&CK
Build Image on Host
2 rules across 1 source.
From MITRE ATT&CK 20.1
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.
An adversary may take advantage of that build API to build a custom image on the host that includes malware downloaded from their C2 server, and then they may utilize Deploy Container using that custom image. If the base image is pulled from a public registry, defenses will likely not detect the image as malicious since it’s a vanilla image. If the base image already resides in a local registry, the pull may be considered even less suspicious since the image is already in the environment.
- Tactics
- Stealth
- Platforms
- Containers
- Telemetry
-
docker:daemonNSM:Flow
How MITRE says to detect it DET0459
Detection Strategy for Build Image on Host
Containers Analytic 1261
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.
docker:daemondocker build or POST /build API requestNSM:Flowoutbound connections from host during or immediately after image build
elastic/detection-rules
2 rules| Detection | Severity | Format |
|---|---|---|
| Container Image Built Inside a Container | Medium | Elastic TOML |
| Kubernetes Pod Creation Using Common Debug or Base Images | Low | Elastic TOML |