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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS (PKG) Installer Creation #135

Closed
Tracked by #128
vikman90 opened this issue Sep 11, 2024 · 1 comment · Fixed by #376 or #483
Closed
Tracked by #128

macOS (PKG) Installer Creation #135

vikman90 opened this issue Sep 11, 2024 · 1 comment · Fixed by #376 or #483
Assignees
Labels
level/subtask Subtask issue module/packages Agent packages type/enhancement Enhancement issue

Comments

@vikman90
Copy link
Member

Parent Issue:

Description

This issue involves creating a PKG installer for macOS to enable easy installation of the Wazuh agent. The installer should set up the agent as a launch daemon, configure necessary permissions, and handle post-installation tasks.

Functional Requirements

  • Develop a PKG installer for the Wazuh agent on macOS 14+.
  • Ensure the installer sets up the Wazuh agent as a launch daemon.
  • Handle file permissions, configuration files, and any required installation scripts.

Acceptance Criteria

  • The PKG installer successfully installs the Wazuh agent on macOS.
  • The Wazuh agent is configured as a launch daemon and starts automatically after installation.
  • The installation, uninstallation, and upgrade processes are tested and verified on macOS 14+.
@vikman90 vikman90 added type/enhancement Enhancement issue level/subtask Subtask issue phase/mvp module/packages Agent packages labels Sep 11, 2024
@vikman90 vikman90 removed the mvp label Oct 28, 2024
@mjcr99 mjcr99 self-assigned this Nov 13, 2024
@mjcr99
Copy link
Member

mjcr99 commented Nov 13, 2024

Update:

(13/11/2024) Updated code to bring last changes from wazuh/wazuh, working on changing the build process and adding new files.
(14/11/2024) Adapting the mac OS generation script to handle binary caching and cover derivated dependencies.
(15/11/2024) Currently working on modifications for the install process in mac OS. Having problems with Cmake and installing the built agent in / direcotories. Moved to on hold.
(21/11/2024) Updated scripts to deal with package building dependencies.
(27/11/2024) Resumed work, updated Cmakelist.txt to deal with Mac OS and Linux Service files.
(28/11/2024) Packages are able to be built, still pending solve some problems regarding installation path since we following log appearing when trying to install:

vagrant@idr-1819-sonoma-14 macos % sudo installer -pkg output/wazuh-agent_5.0.0-1_intel64_ab34bf38d.pkg -target /
installer: Package name is wazuh-agent_5.0.0-1_intel64_ab34bf38d
installer: Installing at base path /
installer: The install failed. (The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance. The package is attempting to install content to the system volume.)

(29/11/2024) Regarding the problem related to the installation path some research have been done.
The following packages have been downloaded and inspected to understand their structure:

vagrant@idr-1819-sonoma-14 ~ % ls -l pkg_files                                                                               
total 1605104
-rw-r--r--  1 vagrant  staff  370007450 29 nov 02:15 MonoFramework-MDK-6.12.0.206.macos10.xamarin.universal.pkg
-rw-r--r--  1 vagrant  staff  113838696 29 nov 01:54 Slack-4.41.98-macOS.pkg
-rw-r--r--  1 vagrant  staff  131198478 29 nov 02:43 VirtualBox.pkg
-rw-r--r--  1 vagrant  staff  199901970 29 nov 02:01 googlechrome.pkg
-rw-r--r--  1 vagrant  staff    6856848 29 nov 01:56 wazuh-agent-4.9.2-1.intel64.pkg

All external packages except Mono use a scaffolding where the package's files are installed in the root directory, in a folder with the name <program_name>.app, for example, for the case of Google Chrome we see: ./Google Chrome.app/.

Under this main folder, it has been observed, there is a unique folder named Contents, and under it, there are different folders such as Library, Frameworks, and Resources. We should consider using this type of package structure since it seems to be the most widely used.

Some other packages, that have been downloaded as .dmg files (disc images) can be mounted and also present this kind of structure. Refer to this documentation page for more information.
(02/12/2024) Opened final PR with proposed solution:

(05/12/2024) Updated script options to better manage different phases of the package building procedure.

@wazuhci wazuhci moved this to On hold in XDR+SIEM/Release 5.0.0 Nov 18, 2024
@wazuhci wazuhci moved this from On hold to In progress in XDR+SIEM/Release 5.0.0 Nov 21, 2024
@wazuhci wazuhci moved this from In progress to On hold in XDR+SIEM/Release 5.0.0 Nov 21, 2024
@wazuhci wazuhci moved this from On hold to In progress in XDR+SIEM/Release 5.0.0 Nov 27, 2024
@mjcr99 mjcr99 linked a pull request Dec 2, 2024 that will close this issue
@wazuhci wazuhci moved this from In progress to Pending review in XDR+SIEM/Release 5.0.0 Dec 2, 2024
@wazuhci wazuhci moved this from Pending review to In review in XDR+SIEM/Release 5.0.0 Dec 2, 2024
@wazuhci wazuhci moved this from In review to Pending final review in XDR+SIEM/Release 5.0.0 Dec 4, 2024
@wazuhci wazuhci moved this from Pending final review to Done in XDR+SIEM/Release 5.0.0 Dec 5, 2024
@mjcr99 mjcr99 linked a pull request Jan 7, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
level/subtask Subtask issue module/packages Agent packages type/enhancement Enhancement issue
Projects
Status: Done
2 participants