简体   繁体   English

docker host 可以拦截容器内的本地流量吗?

[英]Can docker host intercept local traffic inside a container?

Is it possible for the docker host to observe the communication between two processes running inside the same container? docker 主机是否可以观察运行在同一个容器内的两个进程之间的通信? The processes use TCP on localhost for communication.这些进程使用本地主机上的 TCP 进行通信。

Most of the documentation I see talk about sniffing on the docker0 interface or any interface created by docker-compose.我看到的大多数文档都在谈论嗅探 docker0 接口或由 docker-compose 创建的任何接口。 But this would be outbound/inbound traffic on the network interface.但这将是网络接口上的出站/入站流量。 In my case all communication is local.就我而言,所有通信都是本地的。

在此处输入图片说明

I used bpftrace with tcpconnect.bt (or tcpaccept.bt) as you can see it can observe container localhost to container localhost tcp connect (or accept)我将 bpftrace 与 tcpconnect.bt(或 tcpaccept.bt)一起使用,因为您可以看到它可以观察容器 localhost 到容器 localhost tcp connect(或接受)

if you want to more detail, you could write your own bpf program如果你想更详细,你可以编写自己的 bpf 程序

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何拦截来自 docker 容器的 UDP 流量? - How to intercept UDP traffic from a docker container? 如何用 Burp 拦截 Docker 的容器流量? - How to intercept Docker's container traffic with Burp? 无法从 docker 容器内部连接到 RDS,我可以从主机连接到 RDS,也可以从本地 docker 容器连接到 RDS - Cannot connect to RDS from inside a docker container, I can from the host, and I can from a local docker container 运行接受来自主机的流量的 Docker 容器 - Running a Docker container that accept traffic from the host 您可以将文件从 Docker 容器复制到本地主机吗? - Can you copy files from Docker container to local host? Docker 容器内无法访问主机 - Host unreachable inside Docker container git clone无法到达docker容器内的主机 - git clone can not reach host inside docker container Docker主机安全性 - 容器可以运行危险代码还是从容器内部更改主机? - Docker Host Security - Can container run dangerous code or change host from inside of a container? 如何在Docker容器中运行Docker主机? - How to run a Docker host inside a Docker container? 配置apache2和主机以使用nginx将流量传递到docker容器 - Configure apache2 and host to pass traffic to a docker container with nginx
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM