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

Generate ARM ready macOS packages #2086

Closed
alberpilot opened this issue Feb 9, 2023 · 6 comments · Fixed by #2224
Closed

Generate ARM ready macOS packages #2086

alberpilot opened this issue Feb 9, 2023 · 6 comments · Fixed by #2224
Assignees

Comments

@alberpilot
Copy link
Contributor

alberpilot commented Feb 9, 2023

Wazuh version Install type Action performed Platform
4.4.2 Agent Install macOS

To do after: https://github.com/wazuh/wazuh-jenkins/issues/5313

Summary

The macOS installer builder tool should be able to create a package ready to be installed natively in Apple silicon M1 and M2 processors (and their variants).

Related issue: wazuh/wazuh#15055

Tasks

@alberpilot
Copy link
Contributor Author

Blocked by: wazuh/wazuh#16127

@teddytpc1 teddytpc1 added level/task Subtask issue level/epic Epic issue and removed level/task Subtask issue level/epic Epic issue labels Apr 26, 2023
@DFolchA DFolchA changed the title Adapt the Wazuh macOS installer builder allowing Apple silicon processors package Generate ARM ready macOS packages May 19, 2023
@wazuhci wazuhci moved this to Backlog in Release 4.4.3 May 19, 2023
@DFolchA DFolchA self-assigned this May 19, 2023
@wazuhci wazuhci moved this from Backlog to Blocked in Release 4.4.3 May 19, 2023
@teddytpc1 teddytpc1 added level/task Subtask issue type/enhancement Enhancement issue labels May 22, 2023
@wazuhci wazuhci moved this to Blocked in Release 4.4.4 May 23, 2023
@davidjiglesias davidjiglesias moved this from Blocked to Backlog in Release 4.4.4 May 25, 2023
@wazuhci wazuhci moved this from Backlog to Blocked in Release 4.4.4 May 25, 2023
@wazuhci wazuhci moved this from Blocked to In progress in Release 4.4.4 May 26, 2023
@DFolchA
Copy link
Contributor

DFolchA commented May 29, 2023

Update

Work on compilation using package building tool in macOS ARM.

@DFolchA
Copy link
Contributor

DFolchA commented Jun 1, 2023

Update

Successfully compile and generate package in macOS BigSur ARM:

+ cp -r /Users/ec2-user/wazuh-packages/macos/repository/wazuh/ruleset/sca/generic /Library/Ossec/packages_files/agent_installation_scripts/sca
+ cp /Users/ec2-user/wazuh-packages/macos/repository/wazuh/etc/templates/config/generic/sca.files /Library/Ossec/packages_files/agent_installation_scripts/sca/generic/
+ cp /Users/ec2-user/wazuh-packages/macos/repository/wazuh/etc/templates/config/darwin/15/sca.files /Library/Ossec/packages_files/agent_installation_scripts/sca/darwin/15/
+ cp /Users/ec2-user/wazuh-packages/macos/repository/wazuh/etc/templates/config/darwin/16/sca.files /Library/Ossec/packages_files/agent_installation_scripts/sca/darwin/16/
+ cp /Users/ec2-user/wazuh-packages/macos/repository/wazuh/etc/templates/config/darwin/17/sca.files /Library/Ossec/packages_files/agent_installation_scripts/sca/darwin/17/
+ cp /Users/ec2-user/wazuh-packages/macos/repository/wazuh/etc/templates/config/darwin/18/sca.files /Library/Ossec/packages_files/agent_installation_scripts/sca/darwin/18/
+ cp /Users/ec2-user/wazuh-packages/macos/repository/wazuh/etc/templates/config/darwin/19/sca.files /Library/Ossec/packages_files/agent_installation_scripts/sca/darwin/19/
+ cp /Users/ec2-user/wazuh-packages/macos/repository/wazuh/etc/templates/config/darwin/20/sca.files /Library/Ossec/packages_files/agent_installation_scripts/sca/darwin/20/
+ cp /Users/ec2-user/wazuh-packages/macos/repository/wazuh/etc/templates/config/darwin/21/sca.files /Library/Ossec/packages_files/agent_installation_scripts/sca/darwin/21/
+ cp /Users/ec2-user/wazuh-packages/macos/repository/wazuh/etc/templates/config/darwin/22/sca.files /Library/Ossec/packages_files/agent_installation_scripts/sca/darwin/22/
+ cp /Users/ec2-user/wazuh-packages/macos/repository/wazuh/src/VERSION /Library/Ossec/packages_files/agent_installation_scripts/src/
+ cp /Users/ec2-user/wazuh-packages/macos/repository/wazuh/src/REVISION /Library/Ossec/packages_files/agent_installation_scripts/src/
Build Successful (less than a second)
The wazuh agent package for MacOS X has been successfully built.
wazuh-modulesd not running...
wazuh-logcollector not running...
wazuh-syscheckd not running...
wazuh-agentd not running...
wazuh-execd not running...
Wazuh v4.4.4 Stopped
No receipt for 'com.wazuh.pkg.wazuh-agent' found at '/'.
No receipt for 'com.wazuh.pkg.wazuh-agent-etc' found at '/'.

