请问支持java的https拦截吗 #316
-
Beta Was this translation helpful? Give feedback.
Replies: 9 comments 1 reply
-
目前不支持。 未来1年内也没这方面规划。 |
Beta Was this translation helpful? Give feedback.
-
实际上也看了一些业内其他观测工具,比如 deepfow,也没法支持 Java 层面的 https,Java 的 https 实现是 JSSE,纯 Java 实现的,底层没有使用 OpenSSL,所以没法 hook |
Beta Was this translation helpful? Give feedback.
-
你想说的是拦截Block,还是捕获capture ? eCapture未来不会规划拦截Block的功能。 java的HTTPS捕获,也是可以通过eBPF实现,可以参考 this.javaManager = &manager.Manager{
/*
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-8u292-b10-0ubuntu1-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)
*/
//ex, err := link.OpenExecutable("/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libjava.so")
// sub_19C30 == JDK_execvpe(p->mode, p->argv[0], p->argv, p->envv);
// md5sum : 38590d0382d776234201996e99487110 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libjava.so
Probes: []*manager.Probe{
{
Section: "uprobe/JDK_execvpe",
EbpfFuncName: "java_JDK_execvpe",
AttachToFuncName: "JDK_execvpe",
UprobeOffset: 0x19C30,
BinaryPath: "/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/libjava.so",
},
},
Maps: []*manager.Map{
{
Name: "jdk_execvpe_events",
},
},
} |
Beta Was this translation helpful? Give feedback.
-
这种方法确实可以完成追踪,不过要开启jvm参数,而且性能损耗比较大,我们内部的方案可能不太满足,给产品做的,不能重启产品服务,也更改不了产品配置,只能通过旁挂的形式进行拦截,ebpf的方法只能拦截基于ssllib.so加密的,想java这种在语言层面进行加解密的估计只能通过动态attach了 |
Beta Was this translation helpful? Give feedback.
-
你试试agentmain的字节吗注入,来HOOK呢?就是rasp的实现机制。 |
Beta Was this translation helpful? Give feedback.
-
我们有考虑过这种方案,有个难点在于如何跟三方工具集成,如何将同一个链路的各层动作串起来。单独采集的java数据比较独立,难以跟下层的数据做联动 |
Beta Was this translation helpful? Give feedback.
-
进程ID+TCP五元组 |
Beta Was this translation helpful? Give feedback.
-
这个问题不是issue,改为讨论帖了... |
Beta Was this translation helpful? Give feedback.
你想说的是拦截Block,还是捕获capture ?
eCapture未来不会规划拦截Block的功能。
java的HTTPS捕获,也是可以通过eBPF实现,可以参考
https://github.com/ehids/ehids-agent/blob/d35910880a486830f39cb0c0512f4bd467209a79/user/probe_ujava_rasp.go#L82-L100