On 24.04.2015 10:38, Laurens Blankers wrote:
The Shorewall documentation provides a custom Perl action to perform
stateful port knocking:
http://shorewall.net/Events.html#Stateful
However I believe it is also possible using just the events
functionality without any custom code.
Here are the rules I use to achieve the same result:
# IF connection on port 52245 THEN set event A1
Set(A1) net $FW tcp 52245
# IF connection on port 15623 AND event A1 is set THEN set event A2
CondSet(A1,A2) net $FW tcp 15623
# IF connection on port 19845AND event A2 is set THEN set event A3
CondSet(A2,A3) net $FW tcp 19845
# IF connection on port 22 AND event A3 is set THEN accept
Cond(A3) net $FW tcp 22
And here are the custom actions:
action.Set:
---
?format 2
SetEvent($1) - -
---
action.CondSet:
---
?format 2
DEFAULTS -,-,60
IfEvent($1,Set($2):info,$3) - -
---
action.Cond:
---
?format 2
DEFAULTS -,ACCEPT,60
IfEvent($1,$2:info,$3) - -
---
(don't forget to add them to actions as well)
Enjoy,
Laurens
Laurens,
Use my correct statefull portknocking from here:
http://shorewall.net/Events.html#Stateful
If you have any questions feel free to ask.
Ciao,
Gerhard
http://www.wiesinger.com/
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Shorewall-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/shorewall-users