diff --git a/VERSION b/VERSION index f0bb29e76..589268e6f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.3.0 +1.3.0 \ No newline at end of file diff --git a/salt/patch/os/init.sls b/salt/patch/os/init.sls index ade35294a..1464a3397 100644 --- a/salt/patch/os/init.sls +++ b/salt/patch/os/init.sls @@ -1,7 +1,4 @@ include: -{% if grains.os == "CentOS" %} - - yum.packages -{% endif %} - patch.needs_restarting patch_os: diff --git a/salt/top.sls b/salt/top.sls index 207fd509a..95acae1fd 100644 --- a/salt/top.sls +++ b/salt/top.sls @@ -11,6 +11,11 @@ base: + + 'os:CentOS': + - match: grain + - yum.packages + '*': - salt - docker diff --git a/salt/wazuh/init.sls b/salt/wazuh/init.sls index d6130abb9..54db40787 100644 --- a/salt/wazuh/init.sls +++ b/salt/wazuh/init.sls @@ -43,6 +43,14 @@ ossec: # - user: 945 # - group: 945 +wazuhpkgs: + pkg.installed: + - skip_suggestions: False + - pkgs: + - wazuh-agent: 3.10.2-1 + - hold: True + - update_holds: True + # Add Wazuh agent conf wazuhagentconf: file.managed: @@ -72,6 +80,11 @@ wazuhmgrwhitelist: - mode: 755 - template: jinja +wazuhagentservice: + service.running: + - name: wazuh-agent + - enable: True + so-wazuh: docker_container.running: - image: {{ MASTER }}:5000/soshybridhunter/so-wazuh:{{ VERSION }} diff --git a/salt/yum/packages.sls b/salt/yum/packages.sls index 4c773d0e9..50f763b0f 100644 --- a/salt/yum/packages.sls +++ b/salt/yum/packages.sls @@ -1,3 +1,7 @@ install_yum_utils: pkg.installed: - name: yum-utils + +install_yum_versionlock: + pkg.installed: + - name: yum-plugin-versionlock diff --git a/setup/so-setup b/setup/so-setup index efbccb93e..406d69763 100755 --- a/setup/so-setup +++ b/setup/so-setup @@ -354,7 +354,6 @@ fi set_progress_str 22 'Generating CA and checking in' salt_checkin >> $setup_log 2>&1 - if [[ $is_master || $is_helix ]]; then set_progress_str 25 'Configuring firewall' set_initial_firewall_policy >> $setup_log 2>&1 @@ -379,6 +378,11 @@ fi set_progress_str 62 "$(print_salt_state_apply 'firewall')" salt-call state.apply -l info firewall >> $setup_log 2>&1 + if [ $OS = 'centos' ]; then + set_progress_str 63 'Installing Yum utilities' + salt-call state.apply -l info yum.packages >> $setup_log 2>&1 + fi + set_progress_str 63 "$(print_salt_state_apply 'common')" salt-call state.apply -l info common >> $setup_log 2>&1 @@ -429,13 +433,6 @@ fi fi if [[ "$WAZUH" = 1 ]]; then - if [ $OS = 'centos' ]; then - yum -y install wazuh-agent-3.10.2-1 >> "$setup_log" 2>&1 - echo "exclude=wazuh-agent" >> /etc/yum.repos.d/wazuh.repo - else - apt-get -y install wazuh-agent=3.10.2-1 >> "$setup_log" 2>&1 - apt-mark hold wazuh-agent >> "$setup_log" 2>&1 - fi set_progress_str 75 "$(print_salt_state_apply 'wazuh')" salt-call state.apply -l info wazuh >> $setup_log 2>&1 fi diff --git a/setup/yum_repos/wazuh.repo b/setup/yum_repos/wazuh.repo index 70d23ccdd..ae462c62f 100644 --- a/setup/yum_repos/wazuh.repo +++ b/setup/yum_repos/wazuh.repo @@ -4,4 +4,4 @@ gpgkey=https://packages.wazuh.com/key/GPG-KEY-WAZUH enabled=1 name=Wazuh repository baseurl=https://packages.wazuh.com/3.x/yum/ -protect=1 \ No newline at end of file +protect=1