diff --git a/salt/ssl/init.sls b/salt/ssl/init.sls index a0780ecf6..efa3032dc 100644 --- a/salt/ssl/init.sls +++ b/salt/ssl/init.sls @@ -142,6 +142,7 @@ regkeyperms: - signing_policy: managerssl - public_key: /etc/pki/managerssl.key - CN: {{ manager }} + - subjectAltName: DNS:{{ HOSTNAME }}, IP:{{ MAINIP }} {% if CUSTOM_FLEET_HOSTNAME != None %},DNS:{{ CUSTOM_FLEET_HOSTNAME }} {% endif %} - days_remaining: 0 - days_valid: 820 - backup: True @@ -289,4 +290,4 @@ fleetkeyperms: - mode: 640 - group: 939 -{% endif %} +{% endif %} \ No newline at end of file diff --git a/salt/wazuh/files/agent/ossec.conf b/salt/wazuh/files/agent/ossec.conf index 37971aa93..8d38868ef 100644 --- a/salt/wazuh/files/agent/ossec.conf +++ b/salt/wazuh/files/agent/ossec.conf @@ -6,7 +6,7 @@ {%- set ip = salt['pillar.get']('sensor:mainip', '') %} {%- endif %} diff --git a/setup/so-functions b/setup/so-functions index 660b64393..ac72d4fb2 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -79,7 +79,7 @@ so_add_user() { echo "Add $username user" >> "$setup_log" 2>&1 groupadd --gid "$gid" "$username" - useradd --uid "$uid" --gid "$gid" --home-dir "$home_dir" "$username" + useradd -m --uid "$uid" --gid "$gid" --home-dir "$home_dir" "$username" # If a password has been passed in, set the password if [ "$pass" ]; then @@ -465,7 +465,11 @@ copy_minion_tmp_files() { ssh -i /root/.ssh/so.key soremote@"$MSRV" mkdir -p /tmp/"$MINION_ID"/pillar; ssh -i /root/.ssh/so.key soremote@"$MSRV" mkdir -p /tmp/"$MINION_ID"/schedules; scp -prv -i /root/.ssh/so.key "$temp_install_dir"/pillar/minions/* soremote@"$MSRV":/tmp/"$MINION_ID"/pillar/; - scp -prv -i /root/.ssh/so.key "$temp_install_dir"/salt/patch/os/schedules/* soremote@"$MSRV":/tmp/"$MINION_ID"/schedules; + if [ -d "$temp_install_dir"/salt/patch/os/schedules/ ]; then + if [ "$(ls -A $temp_install_dir/salt/patch/os/schedules/)" ]; then + scp -prv -i /root/.ssh/so.key "$temp_install_dir"/salt/patch/os/schedules/* soremote@"$MSRV":/tmp/"$MINION_ID"/schedules; + fi + fi ssh -i /root/.ssh/so.key soremote@"$MSRV" sudo $default_salt_dir/salt/manager/files/add_minion.sh "$MINION_ID"; } >> "$setup_log" 2>&1 ;;