Wazuh agent correctly removed from the system.

Detected error: When installing the packages a message prompt appears indicating that the package is built for 64-bit and cannot be installed

image

Check process type of daemons compiled in macOS silicon:
image

In comparison with the ones installed with 4.4.3 package:
image

@DFolchA
Copy link
Contributor

DFolchA commented Jun 2, 2023

Update

Add check for ARM architecture to SPECS:

		<key>PROJECT_REQUIREMENTS</key>
		<dict>
			<key>LIST</key>
			<array>
				<dict>
					<key>BEHAVIOR</key>
					<integer>3</integer>
					<key>DICTIONARY</key>
					<dict>
						<key>IC_REQUIREMENT_CPU_ARCHITECTURE_FAMILY</key>
						<integer>3</integer>
						<key>IC_REQUIREMENT_CPU_INTEL_ARCHITECTURE_TYPE</key>
						<integer>0</integer>
						<key>IC_REQUIREMENT_CPU_MINIMUM_CPU_CORES_COUNT</key>
						<integer>1</integer>
						<key>IC_REQUIREMENT_CPU_MINIMUM_FREQUENCY</key>
						<integer>866666</integer>
						<key>IC_REQUIREMENT_CPU_POWERPC_ARCHITECTURE_TYPE</key>
						<integer>0</integer>
					</dict>

Verify that this check doesn't allow the package to be installed on Intel systems:

sh-3.2# installer -pkg wazuh-agent-4.4.4-1.pkg -target /
installer: Error - Wazuh Agent can’t be installed on this computer.

Test package in different systems:

  • ARM64
    • Ventura
    • Monterey
    • BigSur
  • Intel
    • Mojave
    • Catalina
    • BigSur

Add a new parameter to generate_wazuh_package.sh to select architecture.

@rauldpm
Copy link
Member

rauldpm commented Jul 20, 2023

This issue needs to be tested on virtual machines created for Vagrant parallels.
This issue will be done in parallel to https://github.com/wazuh/wazuh-jenkins/issues/4710

@wazuhci wazuhci moved this from Blocked to Backlog in Release 4.5.1 Jul 25, 2023
@jotacarma90 jotacarma90 linked a pull request Jul 25, 2023 that will close this issue
@wazuhci wazuhci moved this from Backlog to Blocked in Release 4.5.1 Jul 28, 2023
@wazuhci wazuhci moved this from Blocked to In progress in Release 4.5.1 Aug 2, 2023
@DFolchA
Copy link
Contributor

DFolchA commented Aug 2, 2023

Update

Updated ETA due to delays in https://github.com/wazuh/wazuh-jenkins/issues/4710

@vikman90 vikman90 closed this as completed Aug 4, 2023
@wazuhci wazuhci moved this from In progress to Done in Release 4.5.1 Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants