jvinet / knock

A port-knocking daemon
http://www.zeroflux.org/projects/knock
GNU General Public License v2.0
549 stars 113 forks source link

On_start directive #51

Open debuti opened 6 years ago

debuti commented 6 years ago

Since the most common use case for this project would be to enable and disable some rules in iptables i think it would be awesome to have a on_start directive to ensure that the traffic is blocked only if knockd is up and running. Im thinking something like

[options]
    UseSyslog
    on_start = iptables -P INPUT DROP

Thanks for the project, its awesome

PD. I know you could always do a crontab trick like @reboot sleep 60 && knock <ip> 50505 20202 60606 but this proposal is more elegant.

o-jasper commented 6 years ago

Could also manually do this. In case of systemd, could make a modified version of /usr/lib/systemd/system/knockd.conf(edit: more likely .service). Probably could even make systemd aware that running the program is a precondition.(not sure what that's useful for)