diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..6da6d014 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "pip" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "daily" + target-branch: "4.3" diff --git a/CHANGELOG.md b/CHANGELOG.md index e2892277..b61de7ea 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,18 @@ # Change Log All notable changes to this project will be documented in this file. +## [v4.4.0] + +### Added + +- Update to [Wazuh v4.4.0](https://github.com/wazuh/wazuh/blob/v4.4.0/CHANGELOG.md#v440) +- +## [v4.3.0] + +### Added + +- Update to [Wazuh v4.3.0](https://github.com/wazuh/wazuh/blob/v4.3.0/CHANGELOG.md#v430) + ## [v4.2.6] ### Added @@ -55,6 +67,12 @@ All notable changes to this project will be documented in this file. - Update to [Wazuh v4.1.3](https://github.com/wazuh/wazuh/blob/v4.1.3/CHANGELOG.md#v413) +## [v4.1.2] + +### Added + +- Update to [Wazuh v4.1.2](https://github.com/wazuh/wazuh/blob/v4.1.2/CHANGELOG.md#v412) + ## [v4.1.1] ### Added diff --git a/README.md b/README.md index f1342652..1e3893b3 100644 --- a/README.md +++ b/README.md @@ -8,12 +8,15 @@ These playbooks install and configure Wazuh agent, manager and Elastic Stack. ## Branches -* `master` branch corresponds to the latest Wazuh Ansible changes. It might be unstable. +* `master` branch contains the latest code, be aware of possible bugs on this branch. +* `stable` branch on correspond to the last Wazuh stable version. ## Compatibility Matrix | Wazuh version | Elastic | ODFE | |---------------|---------|--------| +| v4.4.0 | | | +| v4.3.0 | | | | v4.2.6 | 7.10.2 | 1.13.2 | | v4.2.5 | 7.10.2 | 1.13.2 | | v4.2.4 | 7.10.2 | 1.13.2 | @@ -24,6 +27,7 @@ These playbooks install and configure Wazuh agent, manager and Elastic Stack. | v4.1.5 | 7.10.2 | 1.13.2 | | v4.1.4 | 7.10.0 | 1.12.0 | | v4.1.3 | 7.10.0 | 1.12.0 | +| v4.1.2 | 7.10.0 | 1.12.0 | | v4.1.1 | 7.10.0 | 1.12.0 | ## Documentation diff --git a/VERSION b/VERSION index f38e079d..50f0ba7f 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -WAZUH-ANSIBLE_VERSION="v4.2.6" -REVISION="40221" +WAZUH-ANSIBLE_VERSION="v4.4.0" +REVISION="40400" diff --git a/molecule/default/tests/test_default.py b/molecule/default/tests/test_default.py index 9f884101..2769e498 100644 --- a/molecule/default/tests/test_default.py +++ b/molecule/default/tests/test_default.py @@ -8,7 +8,8 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( def get_wazuh_version(): """This return the version of Wazuh.""" - return "4.2.4" + return "4.4.0" + def test_wazuh_packages_are_installed(host): @@ -46,8 +47,8 @@ def test_wazuh_services_are_running(host): @pytest.mark.parametrize("wazuh_file, wazuh_owner, wazuh_group, wazuh_mode", [ ("/var/ossec/etc/sslmanager.cert", "root", "root", 0o640), ("/var/ossec/etc/sslmanager.key", "root", "root", 0o640), - ("/var/ossec/etc/rules/local_rules.xml", "ossec", "ossec", 0o640), - ("/var/ossec/etc/lists/audit-keys", "ossec", "ossec", 0o660), + ("/var/ossec/etc/rules/local_rules.xml", "wazuh", "wazuh", 0o640), + ("/var/ossec/etc/lists/audit-keys", "wazuh", "wazuh", 0o660), ]) def test_wazuh_files(host, wazuh_file, wazuh_owner, wazuh_group, wazuh_mode): """Test Wazuh related files exist and have proper owners and mode.""" diff --git a/molecule/distributed-wazuh-elk-xpack/group_vars/all.yml b/molecule/distributed-wazuh-elk-xpack/group_vars/all.yml index b4fc99a4..dd856b90 100644 --- a/molecule/distributed-wazuh-elk-xpack/group_vars/all.yml +++ b/molecule/distributed-wazuh-elk-xpack/group_vars/all.yml @@ -18,12 +18,11 @@ elastic_stack_version: 7.10.2 filebeat_version: 7.10.2 # Debian packages need the ${VERSION}-1 -wazuh_manager_version: 4.2.4-1 -wazuh_agent_version: 4.2.4-1 +wazuh_manager_version: 4.4.0-1 +wazuh_agent_version: 4.4.0-1 # Kibana role appends it automatically. -wazuh_version: 4.2.4 - +wazuh_version: 4.4.0 ######################################################## # General ELK stack variables diff --git a/molecule/distributed-wazuh-elk-xpack/tests/test_default.py b/molecule/distributed-wazuh-elk-xpack/tests/test_default.py index 9f884101..d70bd1ea 100644 --- a/molecule/distributed-wazuh-elk-xpack/tests/test_default.py +++ b/molecule/distributed-wazuh-elk-xpack/tests/test_default.py @@ -8,7 +8,7 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( def get_wazuh_version(): """This return the version of Wazuh.""" - return "4.2.4" + return "4.4.0" def test_wazuh_packages_are_installed(host): @@ -46,8 +46,8 @@ def test_wazuh_services_are_running(host): @pytest.mark.parametrize("wazuh_file, wazuh_owner, wazuh_group, wazuh_mode", [ ("/var/ossec/etc/sslmanager.cert", "root", "root", 0o640), ("/var/ossec/etc/sslmanager.key", "root", "root", 0o640), - ("/var/ossec/etc/rules/local_rules.xml", "ossec", "ossec", 0o640), - ("/var/ossec/etc/lists/audit-keys", "ossec", "ossec", 0o660), + ("/var/ossec/etc/rules/local_rules.xml", "wazuh", "wazuh", 0o640), + ("/var/ossec/etc/lists/audit-keys", "wazuh", "wazuh", 0o660), ]) def test_wazuh_files(host, wazuh_file, wazuh_owner, wazuh_group, wazuh_mode): """Test Wazuh related files exist and have proper owners and mode.""" diff --git a/molecule/distributed-wazuh-elk/group_vars/all.yml b/molecule/distributed-wazuh-elk/group_vars/all.yml index f5156945..6fdbc224 100644 --- a/molecule/distributed-wazuh-elk/group_vars/all.yml +++ b/molecule/distributed-wazuh-elk/group_vars/all.yml @@ -16,8 +16,8 @@ elastic_stack_version: 7.10.2 filebeat_version: 7.10.2 # Debian packages need the ${VERSION}-1 -wazuh_manager_version: 4.2.4-1 -wazuh_agent_version: 4.2.4-1 +wazuh_manager_version: 4.4.0-1 +wazuh_agent_version: 4.4.0-1 # Kibana role appends it automatically. -wazuh_version: 4.2.4 +wazuh_version: 4.4.0 diff --git a/molecule/distributed-wazuh-elk/tests/test_default.py b/molecule/distributed-wazuh-elk/tests/test_default.py index 9f884101..d70bd1ea 100644 --- a/molecule/distributed-wazuh-elk/tests/test_default.py +++ b/molecule/distributed-wazuh-elk/tests/test_default.py @@ -8,7 +8,7 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( def get_wazuh_version(): """This return the version of Wazuh.""" - return "4.2.4" + return "4.4.0" def test_wazuh_packages_are_installed(host): @@ -46,8 +46,8 @@ def test_wazuh_services_are_running(host): @pytest.mark.parametrize("wazuh_file, wazuh_owner, wazuh_group, wazuh_mode", [ ("/var/ossec/etc/sslmanager.cert", "root", "root", 0o640), ("/var/ossec/etc/sslmanager.key", "root", "root", 0o640), - ("/var/ossec/etc/rules/local_rules.xml", "ossec", "ossec", 0o640), - ("/var/ossec/etc/lists/audit-keys", "ossec", "ossec", 0o660), + ("/var/ossec/etc/rules/local_rules.xml", "wazuh", "wazuh", 0o640), + ("/var/ossec/etc/lists/audit-keys", "wazuh", "wazuh", 0o660), ]) def test_wazuh_files(host, wazuh_file, wazuh_owner, wazuh_group, wazuh_mode): """Test Wazuh related files exist and have proper owners and mode.""" diff --git a/molecule/distributed-wazuh-odfe/group_vars/all.yml b/molecule/distributed-wazuh-odfe/group_vars/all.yml index a79cf9cd..36080bf0 100644 --- a/molecule/distributed-wazuh-odfe/group_vars/all.yml +++ b/molecule/distributed-wazuh-odfe/group_vars/all.yml @@ -40,8 +40,8 @@ filebeat_version: 7.10.2 kibana_opendistro_version: 1.13.2-1 # Debian packages need the ${VERSION}-1 -wazuh_manager_version: 4.2.4-1 -wazuh_agent_version: 4.2.4-1 +wazuh_manager_version: 4.4.0-1 +wazuh_agent_version: 4.4.0-1 # Kibana role appends it automatically. -wazuh_version: 4.2.4 +wazuh_version: 4.4.0 diff --git a/molecule/distributed-wazuh-odfe/tests/test_default.py b/molecule/distributed-wazuh-odfe/tests/test_default.py index 9f884101..d70bd1ea 100644 --- a/molecule/distributed-wazuh-odfe/tests/test_default.py +++ b/molecule/distributed-wazuh-odfe/tests/test_default.py @@ -8,7 +8,7 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( def get_wazuh_version(): """This return the version of Wazuh.""" - return "4.2.4" + return "4.4.0" def test_wazuh_packages_are_installed(host): @@ -46,8 +46,8 @@ def test_wazuh_services_are_running(host): @pytest.mark.parametrize("wazuh_file, wazuh_owner, wazuh_group, wazuh_mode", [ ("/var/ossec/etc/sslmanager.cert", "root", "root", 0o640), ("/var/ossec/etc/sslmanager.key", "root", "root", 0o640), - ("/var/ossec/etc/rules/local_rules.xml", "ossec", "ossec", 0o640), - ("/var/ossec/etc/lists/audit-keys", "ossec", "ossec", 0o660), + ("/var/ossec/etc/rules/local_rules.xml", "wazuh", "wazuh", 0o640), + ("/var/ossec/etc/lists/audit-keys", "wazuh", "wazuh", 0o660), ]) def test_wazuh_files(host, wazuh_file, wazuh_owner, wazuh_group, wazuh_mode): """Test Wazuh related files exist and have proper owners and mode.""" diff --git a/playbooks/wazuh-odfe-single.yml b/playbooks/wazuh-odfe-single.yml index 7c655c27..53b7dee3 100644 --- a/playbooks/wazuh-odfe-single.yml +++ b/playbooks/wazuh-odfe-single.yml @@ -19,4 +19,4 @@ node1: name: node-1 # Important: must be equal to elasticsearch_node_name. ip: 127.0.0.1 - ansible_shell_allow_world_readable_temp: true \ No newline at end of file + ansible_shell_allow_world_readable_temp: true diff --git a/pyproject.toml b/pyproject.toml index 12fbe9e9..325020ed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "wazuh-ansible" -version = "4.2.6" +version = "4.4.0" description = "" authors = ["neonmei "] diff --git a/roles/elastic-stack/ansible-kibana/defaults/main.yml b/roles/elastic-stack/ansible-kibana/defaults/main.yml index 4b13d9ac..9edcf5d4 100644 --- a/roles/elastic-stack/ansible-kibana/defaults/main.yml +++ b/roles/elastic-stack/ansible-kibana/defaults/main.yml @@ -7,7 +7,7 @@ kibana_server_host: "0.0.0.0" kibana_server_port: "5601" kibana_conf_path: /etc/kibana elastic_stack_version: 7.10.2 -wazuh_version: 4.2.6 +wazuh_version: 4.4.0 wazuh_app_url: https://packages.wazuh.com/4.x/ui/kibana/wazuh_kibana elasticrepo: diff --git a/roles/opendistro/opendistro-elasticsearch/tasks/main.yml b/roles/opendistro/opendistro-elasticsearch/tasks/main.yml index a8dc20ee..c7203088 100644 --- a/roles/opendistro/opendistro-elasticsearch/tasks/main.yml +++ b/roles/opendistro/opendistro-elasticsearch/tasks/main.yml @@ -14,6 +14,7 @@ - name: Remove performance analyzer plugin from elasticsearch become: true command: ./elasticsearch-plugin remove opendistro-performance-analyzer + ignore_errors: true args: chdir: /usr/share/elasticsearch/bin/ register: remove_elasticsearch_performance_analyzer diff --git a/roles/opendistro/opendistro-kibana/defaults/main.yml b/roles/opendistro/opendistro-kibana/defaults/main.yml index 0dfc917c..ce5eb14b 100644 --- a/roles/opendistro/opendistro-kibana/defaults/main.yml +++ b/roles/opendistro/opendistro-kibana/defaults/main.yml @@ -10,7 +10,7 @@ kibana_server_port: "5601" kibana_server_name: "kibana" kibana_max_payload_bytes: 1048576 elastic_stack_version: 7.10.2 -wazuh_version: 4.2.6 +wazuh_version: 4.4.0 wazuh_app_url: https://packages.wazuh.com/4.x/ui/kibana/wazuh_kibana # The OpenDistro package repository diff --git a/roles/opendistro/opendistro-kibana/tasks/security_actions.yml b/roles/opendistro/opendistro-kibana/tasks/security_actions.yml index e96bdfa5..ee21f1c1 100644 --- a/roles/opendistro/opendistro-kibana/tasks/security_actions.yml +++ b/roles/opendistro/opendistro-kibana/tasks/security_actions.yml @@ -10,4 +10,4 @@ - "{{ kibana_node_name }}_http.key" - "{{ kibana_node_name }}_http.pem" tags: - - security \ No newline at end of file + - security diff --git a/roles/opendistro/opendistro-kibana/templates/opendistro_kibana.yml.j2 b/roles/opendistro/opendistro-kibana/templates/opendistro_kibana.yml.j2 index 2255f026..9280daca 100644 --- a/roles/opendistro/opendistro-kibana/templates/opendistro_kibana.yml.j2 +++ b/roles/opendistro/opendistro-kibana/templates/opendistro_kibana.yml.j2 @@ -34,5 +34,3 @@ telemetry.optIn: {{ kibana_telemetry_optin }} telemetry.enabled: {{ kibana_telemetry_enabled }} server.defaultRoute: /app/wazuh?security_tenant=global - - diff --git a/roles/wazuh/ansible-filebeat-oss/defaults/main.yml b/roles/wazuh/ansible-filebeat-oss/defaults/main.yml index 93dd996f..3cee711e 100644 --- a/roles/wazuh/ansible-filebeat-oss/defaults/main.yml +++ b/roles/wazuh/ansible-filebeat-oss/defaults/main.yml @@ -1,7 +1,7 @@ --- filebeat_version: 7.10.2 -wazuh_template_branch: v4.2.6 +wazuh_template_branch: v4.4.0 filebeat_output_elasticsearch_hosts: - "localhost:9200" diff --git a/roles/wazuh/ansible-filebeat-oss/tasks/Debian.yml b/roles/wazuh/ansible-filebeat-oss/tasks/Debian.yml index 33c94cf6..718d584b 100644 --- a/roles/wazuh/ansible-filebeat-oss/tasks/Debian.yml +++ b/roles/wazuh/ansible-filebeat-oss/tasks/Debian.yml @@ -1,9 +1,10 @@ --- -- name: Debian/Ubuntu | Install apt-transport-https and ca-certificates +- name: Debian/Ubuntu | Install apt-transport-https, ca-certificates and acl apt: name: - apt-transport-https - ca-certificates + - acl state: present register: filebeat_ca_packages_install until: filebeat_ca_packages_install is succeeded diff --git a/roles/wazuh/ansible-filebeat/defaults/main.yml b/roles/wazuh/ansible-filebeat/defaults/main.yml index 59d5b9b9..6c048fbf 100644 --- a/roles/wazuh/ansible-filebeat/defaults/main.yml +++ b/roles/wazuh/ansible-filebeat/defaults/main.yml @@ -1,7 +1,7 @@ --- filebeat_version: 7.10.2 -wazuh_template_branch: v4.2.6 +wazuh_template_branch: v4.4.0 filebeat_create_config: true diff --git a/roles/wazuh/ansible-filebeat/tasks/Debian.yml b/roles/wazuh/ansible-filebeat/tasks/Debian.yml index a87bb2bf..36b66ac5 100644 --- a/roles/wazuh/ansible-filebeat/tasks/Debian.yml +++ b/roles/wazuh/ansible-filebeat/tasks/Debian.yml @@ -1,9 +1,10 @@ --- -- name: Debian/Ubuntu | Install apt-transport-https and ca-certificates +- name: Debian/Ubuntu | Install apt-transport-https, ca-certificates and acl apt: name: - apt-transport-https - ca-certificates + - acl state: present register: filebeat_ca_packages_install until: filebeat_ca_packages_install is succeeded diff --git a/roles/wazuh/ansible-wazuh-agent/defaults/main.yml b/roles/wazuh/ansible-wazuh-agent/defaults/main.yml index 810d5934..d2e55b71 100644 --- a/roles/wazuh/ansible-wazuh-agent/defaults/main.yml +++ b/roles/wazuh/ansible-wazuh-agent/defaults/main.yml @@ -1,6 +1,5 @@ --- -wazuh_agent_version: 4.2.6-1 - +wazuh_agent_version: 4.4.0-1 # Custom packages installation @@ -12,7 +11,7 @@ wazuh_custom_packages_installation_agent_rpm_url: "" wazuh_agent_sources_installation: enabled: false - branch: "v4.2.6" + branch: "v4.4.0" user_language: "y" user_no_stop: "y" user_install_type: "agent" @@ -54,9 +53,9 @@ wazuh_winagent_config: # Adding quotes to auth_path_x86 since win_shell outputs error otherwise auth_path_x86: C:\'Program Files (x86)'\ossec-agent\agent-auth.exe check_md5: True - md5: 14eccab85be5be193f277e2c73532a5d -wazuh_winagent_config_url: https://packages.wazuh.com/4.x/windows/wazuh-agent-4.2.6-1.msi -wazuh_winagent_package_name: wazuh-agent-4.2.6-1.msi + md5: 8ffa75d13280f1aa6ffca54f4273df4d +wazuh_winagent_config_url: https://packages.wazuh.com/4.x/windows/wazuh-agent-4.4.0-1.msi +wazuh_winagent_package_name: wazuh-agent-4.4.0-1.msi wazuh_dir: "/var/ossec" diff --git a/roles/wazuh/ansible-wazuh-agent/tasks/Debian.yml b/roles/wazuh/ansible-wazuh-agent/tasks/Debian.yml index 9c12fdbf..9d218fcb 100644 --- a/roles/wazuh/ansible-wazuh-agent/tasks/Debian.yml +++ b/roles/wazuh/ansible-wazuh-agent/tasks/Debian.yml @@ -1,9 +1,10 @@ --- -- name: Debian/Ubuntu | Install apt-transport-https and ca-certificates +- name: Debian/Ubuntu | Install apt-transport-https, ca-certificates and acl apt: name: - apt-transport-https - ca-certificates + - acl state: present register: wazuh_agent_ca_package_install until: wazuh_agent_ca_package_install is succeeded diff --git a/roles/wazuh/ansible-wazuh-agent/tasks/Linux.yml b/roles/wazuh/ansible-wazuh-agent/tasks/Linux.yml index ee628416..9f4127dd 100644 --- a/roles/wazuh/ansible-wazuh-agent/tasks/Linux.yml +++ b/roles/wazuh/ansible-wazuh-agent/tasks/Linux.yml @@ -223,7 +223,7 @@ src: var-ossec-etc-ossec-agent.conf.j2 dest: "{{ wazuh_dir }}/etc/ossec.conf" owner: root - group: ossec + group: wazuh mode: 0644 notify: restart wazuh-agent tags: @@ -235,7 +235,7 @@ src: var-ossec-etc-local-internal-options.conf.j2 dest: "{{ wazuh_dir }}/etc/local_internal_options.conf" owner: root - group: ossec + group: wazuh mode: 0640 notify: restart wazuh-agent tags: @@ -246,8 +246,8 @@ template: src: authd_pass.j2 dest: "{{ wazuh_dir }}/etc/authd.pass" - owner: ossec - group: ossec + owner: wazuh + group: wazuh mode: 0640 when: - wazuh_agent_config.enrollment.enabled == 'yes' diff --git a/roles/wazuh/ansible-wazuh-agent/tasks/RMDebian.yml b/roles/wazuh/ansible-wazuh-agent/tasks/RMDebian.yml index 76ed22e2..9999a7d3 100644 --- a/roles/wazuh/ansible-wazuh-agent/tasks/RMDebian.yml +++ b/roles/wazuh/ansible-wazuh-agent/tasks/RMDebian.yml @@ -1,6 +1,6 @@ --- - name: Remove Wazuh repository (and clean up left-over metadata) apt_repository: - repo: deb https://packages.wazuh.com/apt {{ ansible_distribution_release }} main + repo: "{{ wazuh_agent_config.repo.apt }}" state: absent changed_when: false diff --git a/roles/wazuh/ansible-wazuh-manager/defaults/main.yml b/roles/wazuh/ansible-wazuh-manager/defaults/main.yml index e7abcd06..647ba700 100644 --- a/roles/wazuh/ansible-wazuh-manager/defaults/main.yml +++ b/roles/wazuh/ansible-wazuh-manager/defaults/main.yml @@ -1,5 +1,5 @@ --- -wazuh_manager_version: 4.2.6-1 +wazuh_manager_version: 4.4.0-1 wazuh_manager_fqdn: "wazuh-server" wazuh_manager_package_state: present @@ -12,7 +12,7 @@ wazuh_custom_packages_installation_manager_rpm_url: "https://s3-us-west-1.amazon # Sources installation wazuh_manager_sources_installation: enabled: false - branch: "v4.2.6" + branch: "v4.4.0" user_language: "en" user_no_stop: "y" user_install_type: "server" @@ -61,7 +61,7 @@ wazuh_manager_mailto: - 'admin@example.net' wazuh_manager_email_smtp_server: smtp.example.wazuh.com -wazuh_manager_email_from: ossecm@example.wazuh.com +wazuh_manager_email_from: wazuh@example.wazuh.com wazuh_manager_email_maxperhour: 12 wazuh_manager_email_queue_size: 131072 wazuh_manager_email_log_source: 'alerts.log' @@ -258,6 +258,7 @@ wazuh_manager_commands: executable: 'restart-wazuh' - name: 'firewall-drop' executable: 'firewall-drop' + expect: 'srcip' timeout_allowed: 'yes' - name: 'host-deny' executable: 'host-deny' @@ -349,8 +350,11 @@ wazuh_manager_authd: enable: true port: 1515 use_source_ip: 'no' - force_insert: 'yes' - force_time: 0 + force: + enabled: 'yes' + key_mismatch: 'yes' + disconnected_time: '1h' + after_registration_time: '1h' purge: 'yes' use_password: 'no' ciphers: 'HIGH:!ADH:!EXP:!MD5:!RC4:!3DES:!CAMELLIA:@STRENGTH' diff --git a/roles/wazuh/ansible-wazuh-manager/tasks/Debian.yml b/roles/wazuh/ansible-wazuh-manager/tasks/Debian.yml index db734fe1..717add8c 100644 --- a/roles/wazuh/ansible-wazuh-manager/tasks/Debian.yml +++ b/roles/wazuh/ansible-wazuh-manager/tasks/Debian.yml @@ -1,10 +1,11 @@ --- -- name: Debian/Ubuntu | Install apt-transport-https and ca-certificates +- name: Debian/Ubuntu | Install apt-transport-https, ca-certificates and acl apt: name: - apt-transport-https - ca-certificates - gnupg + - acl state: present cache_valid_time: 3600 install_recommends: false diff --git a/roles/wazuh/ansible-wazuh-manager/tasks/main.yml b/roles/wazuh/ansible-wazuh-manager/tasks/main.yml index 61409a40..b7640a5c 100644 --- a/roles/wazuh/ansible-wazuh-manager/tasks/main.yml +++ b/roles/wazuh/ansible-wazuh-manager/tasks/main.yml @@ -81,8 +81,8 @@ - name: Installing the local_rules.xml (default local_rules.xml) template: src=var-ossec-rules-local_rules.xml.j2 dest="{{ wazuh_dir }}/etc/rules/local_rules.xml" - owner=ossec - group=ossec + owner=wazuh + group=wazuh mode=0640 notify: restart wazuh-manager tags: @@ -93,8 +93,8 @@ - name: Adding local rules files copy: src="{{ wazuh_manager_config.ruleset.rules_path }}" dest="{{ wazuh_dir }}/etc/rules/" - owner=ossec - group=ossec + owner=wazuh + group=wazuh mode=0640 notify: restart wazuh-manager tags: @@ -105,8 +105,8 @@ - name: Installing the local_decoder.xml template: src=var-ossec-rules-local_decoder.xml.j2 dest="{{ wazuh_dir }}/etc/decoders/local_decoder.xml" - owner=ossec - group=ossec + owner=wazuh + group=wazuh mode=0640 notify: restart wazuh-manager tags: @@ -117,8 +117,8 @@ - name: Adding local decoders files copy: src="{{ wazuh_manager_config.ruleset.decoders_path }}" dest="{{ wazuh_dir }}/etc/decoders/" - owner=ossec - group=ossec + owner=wazuh + group=wazuh mode=0640 notify: restart wazuh-manager tags: @@ -130,8 +130,8 @@ template: src: var-ossec-etc-shared-agent.conf.j2 dest: "{{ wazuh_dir }}/etc/shared/default/agent.conf" - owner: ossec - group: ossec + owner: wazuh + group: wazuh mode: 0640 validate: "{{ wazuh_dir }}/bin/verify-agent-conf -f %s" notify: restart wazuh-manager @@ -145,7 +145,7 @@ template: src=var-ossec-etc-local-internal-options.conf.j2 dest="{{ wazuh_dir }}/etc/local_internal_options.conf" owner=root - group=ossec + group=wazuh mode=0640 notify: restart wazuh-manager tags: @@ -228,7 +228,7 @@ src: var-ossec-etc-ossec-server.conf.j2 dest: "{{ wazuh_dir }}/etc/ossec.conf" owner: root - group: ossec + group: wazuh mode: 0644 notify: restart wazuh-manager tags: @@ -239,8 +239,8 @@ template: src: authd_pass.j2 dest: "{{ wazuh_dir }}/etc/authd.pass" - owner: ossec - group: ossec + owner: wazuh + group: wazuh mode: 0640 no_log: true notify: restart wazuh-manager @@ -257,7 +257,7 @@ src: create_user.py dest: "{{ wazuh_dir }}/framework/scripts/create_user.py" owner: root - group: ossec + group: wazuh mode: 0644 - name: Execute create_user script diff --git a/roles/wazuh/ansible-wazuh-manager/templates/var-ossec-etc-ossec-server.conf.j2 b/roles/wazuh/ansible-wazuh-manager/templates/var-ossec-etc-ossec-server.conf.j2 index 5d023a26..7fafc465 100644 --- a/roles/wazuh/ansible-wazuh-manager/templates/var-ossec-etc-ossec-server.conf.j2 +++ b/roles/wazuh/ansible-wazuh-manager/templates/var-ossec-etc-ossec-server.conf.j2 @@ -622,12 +622,28 @@ {% 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_insert is not none %} - {{wazuh_manager_config.authd.force_insert}} - {% endif %} - {% if wazuh_manager_config.authd.force_time is not none %} - {{wazuh_manager_config.authd.force_time}} - {% 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 %}