Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the Wazuh agent installation on Windows #163

Merged
merged 4 commits into from
Oct 30, 2019
Merged

Fix the Wazuh agent installation on Windows #163

merged 4 commits into from
Oct 30, 2019

Conversation

JPLachance
Copy link
Contributor

@JPLachance JPLachance commented Oct 22, 2019

Wazuh agent on Windows

Why did I open this PR

I need to deploy Wazuh agents on Windows instances. I rapidly figured out that this Puppet module was not ready for Windows, so I fixed it!

Changes

+ Add an optional agent_service_ensure parameter to control the service status
+ Download the Wazuh Windows agent MSI file to C:\Temp (fixes #73)
! Use the right parameters for the Windows agent MSI (based on the official documentation)
+ Add the support for a registration password for the Windows agent
! Fix the agent package ensure loop on Windows (Windows sais 3.10.2 is installed, but Puppet wants 3.10.2-1, so Puppet was re-installing it at every run)
+ Add the support for Windows in ossec.conf generation concats
* Make sure we generate the ossec.conf file before starting the Wazuh service (a before was missing, causing the service to start before the ossec.conf setup)
+ Setup the Wazuh service on Windows (was only called on Linux, I replaced the faulty if by a swith case)
* Extract agent parameters common to both Linux and Windows out of the Linux case
+ Add the missing parameters for the Windows agent
- Remove all the parameters that are not relevant for agents from the params_agent.pp file
* Format the agent.pp file
* Format the params_agent.pp file

Disclamer

I'm not a Puppet expert! Feel free to request any changes 馃檪

* Format the params_agent.pp file
+ Add an optional agent_service_ensure parameter to control the service status
+ Download the Wazuh Windows agent MSI file to C:\Temp (fixes #73)
! Use the right parameters for the Windows agent MSI
+ Add the support for a registration password for the Windows agent
+ Add the support for Windows in ossec.conf generation concats
* Make sure we generate the ossec.conf file before starting the Wazuh service
+ Setup the Wazuh service on Windows (was only called on Linux)
* Extract agent parameters common to both Linux and Windows out of the Linux case
+ Add the missing parameters for the Windows agent
- Remove all the parameters that are not relevant for agents from the params_agent.pp file
@jm404
Copy link
Contributor

jm404 commented Oct 23, 2019

Hi @JPLachance!

Great work here, I had a look at changes and they look good.

We will test it as soon as possible, we will verify the following checks:

Tests

  • Agent Installation on Windows

  • Agent Installation on RHEL/Centos

  • Agent Installation on Debian/Ubuntu

  • Manager installation

  • Ensure the ossec.conf files are properly configured

  • Ensure Agents properly register in the Manager

Thanks for such a big contribution, it's really appreciated.

Best regards,

Jose

* Make it clear that both "Manager verification using SSL" and "Agent verification using SSL" are not supported on Windows
@jm404
Copy link
Contributor

jm404 commented Oct 28, 2019

Hi @JPLachance,

Please ignore the failed result on tests, we are working on it and sometimes it shows false positives results.

Just reviewed the latest changes from 1f8ab30 and they look great!

Thanks for such a big contribution!

Best regards,

Jose

Copy link
Contributor

@jm404 jm404 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jm404 jm404 requested a review from manuasir October 28, 2019 07:31
@jm404 jm404 changed the base branch from master to devel October 28, 2019 07:34
@manuasir manuasir added this to To review in v3.11.x via automation Oct 28, 2019
Copy link
Contributor

@jm404 jm404 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @JPLachance ,

Please have a look at the requested changes

Best regards

Jose

manifests/agent.pp Outdated Show resolved Hide resolved
manifests/agent.pp Show resolved Hide resolved
! Fix the Wazuh agent MSI download path
Copy link
Contributor

@jm404 jm404 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After the changes it LGTM!

@manuasir manuasir merged commit 921374c into wazuh:devel Oct 30, 2019
v3.11.x automation moved this from To review to Done Oct 30, 2019
@JPLachance JPLachance deleted the fix-windows-agent branch December 5, 2019 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
v3.11.x
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants