diff --git a/app/scripts/ansible/roles/waf/tasks/haproxy_above_2.4.0.yml b/app/scripts/ansible/roles/waf/tasks/haproxy_above_2.4.0.yml deleted file mode 100644 index 90045725..00000000 --- a/app/scripts/ansible/roles/waf/tasks/haproxy_above_2.4.0.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- -- name: Install git - package: - name: git - state: present - -- name: Git clone spoa-modsecurity - command: chdir=/tmp/ git clone https://github.com/haproxy/spoa-modsecurity.git - -- name: Set ModSec foleder - set_fact: - mod_sec_dir: /tmp/spoa-modsecurity \ No newline at end of file diff --git a/app/scripts/ansible/roles/waf/tasks/haproxy_under_2.4.0.yml b/app/scripts/ansible/roles/waf/tasks/haproxy_under_2.4.0.yml deleted file mode 100644 index 162e3627..00000000 --- a/app/scripts/ansible/roles/waf/tasks/haproxy_under_2.4.0.yml +++ /dev/null @@ -1,27 +0,0 @@ ---- -- name: Download HAProxy tarball - get_url: - url: "http://www.haproxy.org/download/{{ VERSION_MAJ }}/src/haproxy-{{ VERSION }}.tar.gz" - dest: "/tmp/haproxy-{{ VERSION }}.tar.gz" - -- name: Create HAProxy directory - file: - path: "/tmp/haproxy-{{ VERSION }}" - state: directory - -- name: Untar HAProxy tarball - become: true - become_user: root - unarchive: - src: "/tmp/haproxy-{{ VERSION }}.tar.gz" - dest: "/tmp/haproxy-{{ VERSION }}" - remote_src: true - -- name: Copy HAProxy files - synchronize: - src: "/tmp/haproxy-{{ VERSION }}/haproxy-{{ VERSION }}/" - dest: "/tmp/haproxy-{{ VERSION }}" - -- name: Set ModSec foleder - set_fact: - mod_sec_dir: "/tmp/haproxy-{{ VERSION }}/contrib/modsecurity" diff --git a/app/scripts/ansible/roles/waf/tasks/main.yml b/app/scripts/ansible/roles/waf/tasks/main.yml index 966b488b..aaf1e877 100644 --- a/app/scripts/ansible/roles/waf/tasks/main.yml +++ b/app/scripts/ansible/roles/waf/tasks/main.yml @@ -82,7 +82,6 @@ - name: Download Modsec tarball become: false get_url: -# url: https://www.modsecurity.org/tarball/2.9.5/modsecurity-2.9.5.tar.gz url: "https://github.com/SpiderLabs/ModSecurity/releases/download/v{{ modsec_ver }}/modsecurity-{{ modsec_ver }}.tar.gz" dest: /tmp/modsecurity.tar.gz owner: "{{ ansible_user }}" @@ -149,13 +148,17 @@ dest: /tmp/modsecurity/INSTALL/include/ remote_src: yes - - name: Include task for HAProxy <= 2.3.16 - include: haproxy_under_2.4.0.yml - when: VERSION is version('2.3.16', '<=') + - name: Install git + package: + name: git + state: present - - name: Include task for HAProxy >= 2.4.0 - include: haproxy_above_2.4.0.yml - when: VERSION is version('2.4.0', '>=') + - name: Git clone spoa-modsecurity + command: chdir=/tmp/ git clone https://github.com/haproxy/spoa-modsecurity.git + + - name: Set ModSec foleder + set_fact: + mod_sec_dir: /tmp/spoa-modsecurity - name: Make APT Modsecurity module for HAProxy command: "chdir={{ mod_sec_dir }} make MODSEC_INC=/tmp/modsecurity/INSTALL/include MODSEC_LIB=/tmp/modsecurity/INSTALL/include APACHE2_INC=/usr/include/apache2/ APR_INC=/usr/include/apr-1.0" diff --git a/inc/waf.js b/inc/waf.js index b52ab60e..8efcd167 100644 --- a/inc/waf.js +++ b/inc/waf.js @@ -65,7 +65,7 @@ function installWaf(ip1) { type: "POST", success: function( data ) { data = data.replace(/\s+/g,' '); - if (data.indexOf('error:') != '-1' || data.indexOf('Failed') != '-1') { + if (data.indexOf('error:') != '-1' || data.indexOf('Failed') != '-1' || data.indexOf('fatal') != '-1') { toastr.error(data); } else if (data.indexOf('Info') != '-1' ){ toastr.clear();