From ca4b27cd1696bcbd6024f1ff96abeee1b6b3ae73 Mon Sep 17 00:00:00 2001 From: Omar Minaya Date: Fri, 7 Mar 2025 19:52:29 -0500 Subject: [PATCH 1/6] moving from ProxmoxVE to ProxmoxVED --- ct/wazuh.sh | 44 ++++++++++++++++++++++++++++++++++++++++ install/wazuh-install.sh | 37 +++++++++++++++++++++++++++++++++ json/wazuh.json | 31 ++++++++++++++++++++++++++++ 3 files changed, 112 insertions(+) create mode 100644 ct/wazuh.sh create mode 100644 install/wazuh-install.sh create mode 100644 json/wazuh.json diff --git a/ct/wazuh.sh b/ct/wazuh.sh new file mode 100644 index 0000000..507217b --- /dev/null +++ b/ct/wazuh.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash +source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func) +# Copyright (c) 2024 community-scripts ORG +# Author: Omar Minaya +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://wazuh.com/ + +APP="Wazuh" +var_tags="security;monitoring" +var_cpu="8" +var_ram="4096" +var_disk="24" +var_os="debian" +var_version="12" +var_unprivileged="1" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + if [[ ! -d /var ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + msg_info "Updating ${APP} LXC" + $STD apt-get update + $STD apt-get -y upgrade + msg_ok "Updated ${APP} LXC" + exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW} Access it using the following URL:${CL}" +echo -e "${TAB}${GATEWAY}${BGN}https://${IP}:443${CL}" diff --git a/install/wazuh-install.sh b/install/wazuh-install.sh new file mode 100644 index 0000000..56db6bb --- /dev/null +++ b/install/wazuh-install.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash + +# Copyright (c) 2024 community-scripts ORG +# Author: Omar Minaya +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://wazuh.com/ + +source /dev/stdin <<< "$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt-get install -y \ + sudo \ + curl +msg_ok "Installed Dependencies" + +msg_info "Downloading Wazuh Installation Files" +wget https://packages.wazuh.com/4.11/wazuh-install.sh +msg_ok "Downloaded Wazuh Files" + +msg_info "Installing Wazuh" +bash ./wazuh-install.sh -a +msg_ok "Installed Wazuh" + +motd_ssh +customize + +msg_info "Cleaning up" +rm -f wazuh-*.sh +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned" diff --git a/json/wazuh.json b/json/wazuh.json new file mode 100644 index 0000000..40487e0 --- /dev/null +++ b/json/wazuh.json @@ -0,0 +1,31 @@ +{ + "name": "Wazuh", + "slug": "wazuh", + "categories": [1], + "date_created": "2024-03-25", + "type": "ct", + "updateable": false, + "privileged": false, + "interface_port": 443, + "documentation": "https://documentation.wazuh.com/", + "website": "https://wazuh.com/", + "logo": "https://avatars.githubusercontent.com/u/13752566?s=200&v=4", + "description": "Wazuh is an open-source security monitoring solution that provides endpoint protection, network monitoring, and log analysis capabilities.", + "install_methods": [ + { + "type": "default", + "script": "ct/wazuh.sh", + "resources": { + "cpu": 8, + "ram": 4096, + "hdd": 24, + "os": "debian", + "version": "12" + } + } + ], + "default_credentials": { + "username": "root", + "password": null + } +} From 3575eda110d514abd9dae56d080a3fa7448fd9dd Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 10 Mar 2025 10:04:08 +0100 Subject: [PATCH 2/6] add mc, wget silent, chmod for file --- install/wazuh-install.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/install/wazuh-install.sh b/install/wazuh-install.sh index 56db6bb..2182742 100644 --- a/install/wazuh-install.sh +++ b/install/wazuh-install.sh @@ -16,16 +16,15 @@ update_os msg_info "Installing Dependencies" $STD apt-get install -y \ sudo \ + mc \ curl msg_ok "Installed Dependencies" -msg_info "Downloading Wazuh Installation Files" -wget https://packages.wazuh.com/4.11/wazuh-install.sh -msg_ok "Downloaded Wazuh Files" - -msg_info "Installing Wazuh" +msg_info "Setup Wazuh" +wget -q https://packages.wazuh.com/4.11/wazuh-install.sh +chmod +x wazuh-install.sh bash ./wazuh-install.sh -a -msg_ok "Installed Wazuh" +msg_ok "Setup Wazuh" motd_ssh customize From cd6c49fb045c03838907d947ea64edba19dd80b0 Mon Sep 17 00:00:00 2001 From: Omar Date: Sun, 16 Mar 2025 20:42:21 -0400 Subject: [PATCH 3/6] dynamically setting the version number instead of hardcoding 4.11 --- install/wazuh-install.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/install/wazuh-install.sh b/install/wazuh-install.sh index 2182742..6c5d834 100644 --- a/install/wazuh-install.sh +++ b/install/wazuh-install.sh @@ -5,7 +5,7 @@ # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE # Source: https://wazuh.com/ -source /dev/stdin <<< "$FUNCTIONS_FILE_PATH" +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" color verb_ip6 catch_errors @@ -20,8 +20,13 @@ $STD apt-get install -y \ curl msg_ok "Installed Dependencies" +# Fetching the latest Wazuh version +msg_info "Fetching Latest Wazuh Version" +RELEASE=$(curl -s https://api.github.com/repos/wazuh/wazuh/releases/latest | grep '"tag_name"' | awk -F '"' '{print substr($4, 2)}') +msg_ok "Latest Wazuh Version: $RELEASE" + msg_info "Setup Wazuh" -wget -q https://packages.wazuh.com/4.11/wazuh-install.sh +wget -q https://packages.wazuh.com/$RELEASE/wazuh-install.sh chmod +x wazuh-install.sh bash ./wazuh-install.sh -a msg_ok "Setup Wazuh" From 5fb46f7182d3389ea2a3b94c1541bf6b663f0907 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 17 Mar 2025 09:38:22 +0100 Subject: [PATCH 4/6] Update install/wazuh-install.sh Co-authored-by: Bas van den Berg <74251551+bvdberg01@users.noreply.github.com> --- install/wazuh-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/wazuh-install.sh b/install/wazuh-install.sh index 6c5d834..2ad7d25 100644 --- a/install/wazuh-install.sh +++ b/install/wazuh-install.sh @@ -22,7 +22,7 @@ msg_ok "Installed Dependencies" # Fetching the latest Wazuh version msg_info "Fetching Latest Wazuh Version" -RELEASE=$(curl -s https://api.github.com/repos/wazuh/wazuh/releases/latest | grep '"tag_name"' | awk -F '"' '{print substr($4, 2)}') +RELEASE=$(curl -s https://api.github.com/repos/wazuh/wazuh/releases/latest | grep '"tag_name"' | awk -F '"' '{print substr($4, 2, length($2)-4)}') msg_ok "Latest Wazuh Version: $RELEASE" msg_info "Setup Wazuh" From 124459b1252270f3f43a988efead9fef3c719f9c Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 17 Mar 2025 09:51:54 +0100 Subject: [PATCH 5/6] Update wazuh.sh --- ct/wazuh.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ct/wazuh.sh b/ct/wazuh.sh index 507217b..7d9abfb 100644 --- a/ct/wazuh.sh +++ b/ct/wazuh.sh @@ -7,9 +7,9 @@ source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVED/ APP="Wazuh" var_tags="security;monitoring" -var_cpu="8" +var_cpu="4" var_ram="4096" -var_disk="24" +var_disk="10" var_os="debian" var_version="12" var_unprivileged="1" From 1af4443373acccb50cf9c9890aa90eca15a7a099 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 17 Mar 2025 09:54:29 +0100 Subject: [PATCH 6/6] Update wazuh.json --- json/wazuh.json | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/json/wazuh.json b/json/wazuh.json index 40487e0..3f0b1f5 100644 --- a/json/wazuh.json +++ b/json/wazuh.json @@ -16,9 +16,9 @@ "type": "default", "script": "ct/wazuh.sh", "resources": { - "cpu": 8, + "cpu": 4, "ram": 4096, - "hdd": 24, + "hdd": 10, "os": "debian", "version": "12" } @@ -27,5 +27,11 @@ "default_credentials": { "username": "root", "password": null - } + }, + "notes": [ + { + "text": "WARNING: Installation sources scripts outside of Community Scripts repo. Please check the source before installing.", + "type": "warning" + } + ] }