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]
攻撃者は、パブリックレジストリから悪意のあるイメージを取得することを監視する防御策を回避するために、ホスト上でコンテナイメージを直接構築することができます。リモートビルドリクエストは、Docker APIに送信され ます。そこには、alpineのような vanilla
イメージをパブリックまたはローカルレジストリから取得し、その上にカスタムイメージをビルドする Dockerfileが含まれています。
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 then may
utilize Deploy Container using that custom image.[2][3] 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.
([2]の日本語訳 脅威:攻撃者が悪意あるイメージをホスト上に直接ビルド)
(メモ DockerAPI
を標的とした探索行為の増加等について、セキュアでないDockerデーモンへの攻撃者の戦術とテクニックが明らかに 地理的分布で日本は全体の3.7%)
ID | Mitigation | Description |
---|---|---|
M1047 | Audit |
Audit images deployed within the environment to ensure they do not contain any malicious components. |
M1035 | Limit Access to Resource Over Network |
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.[4] コンテナサービスとの通信を、ローカルのUnixソケットまたはSSH経由のリモートアクセスに制限する。ポート2375上のDocker APIへの認証されていないアクセスを無効にすることで、TLS上でAPIと通信するために安全なポートアクセスを要求する。代わりに、ポート2376でTLSを介してDocker APIと通信する。 |
M1030 | Network Segmentation |
Deny direct remote access to internal systems through the use of network proxies, gateways, and firewalls. |
M1026 | Privileged Account Management |
Ensure containers are not running as root by default. In Kubernetes environments, consider defining a Pod Security Policy that prevents pods from running privileged
containers.[5] |
ID | Data Source | Data Component | Detects |
---|---|---|---|
DS0007 | Image | Image Creation |
Monitor for unexpected Docker image build requests to the Docker daemon on hosts in the environment. |
DS0029 | Network Traffic | Network Connection Creation |
Monitor for established network communications with anomalous IPs that have never been seen before in the environment that may indicate the download of malicious code. |
Network Traffic Content |
Monitor for network traffic associated with requests and/or downloads of container images, especially those that may be anomalous or known malicious. |
||
Network Traffic Flow |
Monitor for established network communications with anomalous IPs that have never been seen before in the environment that may indicate the download of malicious code. |