-
Notifications
You must be signed in to change notification settings - Fork 97
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
Cannot install macOS package on macOS Ventura 13.4 #2205
Cannot install macOS package on macOS Ventura 13.4 #2205
Comments
UpdatePackage background
Attempt 1 to reproduce the issueTrying on faster env to test this ec2-user@ip-172-31-46-65 ~ % sw_vers
ProductName: macOS
ProductVersion: 13.2.1
BuildVersion: 22D68 ec2-user@ip-172-31-46-65 ~ % csrutil status
System Integrity Protection status: unknown (Custom Configuration).
Configuration:
Apple Internal: disabled
Kext Signing: enabled
Filesystem Protections: disabled
Debugging Restrictions: enabled
DTrace Restrictions: enabled
NVRAM Protections: enabled
BaseSystem Verification: enabled
This is an unsupported configuration, likely to break in the future and leave your machine in an unknown state. ec2-user@ip-172-31-46-65 ~ % system_profiler SPSoftwareDataType
Software:
System Software Overview:
System Version: macOS 13.2.1 (22D68)
Kernel Version: Darwin 22.3.0
Boot Volume: Macintosh HD
Boot Mode: Normal
User Name: ec2-user (ec2-user)
Secure Virtual Memory: Enabled
System Integrity Protection: Disabled
Time since boot: 5 hours, 27 minutes
ec2-user@ip-172-31-46-65 ~ % curl -LO https://packages.wazuh.com/4.x/macos/wazuh-agent-4.4.2-1.pkg
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 5549k 100 5549k 0 0 149M 0 --:--:-- --:--:-- --:--:-- 180M
ec2-user@ip-172-31-46-65 ~ % shasum -a 512 wazuh-agent-4.4.2-1.pkg
b87e895e5e95de04018e9788c6d5717a7a3ff58f4b93c880a20bf52a7a0903bf054cdaa70baf82117d493e106edbfdc4f006758218b56fd23d1e27968290d846 wazuh-agent-4.4.2-1.pkg
ec2-user@ip-172-31-46-65 ~ % pkgutil --check-signature wazuh-agent-4.4.2-1.pkg
Package "wazuh-agent-4.4.2-1.pkg":
Status: signed by a developer certificate issued by Apple for distribution
Notarization: trusted by the Apple notary service
Signed with a trusted timestamp on: 2023-05-12 15:57:24 +0000
Certificate Chain:
1. Developer ID Installer: Wazuh Inc (KLZK8P68R5)
Expires: 2027-02-01 22:12:15 +0000
SHA256 Fingerprint:
A8 8F B5 40 D9 1F 9A 4C AF DC 57 3F E7 7D 63 30 38 A1 78 7D 1C 05
54 80 27 EA D4 B9 C6 47 7E 1E
------------------------------------------------------------------------
2. Developer ID Certification Authority
Expires: 2027-02-01 22:12:15 +0000
SHA256 Fingerprint:
7A FC 9D 01 A6 2F 03 A2 DE 96 37 93 6D 4A FE 68 09 0D 2D E1 8D 03
F2 9C 88 CF B0 B1 BA 63 58 7F
------------------------------------------------------------------------
3. Apple Root CA
Expires: 2035-02-09 21:40:36 +0000
SHA256 Fingerprint:
B0 B1 73 0E CB C7 FF 45 05 14 2C 49 F1 29 5E 6E DA 6B CA ED 7E 2C
68 C5 BE 91 B5 A1 10 01 F0 24 CONCLUSION: AWS provides only macOS Ventura 13.2.1 x86_64 with SIP disabled and could not be changed, so a native hardware/vm should be used Attempt 2 to reproduce the issueec2-user@ip-172-31-44-53 ~ % sw_vers
ProductName: macOS
ProductVersion: 13.2.1
BuildVersion: 22D68
ec2-user@ip-172-31-44-53 ~ % system_profiler SPSoftwareDataType
Software:
System Software Overview:
System Version: macOS 13.2.1 (22D68)
Kernel Version: Darwin 22.3.0
Boot Volume: Macintosh HD
Boot Mode: Normal
User Name: ec2-user (ec2-user)
Secure Virtual Memory: Enabled
System Integrity Protection: Enabled
Time since boot: 5 minutes, 39 seconds
ec2-user@ip-172-31-44-53 ~ %
ec2-user@ip-172-31-44-53 ~ % csrutil status
System Integrity Protection status: enabled.
ec2-user@ip-172-31-44-53 ~ % uname -a
Darwin ip-172-31-44-53.ec2.internal 22.3.0 Darwin Kernel Version 22.3.0: Mon Jan 30 20:39:35 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T8103 arm64
ec2-user@ip-172-31-44-53 ~ % curl -LO https://packages.wazuh.com/4.x/macos/wazuh-agent-4.4.2-1.pkg
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 5549k 100 5549k 0 0 71.4M 0 --:--:-- --:--:-- --:--:-- 75.2M
ec2-user@ip-172-31-44-53 ~ % launchctl setenv WAZUH_MANAGER "10.0.0.2"
Not privileged to set domain environment.
ec2-user@ip-172-31-44-53 ~ % installer -pkg wazuh-agent-4.4.2-1.pkg -target /
installer: This package requires Rosetta 2 to be installed.
Please install Rosetta 2 and then try again.
`sudo softwareupdate --install-rosetta`
installer: Error - Wazuh Agent can’t be installed on this computer.
ec2-user@ip-172-31-44-53 ~ % sudo softwareupdate --install-rosetta
I have read and agree to the terms of the software license agreement. A list of Apple SLAs may be found here: http://www.apple.com/legal/sla/
Type A and press return to agree: A
2023-05-19 19:20:21.019 softwareupdate[774:7970] Package Authoring Error: 032-48321: Package reference com.apple.pkg.RosettaUpdateAuto is missing installKBytes attribute
Install of Rosetta 2 finished successfully
ec2-user@ip-172-31-44-53 ~ % installer -pkg wazuh-agent-4.4.2-1.pkg -target /
installer: Must be run as root to install this package.
ec2-user@ip-172-31-44-53 ~ %
ec2-user@ip-172-31-44-53 ~ %
ec2-user@ip-172-31-44-53 ~ %
ec2-user@ip-172-31-44-53 ~ %
ec2-user@ip-172-31-44-53 ~ %
ec2-user@ip-172-31-44-53 ~ % sudo launchctl setenv WAZUH_MANAGER "10.0.0.2" && installer -pkg wazuh-agent-4.4.2-1.pkg -target /
ec2-user@ip-172-31-44-53 ~ % launchctl setenv WAZUH_MANAGER "10.0.0.2" && installer -pkg wazuh-agent-4.4.2-1.pkg -target /
Not privileged to set domain environment.
ec2-user@ip-172-31-44-53 ~ % sudo launchctl setenv WAZUH_MANAGER "10.0.0.2" && installer -pkg wazuh-agent-4.4.2-1.pkg -target /
installer: Must be run as root to install this package.
ec2-user@ip-172-31-44-53 ~ % sudo -s
root@ip-172-31-44-53 ~ # launchctl setenv WAZUH_MANAGER "10.0.0.2" && installer -pkg wazuh-agent-4.4.2-1.pkg -target /
installer: Package name is Wazuh Agent
installer: Installing at base path /
installer: The install was successful.
Attempt 3: use macOS Ventura 13.4It was found that there's an issue on Proposal
|
UpdateSince
|
UpdateInvestigate how to remove the Tested adding the following key:
In the SPEC file. Also, investigate the usage of pre and post upgrade scripts. |
UpdateSince Possible solutionsSolution 1: Custom environment file with an aux scriptCreate and distribute an aux script that takes well-defined environment variables available here and create a file that inner installer scripts will use as environment variable files Usage example curl -so wazuh-agent.pkg https://packages.wazuh.com/4.x/macos/wazuh-agent-4.4.2-1.pkg && curl -so wazuh-agent.pkg https://packages.wazuh.com/4.x/wazuh_macos_envs.sh && chmod +x ./wazuh_macos_envs.sh && WAZUH_MANAGER="192.168.1.10" WAZUH_AGENT_GROUP 'default' ./wazuh_macos_envs.sh && sudo installer -pkg ./wazuh-agent.pkg -target / Steps:
At the end of step 4, a new file with a well-known path (this is absolutely necessary since step 5 will need to read it to populate the environments into ossec.conf) like
Step 5 will read and source NOTE: this file could also be created as root to avoid unprivileged access Solution 2: Custom environment file with manually-created command lineThis option is quite similar that the last one, creating a more unintuitive command line but without the needing of downloading a script curl -so wazuh-agent.pkg https://packages.wazuh.com/4.x/macos/wazuh-agent-4.4.2-1.pkg && echo -e "WAZUH_MANAGER='192.168.1.10'\nWAZUH_AGENT_GROUP='default' > `/tmp/wazuh-env` && sudo installer -pkg ./wazuh-agent.pkg -target / Steps:
At the end of step 2, a new file with a well-known path (this is absolutely necessary since step 3 will need to read it to populate the environments into ossec.conf) like
Step 3 will read and source NOTE: this file could also be created as root to avoid unprivileged access |
UpdateAfter discussing this with the team, we agreed that use Solution 2 PR: wazuh/wazuh#17195 Package: https://packages-dev.wazuh.com/trash/macos/wazuh-agent-4.4.3-0.deployvariables.pkg Documentation issue: wazuh/wazuh-documentation#6123 TODO:
|
UpdateAfter talking with the team we decided to use temporal files remove the TestsInstallation on macOS Ventura:
Upgrade in macOS Ventura:
|
UpdateA new approach/format was adopted for the development variables population using the temporary file.
Due to some optimizations in terms of usability and macOS availability of certain commands, the final specs about CLI installation command are
Related Github actions were fixed in order to test the new deployment variables approach @wazuh/frontend was updated and aware of this in the next comment wazuh/wazuh-dashboard-plugins#5466 (comment) |
UpdateTesting package with all the changes from these branches:
Package link: https://s3.us-west-1.amazonaws.com/packages-dev.wazuh.com/warehouse/test/4.4/macos/wazuh-agent-4.4.3-2205.Ventura.pkg macOS 10.15Install without variables
Install with variables
Upgrade with variables
Upgrade without variables
Uninstall
macOS 13.4Install without variables
Install with variables
Upgrade with variables
Upgrade without variables
Uninstall
|
We were notified that the macOS package cannot be installed on macOS Ventura 13.4 if integrity protection is enabled, resulting in the following error:
Probably this is caused by a notarization error in the package binaries
Tasks
Validation
Solution summary
/tmp/wazuh_envs
will be created before the proper installation command call. This file will contain Deployment variables defined by the user and will be ingested and erased during the installation process. The file owns to root user in order to avoid security issues.echo
command into/tmp/wazuh_envs
. The string specs&&
-separated concatenation of list of KEY='VALUE', being KEY the available development variables and VALUE the one specified by the userThe text was updated successfully, but these errors were encountered: