From 1fe554dd2508db99c59763753de4df369b0c54b5 Mon Sep 17 00:00:00 2001 From: Juliano Jeziorny Date: Thu, 19 Jan 2017 14:30:25 +0100 Subject: [PATCH 1/2] Introduced Citrix Netscaler action --- ChangeLog | 8 ++++++++ config/action.d/netscaler.conf | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 config/action.d/netscaler.conf diff --git a/ChangeLog b/ChangeLog index 0fd91b70..843cb0a0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -26,6 +26,14 @@ releases. ### Enhancements +ver. 0.9.7 (2016/19/01) +----------- + +### New Features +* New Actions: + - action.d/netscaler: Block IPs on a Citrix Netscaler ADC (gh-1663) + + ver. 0.9.6 (2016/12/10) - stretch-is-coming ----------- diff --git a/config/action.d/netscaler.conf b/config/action.d/netscaler.conf new file mode 100644 index 00000000..87f7e7bf --- /dev/null +++ b/config/action.d/netscaler.conf @@ -0,0 +1,33 @@ +# Fail2ban Citrix Netscaler Action +# by Juliano Jeziorny +# juliano@jeziorny.eu +# +# The script will add offender IPs to a dataset on netscaler, the dataset can then be used to block the IPs at a cs/vserver or global level +# This dataset is then used to block IPs using responder policies on the netscaler. +# +# The script assumes using HTTPS with unsecure certificate to access the netscaler, +# if you have a valid certificate installed remove the -k from the curl lines, or if you want http change it accordingly (and remove the -k) +# +# This action depends on curl +# +# You need to populate the 3 options inside Init +# +# ns_host: IP or hostname of netslcaer appliance +# ns_auth: username:password, suggest base64 encoded for a little added security (echo -n "username:password" | base64) +# ns_dataset: Name of the netscaler dataset holding the IPs to be blocked. +# +# For further details on how to use it please check http://blog.ckzone.eu/2017/01/fail2ban-action-for-citrix-netscaler.html + +[Init] +ns_host = +ns_auth = +ns_dataset = + +[Definition] +actionstart = curl -kH 'Authorization: Basic ' https:///nitro/v1/config + +actioncheck = + +actionban = curl -k -H 'Authorization: Basic ' -X PUT -d '{"policydataset_value_binding":{"name":"","value":""}}' https:///nitro/v1/config/ + +actionunban = curl -H 'Authorization: Basic ' -X DELETE -k "https:///nitro/v1/config/policydataset_value_binding/?args=value:" From 75b252e47f19976aeb5a112b9b8e1786b2340500 Mon Sep 17 00:00:00 2001 From: "Serg G. Brester" Date: Thu, 19 Jan 2017 15:00:08 +0100 Subject: [PATCH 2/2] Update ChangeLog --- ChangeLog | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 843cb0a0..7acd7635 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,6 +19,7 @@ releases. ### New Features * New Actions: + - action.d/netscaler: Block IPs on a Citrix Netscaler ADC (gh-1663) * New Filters: @@ -26,14 +27,6 @@ releases. ### Enhancements -ver. 0.9.7 (2016/19/01) ------------ - -### New Features -* New Actions: - - action.d/netscaler: Block IPs on a Citrix Netscaler ADC (gh-1663) - - ver. 0.9.6 (2016/12/10) - stretch-is-coming -----------