Update : global
All checks were successful
Deployment Verification / deploy-and-test (push) Successful in 2m1s
All checks were successful
Deployment Verification / deploy-and-test (push) Successful in 2m1s
This commit is contained in:
@ -9,6 +9,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
# Source common functions and variables
|
||||
source "./common.sh"
|
||||
source "./custom/custom_snmp"
|
||||
source "./custom/custom_monitoring"
|
||||
|
||||
# Function to configure SNMP
|
||||
configure_snmp() {
|
||||
@ -173,7 +174,7 @@ server_port=5666
|
||||
server_address=0.0.0.0
|
||||
|
||||
# Allow connections from these monitoring servers (replace with your Nagios server IP)
|
||||
allowed_hosts=127.0.0.1,NAGIOS_SERVER_IP
|
||||
allowed_hosts=127.0.0.1,$NAGIOS_SERVER_IP
|
||||
|
||||
# Connection restrictions
|
||||
dont_blame_nrpe=0
|
||||
|
@ -8,15 +8,16 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
# Source common functions and variables
|
||||
source "./common.sh"
|
||||
source "./custom/custom_proxy"
|
||||
|
||||
# Function to configure APT with proxy settings if needed
|
||||
configure_apt_proxy() {
|
||||
local proxy_file="/etc/apt/apt.conf.d/90proxy"
|
||||
local proxy_doc="/root/apt-proxy-documentation.txt"
|
||||
local PROXY_FILE="/etc/apt/apt.conf.d/90proxy"
|
||||
local PROXY_DOC="/root/apt-proxy-documentation.txt"
|
||||
|
||||
log_message "INFO" "Creating APT proxy documentation at $proxy_doc"
|
||||
log_message "INFO" "Creating APT proxy documentation at $PROXY_DOC"
|
||||
|
||||
cat > "$proxy_doc" << EOF
|
||||
cat > "$PROXY_DOC" << EOF
|
||||
# APT Proxy Configuration
|
||||
# To configure APT to use a proxy, edit the file /etc/apt/apt.conf.d/90proxy
|
||||
# and add one of the following configurations:
|
||||
@ -28,14 +29,15 @@ Acquire::http::Proxy "http://username:password@proxy.example.com:8080/";
|
||||
Acquire::https::Proxy "http://username:password@proxy.example.com:8080/";
|
||||
|
||||
# For APT to use the system's proxy settings
|
||||
Acquire::http::Proxy "http://${http_proxy}";
|
||||
Acquire::https::Proxy "http://${https_proxy}";
|
||||
Acquire::http::Proxy "http://$HTTP_PROXY";
|
||||
Acquire::https::Proxy "http://$HTTPS_PROXY";
|
||||
Acquire::ftp::proxy "http://$FTP_PROXY";
|
||||
|
||||
# To disable proxy for specific hosts
|
||||
Acquire::http::Proxy::hostname.example.com "DIRECT";
|
||||
EOF
|
||||
|
||||
log_message "SUCCESS" "APT proxy documentation created. Edit $proxy_file to configure proxies if needed"
|
||||
log_message "SUCCESS" "APT proxy documentation created. Edit $PROXY_FILE to configure proxies if needed"
|
||||
}
|
||||
|
||||
# Function to update package lists and upgrade installed packages
|
||||
@ -63,7 +65,7 @@ update_upgrade_packages() {
|
||||
|
||||
# Function to install essential security packages
|
||||
install_essential_packages() {
|
||||
local packages=(
|
||||
local PACKAGES=(
|
||||
"apt-transport-https"
|
||||
"ca-certificates"
|
||||
"gnupg"
|
||||
@ -77,18 +79,18 @@ install_essential_packages() {
|
||||
|
||||
log_message "INFO" "Installing essential security packages"
|
||||
|
||||
for package in "${packages[@]}"; do
|
||||
if ! is_package_installed "$package"; then
|
||||
log_message "INFO" "Installing $package"
|
||||
apt-get install -y "$package"
|
||||
for PACKAGE in "${PACKAGES[@]}"; do
|
||||
if ! is_package_installed "$PACKAGE"; then
|
||||
log_message "INFO" "Installing $PACKAGE"
|
||||
apt-get install -y "$PACKAGE"
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
log_message "SUCCESS" "Installed $package successfully"
|
||||
log_message "SUCCESS" "Installed $PACKAGE successfully"
|
||||
else
|
||||
log_message "ERROR" "Failed to install $package"
|
||||
log_message "ERROR" "Failed to install $PACKAGE"
|
||||
fi
|
||||
else
|
||||
log_message "INFO" "$package is already installed"
|
||||
log_message "INFO" "$PACKAGE is already installed"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
@ -71,10 +71,10 @@ To update the Wazuh manager IP address, edit the following file:
|
||||
$wazuh_conf
|
||||
|
||||
And change the <address> tag to point to your Wazuh manager:
|
||||
<address>YOUR_WAZUH_MANAGER_IP</address>
|
||||
<address>$YOUR_WAZUH_MANAGER_IP</address>
|
||||
|
||||
Then, register the agent with your Wazuh manager:
|
||||
/var/ossec/bin/agent-auth -m YOUR_WAZUH_MANAGER_IP
|
||||
/var/ossec/bin/agent-auth -m $YOUR_WAZUH_MANAGER_IP
|
||||
|
||||
Finally, restart the Wazuh agent:
|
||||
systemctl restart wazuh-agent
|
||||
|
Reference in New Issue
Block a user