thinkst / opencanary

Modular and decentralised honeypot
http://opencanary.org
BSD 3-Clause "New" or "Revised" License
2.27k stars 355 forks source link

Issue with the portscan feature, when running in docker. #244

Closed ristianhansen closed 1 year ago

ristianhansen commented 1 year ago

Hi,

So im currently trying to run Opencanary with docker, and it works just fine. But im having an issue with the canary not detecting portscans against it, when its running in docker. I have no problem getting alerts, when opencanary is runned in a python virtuel environment. In the log from the container, i can se there is a: /sbin/iptables: command not found. Can this be the issue?

I have build the dockerimage from the Dockerfile.stable (and .latest), but seem to be the same issue im having. i run it with the argument --network host (to get the src_ip from the docker host, so its not the ip_src of the container that is present in the log).

Hope you can help.

jayjb commented 1 year ago

Hi @ristianhansen,

Thanks for reporting this in so that we can help you figure it out. The portscan feature makes use of iptables so you are correct that iptables not found would be the cause of this issue.

Since docker already does some networking magic to ensure that the container works with the host machine's network stack, I don't think it will allow us to do iptables stuff. This would mean that if you are running opencanary in the dockerised version, it wont support the portscan feature.

I'll add this information to the wiki as well as try add some guard rails.

jayjb commented 1 year ago

Added to https://github.com/thinkst/opencanary/wiki