#jinja2: lstrip_blocks: True {{ wazuh_manager_config.json_output }} {{ wazuh_manager_config.alerts_log }} {{ wazuh_manager_config.logall }} {{ wazuh_manager_config.logall_json }} {{ wazuh_manager_config.email_notification }} {% for to in wazuh_manager_config.mail_to %} {{ to }} {% endfor %} {{ wazuh_manager_config.mail_smtp_server }} {{ wazuh_manager_config.mail_from }} {{ wazuh_manager_config.mail_maxperhour }} {{ wazuh_manager_config.email_log_source }} {{ wazuh_manager_config.agents_disconnection_time }} {{ wazuh_manager_config.agents_disconnection_alert_time }} {{ wazuh_manager_config.log_level }} {{ wazuh_manager_config.email_level }} {{ wazuh_manager_config.log_format }} {% if wazuh_manager_config.extra_emails is defined %} {% for mail in wazuh_manager_config.extra_emails %} {% if mail.enable == true %} {{ mail.mail_to }} {% if mail.format is not none %} {{ mail.format }} {% endif %} {% if mail.level is not none %} {{ mail.level }} {% endif %} {% if mail.event_location is not none %} {{ mail.event_location }} {% endif %} {% if mail.group is not none %} {{ mail.group }} {% endif %} {% if mail.do_not_delay is not none and mail.do_not_delay == true %} {% endif %} {% if mail.do_not_group is not none and mail.do_not_group == true %} {% endif %} {% if mail.rule_id is not none %} {{ mail.rule_id }} {% endif %} {% endif %} {% endfor %} {% endif %} {% for connection in wazuh_manager_config.connection %} {{ connection.type }} {% if connection.port is defined %} {{ connection.port }} {% endif %} {% if connection.protocol is defined %} {{ connection.protocol }} {% endif %} {% if connection.allowed_ips is defined %} {% for allowed_ip in connection.allowed_ips %} {{ allowed_ip }} {% endfor %} {% endif %} {% if connection.denied_ips is defined %} {% for denied_ip in connection.denied_ips %} {{ denied_ip }} {% endfor %} {% endif %} {% if connection.local_ip is defined %} {{ connection.local_ip }} {% endif %} {% if connection.ipv6 is defined %} {{ connection.ipv6 }} {% endif %} {% if connection.queue_size is defined %} {{connection.queue_size}} {% endif %} {% endfor %} {% if wazuh_manager_config.reports is defined %} {% for report in wazuh_manager_config.reports %} {% if report.enable == true %} {{ report.category }} {{ report.title }} {{ report.email_to }} {% if report.location is not none %}{{ report.location }}{% endif %} {% if report.group is not none %}{{ report.group }}{% endif %} {% if report.rule is not none %}{{ report.rule }}{% endif %} {% if report.level is not none %}{{ report.level }}{% endif %} {% if report.srcip is not none %}{{ report.srcip }}{% endif %} {% if report.user is not none %}{{ report.user }}{% endif %} {% if report.showlogs is not none %}{{ report.showlogs }}{% endif %} {% endif %} {% endfor %} {% endif %} no yes yes yes yes yes yes yes {{ wazuh_manager_config.rootcheck.frequency }} {{ wazuh_dir }}/etc/rootcheck/rootkit_files.txt {{ wazuh_dir }}/etc/rootcheck/rootkit_trojans.txt yes {% if ansible_system == "Linux" and wazuh_manager_config.openscap.disable == 'no' %} no {{ wazuh_manager_config.openscap.timeout }} {{ wazuh_manager_config.openscap.interval }} {{ wazuh_manager_config.openscap.scan_on_start }} {% if ansible_distribution == 'Ubuntu' and ansible_distribution_release == 'xenial' %} xccdf_org.ssgproject.content_profile_common {% elif ansible_distribution == 'Debian' %} {% if ansible_distribution_release == 'jessie' %} {% if openscap_version_valid.stdout == "0" %} xccdf_org.ssgproject.content_profile_common {% endif %} {% elif ansible_distribution_release == 'stretch' %} {% endif %} {% elif ansible_distribution == 'CentOS' %} {% if ansible_distribution_major_version == '8' %} {# Policy not available #} {% elif ansible_distribution_major_version == '7' %} xccdf_org.ssgproject.content_profile_pci-dss xccdf_org.ssgproject.content_profile_common {% elif ansible_distribution_major_version == '6' %} xccdf_org.ssgproject.content_profile_pci-dss xccdf_org.ssgproject.content_profile_common {% endif %} {% elif ansible_distribution == 'RedHat' %} {% if ansible_distribution_major_version == '8' %} {# Policy not available #} {% elif ansible_distribution_major_version == '7' %} xccdf_org.ssgproject.content_profile_pci-dss xccdf_org.ssgproject.content_profile_common {% elif ansible_distribution_major_version == '6' %} xccdf_org.ssgproject.content_profile_pci-dss xccdf_org.ssgproject.content_profile_common {% endif %} {% if ansible_distribution_major_version == '7' %} {% elif ansible_distribution_major_version == '6' %} {% endif %} {% elif ansible_distribution == 'Fedora' %} xccdf_org.ssgproject.content_profile_pci-dss xccdf_org.ssgproject.content_profile_common {% endif %} {% endif %} {{ wazuh_manager_config.cis_cat.disable}} {{ wazuh_manager_config.cis_cat.timeout }} {{ wazuh_manager_config.cis_cat.interval }} {{ wazuh_manager_config.cis_cat.scan_on_start }} {% if wazuh_manager_config.cis_cat.install_java == 'yes' %} wodles/java {% else %} {{ wazuh_manager_config.cis_cat.java_path }} {% endif %} {{ wazuh_manager_config.cis_cat.ciscat_path }} {{ wazuh_manager_config.osquery.disable }} {{ wazuh_manager_config.osquery.run_daemon }} {{ wazuh_manager_config.osquery.log_path }} {{ wazuh_manager_config.osquery.config_path }} {{ wazuh_manager_config.osquery.ad_labels }} {{ wazuh_manager_config.syscollector.disable }} {{ wazuh_manager_config.syscollector.interval }} {{ wazuh_manager_config.syscollector.scan_on_start }} {{ wazuh_manager_config.syscollector.hardware }} {{ wazuh_manager_config.syscollector.os }} {{ wazuh_manager_config.syscollector.network }} {{ wazuh_manager_config.syscollector.packages }} {{ wazuh_manager_config.syscollector.ports_no }} {{ wazuh_manager_config.syscollector.processes }} {% if wazuh_manager_config.sca.enabled | length > 0 %} {{ wazuh_manager_config.sca.enabled }} {% endif %} {% if wazuh_manager_config.sca.scan_on_start | length > 0 %} {{ wazuh_manager_config.sca.scan_on_start }} {% endif %} {% if wazuh_manager_config.sca.interval | length > 0 %} {{ wazuh_manager_config.sca.interval }} {% endif %} {% if wazuh_manager_config.sca.skip_nfs | length > 0 %} yes {% endif %} {% if wazuh_manager_config.sca.day | length > 0 %} {{ wazuh_manager_config.sca.day }} {% endif %} {% if wazuh_manager_config.sca.wday | length > 0 %} {{ wazuh_manager_config.sca.wday }} {% endif %} {% if wazuh_manager_config.sca.time | length > 0 %} {% endif %} {% if wazuh_manager_config.vulnerability_detector.enabled is defined %} {{ wazuh_manager_config.vulnerability_detector.enabled }} {% endif %} {% if wazuh_manager_config.vulnerability_detector.interval is defined %} {{ wazuh_manager_config.vulnerability_detector.interval }} {% endif %} {% if wazuh_manager_config.vulnerability_detector.run_on_start is defined %} {{ wazuh_manager_config.vulnerability_detector.run_on_start }} {% endif %} {% if wazuh_manager_config.vulnerability_detector.providers is defined %} {% for provider_ in wazuh_manager_config.vulnerability_detector.providers %} {% if provider_.enabled is defined %} {{ provider_.enabled }} {% endif %} {% if provider_.os is defined %} {% for os_ in provider_.os %} {{ os_ }} {% endfor %} {% endif %} {% if provider_.update_interval is defined %} {{ provider_.update_interval }} {% endif %} {% endfor %} {% endif %} {{ wazuh_manager_config.syscheck.disable }} {{ wazuh_manager_config.syscheck.frequency }} {{ wazuh_manager_config.syscheck.scan_on_start }} {% if wazuh_manager_config.syscheck.auto_ignore_frequency is defined %} {{wazuh_manager_config.syscheck.auto_ignore_frequency.value }} {% endif %} {% if wazuh_manager_config.syscheck.directories is defined %} {% for directory in wazuh_manager_config.syscheck.directories %} {{ directory.dirs }} {% endfor %} {% endif %} {% if wazuh_manager_config.syscheck.ignore is defined %} {% for ignore in wazuh_manager_config.syscheck.ignore %} {{ ignore }} {% endfor %} {% endif %} {% if wazuh_manager_config.syscheck.ignore_linux_type is defined %} {% for ignore in wazuh_manager_config.syscheck.ignore_linux_type %} {{ ignore }} {% endfor %} {% endif %} {% for no_diff in wazuh_manager_config.syscheck.no_diff %} {{ no_diff }} {% endfor %} {% if wazuh_manager_config.syscheck.skip_nfs is defined %} {{ wazuh_manager_config.syscheck.skip_nfs }} {% endif %} {% if wazuh_manager_config.syscheck.skip_dev is defined %} {{ wazuh_manager_config.syscheck.skip_dev }} {% endif %} {% if wazuh_manager_config.syscheck.skip_proc is defined %} {{ wazuh_manager_config.syscheck.skip_proc }} {% endif %} {% if wazuh_manager_config.syscheck.skip_sys is defined %} {{ wazuh_manager_config.syscheck.skip_sys }} {% endif %} {{ wazuh_manager_config.syscheck.process_priority }} {{ wazuh_manager_config.syscheck.max_eps }} {{ wazuh_manager_config.syscheck.sync_enabled }} {{ wazuh_manager_config.syscheck.sync_interval }} {{ wazuh_manager_config.syscheck.sync_max_interval }} {{ wazuh_manager_config.syscheck.sync_max_eps }} {% for white_list in wazuh_manager_config.globals %} {{ white_list }} {% endfor %} {% for command in wazuh_manager_config.commands %} {{ command.name }} {{ command.executable }} {% if command.timeout_allowed is defined %} {{ command.timeout_allowed }} {% endif %} {% endfor %} {% if agentless_creds is defined %} {% for agentless in agentless_creds %} {{ agentless.type }} {{ agentless.frequency }} {{ agentless.host }} {{ agentless.state }} {% if agentless.arguments is defined %} {{ agentless.arguments }} {% endif %} {% endfor %} {% endif -%} {% if wazuh_manager_config.active_responses is defined %} {% for response in wazuh_manager_config.active_responses %} {% if response.disabled is defined %}{{ response.disabled }}{% else %}no{% endif %} {%if response.command is defined %}{{ response.command }}{% endif %} {%if response.location is defined %}{{ response.location }}{% endif %} {%if response.agent_id is defined %}{{ response.agent_id }}{% endif %} {%if response.level is defined %}{{ response.level }}{% endif %} {%if response.rules_group is defined %}{{ response.rules_group }}{% endif %} {%if response.rules_id is defined %}{{ response.rules_id }}{% endif %} {%if response.timeout is defined %}{{ response.timeout }}{% endif %} {%if response.repeated_offenders is defined %}{{ response.repeated_offenders }}{% endif %} {% endfor %} {% endif -%} {% for localfile in wazuh_manager_config.localfiles.common %} {{ localfile.format }} {% if localfile.format == 'command' or localfile.format == 'full_command' %} {{ localfile.command }} {% if localfile.alias is defined %} {{ localfile.alias }} {% endif %} {% if localfile.frequency is defined %} {{ localfile.frequency }} {% endif %} {% else %} {{ localfile.location }} {% if localfile.format == 'eventchannel' %} {% if localfile.only_future_events is defined %} {{ localfile.only_future_events }} {% endif %} {% if localfile.query is defined %} {{ localfile.query }} {% endif %} {% endif %} {% endif %} {% if localfile.format == 'json' and localfile.labels is defined %} {% for key, value in localfile.labels.items() %} {% endfor %} {% endif %} {% if localfile.target is defined %} {{ localfile.target }} {% endif %} {% if localfile.out_format is defined %} {{ localfile.out_format }} {% endif %} {% endfor %} {% if ansible_os_family == "Debian" %} {% for localfile in wazuh_manager_config.localfiles.debian %} {{ localfile.format }} {% if localfile.format == 'command' or localfile.format == 'full_command' %} {{ localfile.command }} {% if localfile.alias is defined %} {{ localfile.alias }} {% endif %} {% if localfile.frequency is defined %} {{ localfile.frequency }} {% endif %} {% else %} {{ localfile.location }} {% if localfile.format == 'eventchannel' %} {% if localfile.only_future_events is defined %} {{ localfile.only_future_events }} {% endif %} {% if localfile.query is defined %} {{ localfile.query }} {% endif %} {% endif %} {% endif %} {% if localfile.format == 'json' and localfile.labels is defined %} {% for key, value in localfile.labels.items() %} {% endfor %} {% endif %} {% if localfile.target is defined %} {{ localfile.target }} {% endif %} {% if localfile.out_format is defined %} {{ localfile.out_format }} {% endif %} {% endfor %} {% endif -%} {% if ansible_os_family == "RedHat" %} {% for localfile in wazuh_manager_config.localfiles.centos %} {{ localfile.format }} {% if localfile.format == 'command' or localfile.format == 'full_command' %} {{ localfile.command }} {% if localfile.alias is defined %} {{ localfile.alias }} {% endif %} {% if localfile.frequency is defined %} {{ localfile.frequency }} {% endif %} {% else %} {{ localfile.location }} {% if localfile.format == 'eventchannel' %} {% if localfile.only_future_events is defined %} {{ localfile.only_future_events }} {% endif %} {% if localfile.query is defined %} {{ localfile.query }} {% endif %} {% endif %} {% endif %} {% if localfile.format == 'json' and localfile.labels is defined %} {% for key, value in localfile.labels.items() %} {% endfor %} {% endif %} {% if localfile.target is defined %} {{ localfile.target }} {% endif %} {% if localfile.out_format is defined %} {{ localfile.out_format }} {% endif %} {% endfor %} {% endif -%} {% if wazuh_manager_config.syslog_outputs is defined %} {% for syslog_output in wazuh_manager_config.syslog_outputs %} {% if syslog_output.server is not none %} {{ syslog_output.server }} {{ syslog_output.port }} {{ syslog_output.format }} {% endif %} {% endfor %} {% endif %} {% if wazuh_manager_config.integrations is defined %} {% for integration in wazuh_manager_config.integrations %} {% if integration.name is not none %} {{ integration.name }} {% if integration.hook_url is defined %} {{ integration.hook_url }} {% endif %} {% if integration.api_key is defined %} {{ integration.api_key }} {% endif %} {% if integration.alert_format is defined %} {{ integration.alert_format }} {% endif %} {% if integration.alert_level is defined %} {{ integration.alert_level }} {% endif %} {% if integration.rule_id is defined %} {{ integration.rule_id }} {% endif %} {% endif %} {% endfor %} {% endif %} {% if monitor_aws is defined and monitor_aws.disabled == "no" %} {{ monitor_aws.disabled }} {{ monitor_aws.interval }} {{ monitor_aws.run_on_start }} {{ monitor_aws.skip_on_error }} {% for bucket in monitor_aws.s3 %} {{ bucket.name }} {% if bucket.path is defined %} {{ bucket.path }} {% endif %} {% if bucket.only_logs_after is defined %} {{ bucket.only_logs_after }} {% endif %} {{ bucket.access_key }} {{ bucket.secret_key }} {% endfor %} {% endif %} {% if wazuh_manager_config.labels.enable == true %} {% for label in wazuh_manager_config.labels.list %} {% endfor %} {% endif %} ruleset/decoders ruleset/rules {% if wazuh_manager_config.rule_exclude is defined %} {% for rule in wazuh_manager_config.rule_exclude %} {{ rule }} {% endfor %} {% endif %} {% if wazuh_manager_config.ruleset.cdb_lists is defined %} {% for list in wazuh_manager_config.ruleset.cdb_lists %} etc/lists/{{ list }} {% endfor %} {% endif %} etc/decoders etc/rules {% if wazuh_manager_config.authd.enable == true %} no {% if wazuh_manager_config.authd.port is not none %} {{wazuh_manager_config.authd.port}} {% else %} 1515 {% endif %} {% if wazuh_manager_config.authd.use_source_ip is not none %} {{wazuh_manager_config.authd.use_source_ip}} {% endif %} {% if wazuh_manager_config.authd.force.enabled is not none %} {{wazuh_manager_config.authd.force.enabled}} {% else %} yes {% endif %} {% if wazuh_manager_config.authd.force.key_mismatch is not none %} {{wazuh_manager_config.authd.force.key_mismatch}} {% else %} yes {% endif %} {% if wazuh_manager_config.authd.force.disconnected_time is not none %} {{wazuh_manager_config.authd.force.disconnected_time}} {% else %} 1h {% endif %} {% if wazuh_manager_config.authd.force.after_registration_time is not none %} {{wazuh_manager_config.authd.force.after_registration_time}} {% else %} 1h {% endif %} {% if wazuh_manager_config.authd.purge is not none %} {{wazuh_manager_config.authd.purge}} {% endif %} {% if wazuh_manager_config.authd.use_password is not none %} {{wazuh_manager_config.authd.use_password}} {% endif %} {% if wazuh_manager_config.authd.ciphers is not none %} {{wazuh_manager_config.authd.ciphers}} {% endif %} {% if wazuh_manager_config.authd.ssl_agent_ca is not none %} {{ wazuh_dir }}/etc/{{wazuh_manager_config.authd.ssl_agent_ca | basename}} {% endif %} {% if wazuh_manager_config.authd.ssl_verify_host is not none %} {{wazuh_manager_config.authd.ssl_verify_host}} {% endif %} {% if wazuh_manager_config.authd.ssl_manager_cert is not none %} {{ wazuh_dir }}/etc/{{wazuh_manager_config.authd.ssl_manager_cert | basename}} {% endif %} {% if wazuh_manager_config.authd.ssl_manager_key is not none %} {{ wazuh_dir }}/etc/{{wazuh_manager_config.authd.ssl_manager_key | basename}} {% endif %} {% if wazuh_manager_config.authd.ssl_auto_negotiate is not none %} {{wazuh_manager_config.authd.ssl_auto_negotiate}} {% endif %} {% endif %} {{ wazuh_manager_config.cluster.disable }} {{ wazuh_manager_config.cluster.name }} {{ wazuh_manager_config.cluster.node_name }} {{ wazuh_manager_config.cluster.node_type }} {{ wazuh_manager_config.cluster.key }} {% if wazuh_manager_config.cluster.interval is defined %} {{ wazuh_manager_config.cluster.interval }} {% endif %} {{ wazuh_manager_config.cluster.port }} {{ wazuh_manager_config.cluster.bind_addr }} {% for node in wazuh_manager_config.cluster.nodes %} {{ node }} {% endfor %} {{ wazuh_manager_config.cluster.hidden }}