mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-09 02:32:46 +01:00
Wazuh - agent install for CentOS
This commit is contained in:
@@ -893,17 +893,34 @@ update_sudoers() {
|
||||
|
||||
wazuh_agent_install() {
|
||||
|
||||
# Get key
|
||||
curl -s https://packages.wazuh.com/key/GPG-KEY-WAZUH | apt-key add -
|
||||
# Add repo
|
||||
echo "deb https://packages.wazuh.com/3.x/apt/ stable main" | tee /etc/apt/sources.list.d/wazuh.list
|
||||
apt-get update -y
|
||||
# Install
|
||||
apt-get install -y wazuh-agent
|
||||
# Prevent automatic updates
|
||||
sed -i "s/^deb/#deb/" /etc/apt/sources.list.d/wazuh.list
|
||||
# Set package state to "hold"
|
||||
echo "wazuh-agent hold" | sudo dpkg --set-selections
|
||||
if [ $OS == 'centos' ]; then
|
||||
# Add repo
|
||||
cat > /etc/yum.repos.d/wazuh.repo <<\EOF
|
||||
[wazuh_repo]
|
||||
gpgcheck=1
|
||||
gpgkey=https://packages.wazuh.com/key/GPG-KEY-WAZUH
|
||||
enabled=1
|
||||
name=Wazuh repository
|
||||
baseurl=https://packages.wazuh.com/3.x/yum/
|
||||
protect=1
|
||||
EOF
|
||||
# Install agent
|
||||
yum install -y wazuh-agent
|
||||
# Prevent automatic upates
|
||||
sed -i "s/^enabled=1/enabled=0/" /etc/yum.repos.d/wazuh.repo
|
||||
else
|
||||
# Get key
|
||||
curl -s https://packages.wazuh.com/key/GPG-KEY-WAZUH | apt-key add -
|
||||
# Add repo
|
||||
echo "deb https://packages.wazuh.com/3.x/apt/ stable main" | tee /etc/apt/sources.list.d/wazuh.list
|
||||
apt-get update -y
|
||||
# Install
|
||||
apt-get install -y wazuh-agent
|
||||
# Prevent automatic updates
|
||||
sed -i "s/^deb/#deb/" /etc/apt/sources.list.d/wazuh.list
|
||||
# Set package state to "hold"
|
||||
echo "wazuh-agent hold" | sudo dpkg --set-selections
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user