-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Integrate OpenSSL in vcpkg of wazuh-engine project #27103
Comments
Expanded ETA. This task has not been started because of work on other, higher priority issues. |
UpdateDependency of libcurl and OpenSSL in the geo moduleThe geo module initially had a dependency on the libcurl library, which in turn includes OpenSSL. This was verified using the following command: ar -t build/vcpkg_installed/x64-linux/lib/libcurl.a | grep open
The output showed that libcurl depended on OpenSSL: fopen.c.o
openldap.c.o
openssl.c.o This behavior was identified because libcurl typically includes OpenSSL in its build, which can cause the project to end up using an undesired version of OpenSSL if linked directly with libcurl. Change Made: Replacing libcurl with urlRequestIn order to avoid the unwanted dependency on OpenSSL through libcurl, it was decided to replace libcurl with the urlRequest library. urlRequest is a more controllable alternative that does not include OpenSSL, allowing for more precise control over the OpenSSL dependencies in the project. Additionally, the OpenSSL library provided by vcpkg was explicitly included to ensure the specific version of OpenSSL desired is used, instead of the version linked with libcurl. Dependency of liblzma and Libarchive in the filesystem moduleOn the other hand, the filesystem module has important dependencies that need to be highlighted:
Running the following command to inspect the dependencies in libarchive: nm build/vcpkg_installed/x64-linux/lib/libarchive.a | grep -i ssl
It was observed that libarchive uses OpenSSL, specifically in the following reference: U OPENSSL_cleanse This confirms that libarchive depends on OpenSSL. Next Steps: Investigating libarchive Configuration to Use Custom OpenSSLSince libarchive depends on OpenSSL and we are using vcpkg to manage our dependencies, it is necessary to investigate whether it is possible to configure libarchive to use the version of OpenSSL provided by vcpkg instead of the default version linked in the libarchive package. It is important to check if libarchive’s build can be adjusted to disable its internal version of OpenSSL and instead use the version of OpenSSL installed by vcpkg. This would ensure that the project uses a consistent and controlled version of OpenSSL, avoiding potential conflicts or security issues. Conclusion
|
UpdateIn vcpkg, transient dependencies are by design marked as public, meaning they are automatically exposed to packages that depend on them. While this approach simplifies dependency resolution, it can lead to problems related to environment pollution, high build times, and lack of control over which dependencies should be visible to other packages.
An effective solution to control the propagation of transient dependencies is through port overrides in vcpkg. This method allows you to redefine unwanted dependencies to do nothing, preventing them from being downloaded or propagated to the global environment. microsoft/vcpkg#24558 (comment) |
UpdateIssue blocked by microsoft/vcpkg#43251 |
UpdateAll headers for libraries installed with vcpkg are placed in the <vcpkg_installed>/include directory. |
Description
Currently, Wazuh-Engine depends on the system-installed OpenSSL library, which can lead to inconsistencies due to varying versions across different environments. To ensure version control and consistency, we need to integrate OpenSSL into the Wazuh-Engine project using vcpkg. This approach will allow us to specify and manage the OpenSSL version explicitly, enhancing build reliability and eliminating the need to install OpenSSL via system package managers during Docker builds.
Objectives
Version-Controlled OpenSSL Dependency:
vcpkg.json
manifest file in the Wazuh-Engine project.CMake Configuration:
geo
andfs
modules.Docker Build Optimization:
apt
oryum
when building Docker images for DEB and RPM package creation.Tasks
Add OpenSSL to
vcpkg.json
:vcpkg.json
file in the Wazuh-Engine project to include OpenSSL as a dependency.Modify CMake Configuration:
CMakeLists.txt
files to link OpenSSL from vcpkg to thegeo
andfs
modules.find_package
andtarget_link_libraries
commands correctly reference the vcpkg-managed OpenSSL.Update Docker Build Scripts:
apk
,yum
, or other package manager commands that install OpenSSL in the Dockerfiles used for building DEB and RPM packages.Testing and Validation:
geo
andfs
modules, to confirm functionality.Acceptance Criteria
vcpkg.json
file.geo
andfs
modules are successfully linked to OpenSSL via CMake using vcpkg.apt
,yum
, or other package managers.The text was updated successfully, but these errors were encountered: