Closed L1ghtn1ng closed 8 months ago
so it turns out the reboot issue is due to https://github.com/wazuh/wazuh/issues/19994
@L1ghtn1ng I'm not an expert in GPO but I think that this issue is related to https://github.com/wazuh/wazuh/issues/20138 instead of https://github.com/wazuh/wazuh/issues/19994.
Remote upgrades use a custom package (WPK) which wraps the official MSI package and performs extra operations:
The last point is what was causing the problem, and the solution was to add the /norestart
option: https://github.com/wazuh/wazuh/pull/20081.
On the other hand, the WPK and its logic are not related to GPO upgrades, which simply run the official MSI. We have to investigate this better, but with what we know for now, the solution would be to indicate during the update that the system should not reboot:
echo N | gpupdate /force
Reference: gpupdate with auto no for logoff and shutdown
If you know of a better option, or one that fits better with the standard way of working with GPO, we would appreciate your guidance.
Best regards.
@vikman90 No its not the issue you listed, but the one I listed, but I know thats regression that will fix that issue. But what I mean by GPO is what does it need to be able to use the agent_upgrade CLI/API to work when you have locked down systems. Basically from what I have found is that on Windows, out of the box remote upgrades fail due to msiexec needing to be set either via local group policy or via a domain controller to set it to always use admin privs when installing otherwise it fails. Then in my case due to the regession with the 4.6.0 agent it then ended up rebooting the system. So can we get docs added which will tell people how to get remote upgrading via the agent_upgrade to work?
@L1ghtn1ng Of course. To be honest, I'm not familiar with group policies. We are going to investigate it, propose what is necessary (documentation and/or programming) and we will comment on the updates here.
Thanks for the clarification.
@vikman90 any updates as of yet? It's been a few weeks now and thought I would have heard something.
@L1ghtn1ng This issue is still in the backlog. We'll take it ASAP and keep you posted.
Thanks victor
On 20 Dec 2023, at 09:36, Victor M. Fernandez-Castro @.***> wrote:
@L1ghtn1nghttps://github.com/L1ghtn1ng This issue is still in the backlog. We'll take it ASAP and keep you posted.
— Reply to this email directly, view it on GitHubhttps://github.com/wazuh/wazuh-documentation/issues/6739#issuecomment-1864148330, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AA3V2QVA6NAFLNUDLAFYRZTYKKWR7AVCNFSM6AAAAAA7C257GOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRUGE2DQMZTGA. You are receiving this because you were mentioned.Message ID: @.***>
Just started working on this, conducting some research.
Following the Wazuh documentation, I am encountering some issues with creating a Group Policy. I wasn't able to run the Group Policy Management Console (GPMC) on Windows 11 Pro (Build: 22454.1000) and Windows Server 2019 (Build: 17763).
I was able to run the Group Policy Management Console (GPMC) using this box (cdaf/WindowsServerDC). I am now attempting to configure Active Directory to proceed with the installation of the Wazuh agent using Windows GPO
After some back and forth, I was able to configure the VirtualBox network, allowing me to add a computer to the Active Directory domain. Now, I am ready to start working on Creating a Group Policy.
Once I configured the GPO in Active Directory, I encountered some issues with time synchronization, preventing me from updating the policy.
After resolving this issue, I ran the following command:
gpupdate /force
Updating policy...
Computer Policy update has completed successfully.
User Policy update has completed successfully.
However, the Wazuh agent wasn't installed. Therefore, I need to continue working on this.
Finally, I was able to upgrade wazuh-agent 4.5.1 to 4.6.0 using GPO. To do that I had to:
I used it as a workstation (box: tranphuquy19/win11x64-professional) where I did:
On Windows Server 2022 I had to add the package of wazuh-agent 4.6.0 for the upgrade process, so I did:
To complete the upgrade I had to do on the workstation:
gpupdate /force
In the next image we can see wazuh-agent was upgraded:
I conducted research to identify a GPO configuration that avoids restarting the Wazuh agent, but unfortunately, I was unsuccessful. However, I did find some configurations that can prevent Windows from rebooting:
Access the GPO at Computer Configuration -> Administrative Templates -> System -> Logon.
Navigate to Administrative Templates -> Windows Components -> Windows Update.
Its missing what GPO's on windows you need to allow if you have a locked down windows which seems to be allow msiexec and make sure msiexec is set to run with admin privs.
So, if we are referring to this blog documentation, it is crucial to mention that the operations desktop (Workstation) should join the domain as an Administrator.
The big issue that is also missing in the docs is that the remote upgrade can reboot windows!
I tested several times and I got always this behaviour
The software will only install during a reboot and the computer must have its GPO settings updated. GPO settings will refresh automatically every 90 minutes.
To force the GPO settings you can use the gpupdate /force command.
Note: This requires user confirmation for the reboot.
I will mark this issue as blocked, awaiting further instructions. Some possibilities include:
I created this document to explain the GPO processes. GPO doc
I tested the command suggested by @vikman90, and It is useful in scenarios where you want to initiate the update without user intervention or when scripting the process. However, keep in mind that the installation or upgrade process may only take effect after a subsequent system reboot or when a user logs on.
Note: This issue will be blocked until the Content team can make the changes.
Its missing what GPO's on windows you need to allow if you have a locked down windows which seems to be allow msiexec and make sure msiexec is set to run with admin privs. The big issue that is also missing in the docs is that the remote upgrade can reboot windows!!! Found this out the hard-way this morning which needs to be added big time.