thinkst / opencanary

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

Try to get iptables path from $PATH #232

Closed vin01 closed 1 year ago

vin01 commented 1 year ago

It will allow using iptables path from $PATH using which. Using /sbin/iptables as a fallback might still be a good idea if no $PATH is set

Docs for shutil.which: https://docs.python.org/3/library/shutil.html#shutil.which

it might address https://github.com/thinkst/opencanary/issues/228 if $PATH is correctly set, if it is not set, it can be set explicitly to ensure right path is used.

jayjb commented 1 year ago

Hi @vin01,

Sorry for the wait. Thank you so much for this. Its great. I think that we can extend it even more to grab a path from the config file that we can specify (but no necessary for now)