Cyber Security: Wazuh Agent Install: Difference between revisions

From OnnoCenterWiki
Jump to navigationJump to search
Created page with "Sumber: https://documentation.wazuh.com/current/installation-guide/wazuh-agent/wazuh-agent-package-linux.html ==Deploying Wazuh agents on Linux endpoints== The agent runs on..."
 
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
Sumber: https://documentation.wazuh.com/current/installation-guide/wazuh-agent/wazuh-agent-package-linux.html
Sumber: https://documentation.wazuh.com/current/installation-guide/wazuh-agent/wazuh-agent-package-linux.html


==Deploying Wazuh agents on Linux endpoints==
==Deploy Wazuh agent pada Linux endpoint==


The agent runs on the host you want to monitor and communicates with the Wazuh server, sending data in near real-time through an encrypted and authenticated channel.
Agent run di host yang ingin Anda pantau dan berkomunikasi dengan server Wazuh, mengirimkan data hampir secara real-time melalui saluran terenkripsi dan diautentikasi.


The deployment of a Wazuh agent on a Linux system uses deployment variables that facilitate the task of installing, registering, and configuring the agent. Alternatively, if you want to download the Wazuh agent package directly, see the packages list section.
Pada kesempatan ini, hanya akan diberikan catatan untuk deploy agent Wazuh pada sistem Linux menggunakan variabel penerapan yang memfasilitasi tugas penginstalan, pendaftaran, dan konfigurasi agen. Atau, jika Anda ingin menginstalasi di berbagai OS lainnya dan mengunduh langsung paket agen Wazuh, lihat bagian daftar packages https://documentation.wazuh.com/current/installation-guide/packages-list.html


Note You need root user privileges to run all the commands described below.
Catatan Anda memerlukan hak pengguna root untuk menjalankan semua perintah yang dijelaskan di bawah ini.


==Add the Wazuh repository==
==Tambahkan Wazuh repository==


Add the Wazuh repository to download the official packages.
Tambahkan repository Wazuh untuk mengunduh paket resmi.
Install GPG key:


Install the GPG key:
curl -s https://packages.wazuh.com/key/GPG-KEY-WAZUH | gpg --no-default-keyring --keyring
gnupg-ring:/usr/share/keyrings/wazuh.gpg --import && chmod 644 /usr/share/keyrings/wazuh.gpg


curl -s https://packages.wazuh.com/key/GPG-KEY-WAZUH | gpg --no-default-keyring --keyring gnupg-ring:/usr/share/keyrings/wazuh.gpg --import && chmod 644 /usr/share/keyrings/wazuh.gpg
Tambahkan repository:
 
Add the repository:


  echo "deb [signed-by=/usr/share/keyrings/wazuh.gpg] https://packages.wazuh.com/4.x/apt/ stable main" | tee -a /etc/apt/sources.list.d/wazuh.list
  echo "deb [signed-by=/usr/share/keyrings/wazuh.gpg] https://packages.wazuh.com/4.x/apt/ stable main" | tee -a /etc/apt/sources.list.d/wazuh.list


Update the package information:
Update package:


  apt-get update
  apt-get update


Note
==Deploy Wazuh agent==


For Debian 7, 8, and Ubuntu 14 systems import the GCP key and add the Wazuh repository (steps 1 and 2) using the following commands.
Untuk men-deploy Wazuh agent pada endpoint, pilih package manager dan edit WAZUH_MANAGER variable agar berisi Wazuh manager IP address atau hostname, misalnya 192.168.0.187.


  apt-get install gnupg apt-transport-https
  WAZUH_MANAGER="192.168.0.187" apt-get -y install wazuh-agent
curl -s https://packages.wazuh.com/key/GPG-KEY-WAZUH | apt-key add -
echo "deb https://packages.wazuh.com/4.x/apt/ stable main" | tee -a /etc/apt/sources.list.d/wazuh.list


==Deploy a Wazuh agent==
atau bisa juga di ambil dari dashboard Wazuh > menu Setup Agent seperti,


To deploy the Wazuh agent on your endpoint, select your package manager and edit the WAZUH_MANAGER variable to contain your Wazuh manager IP address or hostname.
curl -so wazuh-agent.deb https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_4.4.5-1_amd64.deb && sudo WAZUH_MANAGER='192.168.0.187' WAZUH_AGENT_GROUP='default' WAZUH_AGENT_NAME='agent-187' dpkg -i ./wazuh-agent.deb


WAZUH_MANAGER="10.0.0.2" apt-get install wazuh-agent
Pastikan konfigurasi MANAGER IP di wazuh agent, di file /var/ossec/etc/ossec.conf sudah benar.


For additional deployment options such as agent name, agent group, and registration password, see the Deployment variables for Linux section.
<ossec_config>
  <client>
    <server>
      <address>192.168.0.187</address>
      <port>1514</port>
      <protocol>tcp</protocol>
    </server>
    <config-profile>ubuntu, ubuntu22, ubuntu22.04</config-profile>
    <notify_time>10</notify_time>
    <time-reconnect>60</time-reconnect>
    <auto_restart>yes</auto_restart>
    <crypto_method>aes</crypto_method>
  </client>


Note Alternatively, if you want to install an agent without registering it, omit the deployment variables. To learn more about the different registration methods, see the Wazuh agent enrollment section.
Untuk opsi penerapan tambahan seperti nama agen, grup agen, dan password pendaftaran, lihat bagian Variabel penerapan untuk Linux https://documentation.wazuh.com/current/user-manual/deployment-variables/deployment-variables-linux.html
Enable and start the Wazuh agent service.
 
Catatan Selain itu, jika Anda ingin menginstal agen tanpa mendaftarkannya, abaikan variabel penerapan. Untuk mempelajari lebih lanjut tentang berbagai metode pendaftaran, lihat bagian pendaftaran agent Wazuh https://documentation.wazuh.com/current/user-manual/agent-enrollment/index.html
 
Aktifkan dan mulai service agent Wazuh:


  systemctl daemon-reload
  systemctl daemon-reload
  systemctl enable wazuh-agent
  systemctl enable wazuh-agent
  systemctl start wazuh-agent
  systemctl start wazuh-agent
systemctl status wazuh-agent


The deployment process is now complete, and the Wazuh agent is successfully running on your Linux system.
Proses deployment selesai, dan Wazuh agent berhasil jalan di Linux system.


==Recommended action - Disable Wazuh updates==
==Recommended Disable Wazuh update==
 
Compatibility between the Wazuh agent and the Wazuh manager is guaranteed when the Wazuh manager version is later than or equal to that of the Wazuh agent. Therefore, we recommend disabling the Wazuh repository to prevent accidental upgrades. To do so, use the following command:


Kompatibilitas antara agent Wazuh dan manajer Wazuh dijamin ketika versi manajer Wazuh lebih baru atau sama dengan versi agen Wazuh. Oleh karena itu, kami menyarankan untuk menonaktifkan repositori Wazuh untuk mencegah upgrade yang tidak disengaja. Untuk melakukannya, gunakan perintah berikut:


  sed -i "s/^deb/#deb/" /etc/apt/sources.list.d/wazuh.list
  sed -i "s/^deb/#deb/" /etc/apt/sources.list.d/wazuh.list
  apt-get update
  apt-get update


Alternatively, you can set the package state to hold. This action stops updates but you can still upgrade it manually using apt-get install.
Atau, Anda dapat mengatur status paket untuk di hold. Tindakan ini menghentikan upgrade tetapi Anda masih dapat upgrade secara manual menggunakan apt-get install.


  echo "wazuh-agent hold" | dpkg --set-selections
  echo "wazuh-agent hold" | dpkg --set-selections


==Uninstall a Wazuh agent==
==Uninstall Wazuh agent==
 
To uninstall the agent, run the following commands:


Remove the Wazuh agent installation.
Jika diperlukan, untuk uninstall agent, run command berikut:


  apt-get remove wazuh-agent
  apt-get remove wazuh-agent


Some files are marked as configuration files. Due to this designation, the package manager does not remove these files from the filesystem. If you want to completely remove all files, run the following command:
Beberapa file ditandai sebagai file konfigurasi. Karena penunjukan ini, pengelola paket tidak menghapus file-file ini dari sistem file. Jika Anda ingin menghapus semua file sepenuhnya, jalankan perintah berikut:


  apt-get remove --purge wazuh-agent
  apt-get remove --purge wazuh-agent


Disable the Wazuh agent service.
Disable Wazuh agent service:


  systemctl disable wazuh-agent
  systemctl disable wazuh-agent
  systemctl daemon-reload
  systemctl daemon-reload


The Wazuh agent is now completely removed from your Linux endpoint.
Sekarang, Wazuh agent berhasil di uninstall secara penuh dari Linux endpoint.





Latest revision as of 03:14, 7 September 2023

Sumber: https://documentation.wazuh.com/current/installation-guide/wazuh-agent/wazuh-agent-package-linux.html

Deploy Wazuh agent pada Linux endpoint

Agent run di host yang ingin Anda pantau dan berkomunikasi dengan server Wazuh, mengirimkan data hampir secara real-time melalui saluran terenkripsi dan diautentikasi.

Pada kesempatan ini, hanya akan diberikan catatan untuk deploy agent Wazuh pada sistem Linux menggunakan variabel penerapan yang memfasilitasi tugas penginstalan, pendaftaran, dan konfigurasi agen. Atau, jika Anda ingin menginstalasi di berbagai OS lainnya dan mengunduh langsung paket agen Wazuh, lihat bagian daftar packages https://documentation.wazuh.com/current/installation-guide/packages-list.html

Catatan Anda memerlukan hak pengguna root untuk menjalankan semua perintah yang dijelaskan di bawah ini.

Tambahkan Wazuh repository

Tambahkan repository Wazuh untuk mengunduh paket resmi. Install GPG key:

curl -s https://packages.wazuh.com/key/GPG-KEY-WAZUH | gpg --no-default-keyring --keyring 
gnupg-ring:/usr/share/keyrings/wazuh.gpg --import && chmod 644 /usr/share/keyrings/wazuh.gpg

Tambahkan repository:

echo "deb [signed-by=/usr/share/keyrings/wazuh.gpg] https://packages.wazuh.com/4.x/apt/ stable main" | tee -a /etc/apt/sources.list.d/wazuh.list

Update package:

apt-get update

Deploy Wazuh agent

Untuk men-deploy Wazuh agent pada endpoint, pilih package manager dan edit WAZUH_MANAGER variable agar berisi Wazuh manager IP address atau hostname, misalnya 192.168.0.187.

WAZUH_MANAGER="192.168.0.187" apt-get -y install wazuh-agent

atau bisa juga di ambil dari dashboard Wazuh > menu Setup Agent seperti,

curl -so wazuh-agent.deb https://packages.wazuh.com/4.x/apt/pool/main/w/wazuh-agent/wazuh-agent_4.4.5-1_amd64.deb && sudo WAZUH_MANAGER='192.168.0.187' WAZUH_AGENT_GROUP='default' WAZUH_AGENT_NAME='agent-187' dpkg -i ./wazuh-agent.deb

Pastikan konfigurasi MANAGER IP di wazuh agent, di file /var/ossec/etc/ossec.conf sudah benar.

<ossec_config>
  <client>
    <server>
      <address>192.168.0.187</address>
      <port>1514</port>
      <protocol>tcp</protocol>
    </server>
    <config-profile>ubuntu, ubuntu22, ubuntu22.04</config-profile>
    <notify_time>10</notify_time>
    <time-reconnect>60</time-reconnect>
    <auto_restart>yes</auto_restart>
    <crypto_method>aes</crypto_method>
  </client>

Untuk opsi penerapan tambahan seperti nama agen, grup agen, dan password pendaftaran, lihat bagian Variabel penerapan untuk Linux https://documentation.wazuh.com/current/user-manual/deployment-variables/deployment-variables-linux.html

Catatan Selain itu, jika Anda ingin menginstal agen tanpa mendaftarkannya, abaikan variabel penerapan. Untuk mempelajari lebih lanjut tentang berbagai metode pendaftaran, lihat bagian pendaftaran agent Wazuh https://documentation.wazuh.com/current/user-manual/agent-enrollment/index.html

Aktifkan dan mulai service agent Wazuh:

systemctl daemon-reload
systemctl enable wazuh-agent
systemctl start wazuh-agent
systemctl status wazuh-agent

Proses deployment selesai, dan Wazuh agent berhasil jalan di Linux system.

Kompatibilitas antara agent Wazuh dan manajer Wazuh dijamin ketika versi manajer Wazuh lebih baru atau sama dengan versi agen Wazuh. Oleh karena itu, kami menyarankan untuk menonaktifkan repositori Wazuh untuk mencegah upgrade yang tidak disengaja. Untuk melakukannya, gunakan perintah berikut:

sed -i "s/^deb/#deb/" /etc/apt/sources.list.d/wazuh.list
apt-get update

Atau, Anda dapat mengatur status paket untuk di hold. Tindakan ini menghentikan upgrade tetapi Anda masih dapat upgrade secara manual menggunakan apt-get install.

echo "wazuh-agent hold" | dpkg --set-selections

Uninstall Wazuh agent

Jika diperlukan, untuk uninstall agent, run command berikut:

apt-get remove wazuh-agent

Beberapa file ditandai sebagai file konfigurasi. Karena penunjukan ini, pengelola paket tidak menghapus file-file ini dari sistem file. Jika Anda ingin menghapus semua file sepenuhnya, jalankan perintah berikut:

apt-get remove --purge wazuh-agent

Disable Wazuh agent service:

systemctl disable wazuh-agent
systemctl daemon-reload

Sekarang, Wazuh agent berhasil di uninstall secara penuh dari Linux endpoint.


Referensi


Pranala Menarik