39 lines
810 B
YAML
39 lines
810 B
YAML
---
|
|
|
|
- name: Install Apache mod_security
|
|
apt:
|
|
pkg:
|
|
- libapache2-mod-security2=2.9.*
|
|
- modsecurity-crs=3.*
|
|
state: present
|
|
notify: Restart Apache
|
|
tags: packages
|
|
|
|
- name: Install Apache mod_security config
|
|
template:
|
|
dest: /etc/modsecurity/modsecurity.conf
|
|
src: etc_modsecurity_modsecurity.conf.j2
|
|
mode: 0644
|
|
owner: root
|
|
group: root
|
|
notify: Reload Apache
|
|
tags: configs
|
|
|
|
- name: Install Apache mod_security ruleset config
|
|
template:
|
|
dest: /etc/modsecurity/crs/crs-setup.conf
|
|
src: etc_modsecurity_crs_crs-setup.conf.j2
|
|
mode: 0644
|
|
owner: root
|
|
group: root
|
|
notify: Reload Apache
|
|
tags: configs
|
|
|
|
- name: Enable Apache mod_security
|
|
apache2_module:
|
|
name: security2
|
|
state: present
|
|
force: yes
|
|
notify: Restart Apache
|
|
tags: configs
|