From dadd726b67e30bc9a4a92639edc09161d5f68934 Mon Sep 17 00:00:00 2001 From: Miguelangel Freitas Date: Mon, 21 Aug 2017 11:01:24 -0400 Subject: [PATCH] Modifying the agents.conf template. --- .../var-ossec-etc-shared-agent.conf.j2 | 86 ++++++++++++------- 1 file changed, 55 insertions(+), 31 deletions(-) diff --git a/ansible-wazuh-manager/templates/var-ossec-etc-shared-agent.conf.j2 b/ansible-wazuh-manager/templates/var-ossec-etc-shared-agent.conf.j2 index 7f7e75d8..7cc02748 100644 --- a/ansible-wazuh-manager/templates/var-ossec-etc-shared-agent.conf.j2 +++ b/ansible-wazuh-manager/templates/var-ossec-etc-shared-agent.conf.j2 @@ -1,44 +1,68 @@ -{% for item in wazuh_agent_configs %} - +{% if wazuh_agent_configs is defined %} +{% for agent_config in wazuh_agent_configs %} + - -{% for directory in item.directories %} - {{ directory.dirs }} -{% endfor %} - - {{ item.frequency_check }} - {% for ignore_file in item.ignore_files %} - {{ ignore_file }} + + {{ agent_config.syscheck.frequency }} + {{ agent_config.syscheck.scan_on_start }} + + + {% if agent_config.syscheck.directories is defined %} + {% for directory in agent_config.syscheck.directories %} + {{ directory.dirs }} {% endfor %} + {% endif %} + + + {% if agent_config.syscheck.ignore is defined %} + {% for ignore in agent_config.syscheck.ignore %} + {{ ignore }} + {% endfor %} + {% endif %} + + + {% if agent_config.syscheck.no_diff is defined %} + {% for no_diff in agent_config.syscheck.no_diff %} + {{ no_diff }} + {% endfor %} + {% endif %} - -{% for localfile in item.localfiles %} - - {{ localfile.format }} - {% if localfile.command is defined %} - {{ localfile.command }} - {% else %} - {{ localfile.location }} - {% endif %} - -{% endfor %} + {% for localfile in agent_config.localfiles %} + + {{ localfile.format }} + {% if localfile.format == 'command' or localfile.format == 'full_command' %} + {{ localfile.command }} + {{ localfile.frequency }} + {% else %} + {{ localfile.location }} + {% endif %} + + {% endfor %} + no + yes + yes + yes + yes + yes + yes + yes + yes + + + {{ agent_config.rootcheck.frequency }} + /var/ossec/etc/shared/rootkit_files.txt /var/ossec/etc/shared/rootkit_trojans.txt /var/ossec/etc/shared/system_audit_rcl.txt - {% if item.cis_distribution_filename is defined %} - /var/ossec/etc/shared/{{ item.cis_distribution_filename }} - {% else %} - {# none specified so install all #} - /var/ossec/etc/shared/cis_debian_linux_rcl.txt - /var/ossec/etc/shared/cis_rhel_linux_rcl.txt - /var/ossec/etc/shared/cis_rhel5_linux_rcl.txt - /var/ossec/etc/shared/cis_rhel6_linux_rcl.txt - /var/ossec/etc/shared/cis_rhel7_linux_rcl.txt + /var/ossec/etc/shared/system_audit_ssh.txt + {% if agent_config.rootcheck.cis_distribution_filename is not none %} + /var/ossec/etc/shared/{{ agent_config.rootcheck.cis_distribution_filename }} {% endif %} + yes - {% endfor %} +{% endif %}