|
|
|
@ -7,6 +7,7 @@ |
|
|
|
|
- acquis.yaml |
|
|
|
|
- simulation.yaml |
|
|
|
|
- profile.yaml |
|
|
|
|
- parsers/s02-enrich/trusted_ip.yaml |
|
|
|
|
notify: reload crowdsec |
|
|
|
|
tags: crowdsec |
|
|
|
|
|
|
|
|
@ -51,3 +52,63 @@ |
|
|
|
|
- local |
|
|
|
|
notify: restart crowdsec |
|
|
|
|
tags: crowdsec |
|
|
|
|
|
|
|
|
|
- name: List installed parsers |
|
|
|
|
shell: cscli parsers list -o json |
|
|
|
|
register: crowdsec_installed_parsers |
|
|
|
|
changed_when: False |
|
|
|
|
tags: crowdsec |
|
|
|
|
|
|
|
|
|
- name: Install parsers |
|
|
|
|
command: cscli parsers install {{ item }} |
|
|
|
|
when: item not in crowdsec_installed_parsers.stdout | from_json | map(attribute='name') | list |
|
|
|
|
loop: "{{ crowdsec_parsers }}" |
|
|
|
|
notify: reload crowdsec |
|
|
|
|
tags: crowdsec |
|
|
|
|
|
|
|
|
|
- name: Upgrade parsers |
|
|
|
|
command: csscli parsers upgrade {{ item }} |
|
|
|
|
loop: "{{ crowdsec_parsers }}" |
|
|
|
|
when: crowdsec_install_mode == 'upgrade' |
|
|
|
|
notify: reload crowdsec |
|
|
|
|
tags: crowdsec |
|
|
|
|
|
|
|
|
|
- name: List installed scenarios |
|
|
|
|
command: cscli scenarios list -o json |
|
|
|
|
register: crowdsec_installed_scenarios |
|
|
|
|
changed_when: False |
|
|
|
|
tags: crowdsec |
|
|
|
|
|
|
|
|
|
- name: Install scenarios |
|
|
|
|
command: cscli scenarios install {{ item }} |
|
|
|
|
when: item not in crowdsec_installed_scenarios.stdout | from_json | map(attribute='name') | list |
|
|
|
|
loop: "{{ crowdsec_scenarios }}" |
|
|
|
|
notify: reload crowdsec |
|
|
|
|
tags: crowdsec |
|
|
|
|
|
|
|
|
|
- name: Upgrade scenarios |
|
|
|
|
command: csscli scenarios upgrade {{ item }} |
|
|
|
|
loop: "{{ crowdsec_scenarios }}" |
|
|
|
|
when: crowdsec_install_mode == 'upgrade' |
|
|
|
|
notify: reload crowdsec |
|
|
|
|
tags: crowdsec |
|
|
|
|
|
|
|
|
|
- name: List installed postoverflows |
|
|
|
|
command: cscli postoverflows list -o json |
|
|
|
|
register: crowdsec_installed_postoverflows |
|
|
|
|
changed_when: False |
|
|
|
|
tags: crowdsec |
|
|
|
|
|
|
|
|
|
- name: Install postoverflows |
|
|
|
|
command: cscli postoverflows install {{ item }} |
|
|
|
|
when: item not in crowdsec_installed_postoverflows.stdout | from_json | map(attribute='name') | list |
|
|
|
|
loop: "{{ crowdsec_postoverflows }}" |
|
|
|
|
notify: reload crowdsec |
|
|
|
|
tags: crowdsec |
|
|
|
|
|
|
|
|
|
- name: Upgrade postoverflows |
|
|
|
|
command: csscli postoverflows upgrade {{ item }} |
|
|
|
|
loop: "{{ crowdsec_postoverflows }}" |
|
|
|
|
when: crowdsec_install_mode == 'upgrade' |
|
|
|
|
notify: reload crowdsec |
|
|
|
|
tags: crowdsec |
|
|
|
|