This guide walks you through the process of enrolling a Windows system with the Wazuh Manager. By following these steps, you will install and configure necessary components, ensuring secure communication between the Wazuh Agent and the Wazuh Manager.
- Internet Connectivity: Verify that the system is connected to the internet.
- Adiminstrator Privileges: Ensure you open Powershell In Administrator Mode
Set Execution Policy to Remote Signed to allow powershell scripts to run.
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
When prompted, respond with A [Yes to All], to enable the execution policy.
Download the setup script from the repository and run it to configure the Wazuh agent with the necessary parameters for secure communication with the Wazuh Manager.
$env:WAZUH_MANAGER = "manager.wazuh.adorsys.team"
Invoke-WebRequest -UseBasicParsing -Uri 'https://raw.githubusercontent.com/ADORSYS-GIS/wazuh-agent/refs/heads/main/scripts/setup-agent.ps1' | Invoke-Expression
In the dependency intallation a pop-up running the GNU sed installation will show.
Please choose the options shown in the images below to install GNU sed
The Installation will now continue
For Snort A POP-UP window will come up to perform the installation. Please follow these steps:
This is a very important step, the installation will not work well if this step is not completed
Run the following command to start the enrollment process:
& 'C:\Program Files (x86)\ossec-agent\wazuh-cert-oauth2-client.exe' o-auth2
This command will generate a URL. Copy the link and paste it into your web browser.
- i. Login: You will be prompted to log in page,Log in using Active directories:
Adorsys GIS
oradorsys GmbH & CO KG
, which will generate an authentication token using Keycloak.
- ii. Two-Factor Authentication: For first-time logins, authentication via an authenticator is required.
- iii. Token generation: After a successful authentication a token will be generated.
Return to the command line and complete the enrollment process using the generated token.
Reboot your device to apply the changes.
After completing the agent enrollment, verify that the agent is properly connected and functioning:
Look for the Wazuh icon in the system tray to confirm that the agent is running and connected.
Check the Wazuh agent logs to ensure there are no errors:
Get-Content 'C:\Program Files (x86)\ossec-agent\ossec.log' -Tail 20
Check the Wazuh agent logs to ensure there are no errors:
Run the following command:
Get-Service -Name "Wazuh"
Ping an admin for confirmation that the agent appears in the Wazuh Manager dashboard.
1. Wazuh Dependencies:
The dependencies installed for the wazuh-agent and other components include:
2. Wazuh Agent: Monitors your endpoint and sends data to the Wazuh Manager. The agent is installed and configured to connect to the specified manager (WAZUH_MANAGER).
3. OAuth2 Authentication Client: Adds certificate-based OAuth2 authentication for secure communications.
4. Wazuh Agent Status: Provides real-time health and connection status of the agent.
5. Yara: Enables advanced file-based malware detection by integrating Yara rules into Wazuh.
6. Snort: Adds network intrusion detection capabilities to monitor suspicious traffic.
For Snort A POP-UP window will come up to perform the installation. Please follow these steps:
i. Snort has been installed. Please click OK to continue installation and install Npcap.Setup agent script defaults wazuh manager to: events.dev.wazuh.adorsys.team
v. Please click Finish once Npcap installation is complete.
vi. Installation will now continue:
- YARA
yara64 -v
- Snort
snort -V
- Agent Status
Select-String -Path 'C:\Program Files (x86)\ossec-agent\wazuh-agent.state' -Pattern '^status'
OR
Get-Service -Name "Wazuh"
- Test registration successful
- Logs reviewed for errors
- Cleanup Completed
-
If the enrollment URL fails to generate, check internet connectivity and script permissions.
-
For errors during authentication, ensure Active Directory credentials are correct and two-factor authentication is set up.
-
Consult the Wazuh logs (C:\Program Files (x86)\ossec-agent\ossec.log) for detailed error messages.
Get-Content 'C:\Program Files (x86)\ossec-agent\ossec.log' -Tail 20