Date: Fri, 16 Jan 2026 09:09:08 +0000 From: Jose Alonso Cardenas Marquez <acm@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: b1f52980fe0a - main - security/wazuh-*: Update to 4.14.2 Message-ID: <696a0034.d536.6a0196a2@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch main has been updated by acm: URL: https://cgit.FreeBSD.org/ports/commit/?id=b1f52980fe0a34ccaa674408c92869aec9aac4fe commit b1f52980fe0a34ccaa674408c92869aec9aac4fe Author: Jose Alonso Cardenas Marquez <acm@FreeBSD.org> AuthorDate: 2026-01-16 08:55:42 +0000 Commit: Jose Alonso Cardenas Marquez <acm@FreeBSD.org> CommitDate: 2026-01-16 09:08:58 +0000 security/wazuh-*: Update to 4.14.2 - Now, Wazuh source code is obtained from https://github.com/alonsobsd/wazuh-freebsd. This repository includes all changes to run Wazuh Suite on FreeBSD. dtxdf and I will maintain this repository in where will try to add all Wazuh features to FreeBSD. - wazuh-dashboards : Update version of opensearch to 2.19.4 ChangeLog at: https://documentation.wazuh.com/current/release-notes/release-4-14-2.html Reviewed by: acm dtxdf Tested by: acm dtxdf --- security/wazuh-agent/Makefile | 20 +- security/wazuh-agent/distinfo | 80 +-- security/wazuh-agent/files/patch-api_Makefile | 19 - .../wazuh-agent/files/patch-etc_ossec-agent.conf | 59 -- .../wazuh-agent/files/patch-framework_Makefile | 22 - security/wazuh-agent/files/patch-src-Makefile | 190 ----- ...ch-src-shared_modules-utils_sqliteWrapperTemp.h | 34 - .../patch-src-shared_modules-utils_stringHelper.h | 44 -- .../patch-src-shared_modules-utils_timeHelper.h | 20 - .../files/patch-src-wazuh_modules_wm_database.c | 14 - .../files/patch-src_data__provider-CMakeLists.txt | 39 - ...patch-src_data__provider_src-sysInfoFreeBSD.cpp | 634 ---------------- ...__provider_src_extended__sources-CMakeLists.txt | 18 - ...der_src_extended__sources_groups-CMakeLists.txt | 22 - ...nded__sources_groups_include-groups_freebsd.hpp | 46 -- ..._sources_groups_include-user_groups_freebsd.hpp | 84 --- ...extended__sources_groups_src-groups_freebsd.hpp | 95 --- ...ded__sources_groups_src-user_groups_freebsd.hpp | 262 ------- ...ider_src_extended__sources_users-CMakeLists.txt | 21 - ...urces_users_include-logged_in_users_freebsd.hpp | 37 - ...tended__sources_users_include-users_freebsd.hpp | 69 -- ...__sources_users_src-logged_in_users_freebsd.cpp | 72 -- ...c_extended__sources_users_src-users_freebsd.cpp | 106 --- ...ended__sources_wrappers_unix-iutmpx_wrapper.hpp | 12 - ...tended__sources_wrappers_unix-utmpx_wrapper.hpp | 16 - ...sources_wrappers_unix_freebsd-group_wrapper.hpp | 93 --- ...ources_wrappers_unix_freebsd-igroup_wrapper.hpp | 70 -- ...urces_wrappers_unix_freebsd-ipasswd_wrapper.hpp | 72 -- ...ources_wrappers_unix_freebsd-passwd_wrapper.hpp | 96 --- .../files/patch-src_rootcheck_os__string.c | 12 - ...patch-src_shared__modules_dbsync_CMakeLists.txt | 11 - .../patch-src_shared__modules_rsync_CMakeLists.txt | 11 - .../patch-src_syscheckd_src_db_CMakeLists.txt | 11 - ...-src_wazuh__modules_syscollector_CMakeLists.txt | 11 - .../wazuh-agent/files/patch-tools_mitre_mitredb.py | 16 - security/wazuh-dashboard/Makefile | 4 +- security/wazuh-dashboard/distinfo | 10 +- security/wazuh-dashboard/pkg-plist | 798 ++++++++++++++++++++- security/wazuh-indexer/Makefile | 2 +- security/wazuh-indexer/distinfo | 6 +- security/wazuh-manager/Makefile | 27 +- security/wazuh-manager/distinfo | 156 ++-- security/wazuh-manager/files/check_pid.c | 103 --- security/wazuh-manager/files/patch-api_Makefile | 19 - .../files/patch-api_wrappers_generic__wrapper.sh | 18 - .../files/patch-etc_ossec-server.conf | 96 --- .../patch-framework-wazuh-core-cluster_utils.py | 33 - .../wazuh-manager/files/patch-framework_Makefile | 22 - .../patch-framework_wrappers_generic__wrapper.sh | 11 - .../files/patch-src-headers_notify_op.h | 29 - ...ch-src-shared_modules-utils_sqliteWrapperTemp.h | 34 - .../patch-src-shared_modules-utils_stringHelper.h | 44 -- .../patch-src-shared_modules-utils_timeHelper.h | 20 - .../files/patch-src-shared_notify_op.c | 29 - .../files/patch-src-wazuh_modules_wm_database.c | 14 - security/wazuh-manager/files/patch-src_Makefile | 181 ----- .../files/patch-src_analysisd_analysisd.c | 79 -- .../files/patch-src_data__provider-CMakeLists.txt | 39 - ...patch-src_data__provider_src-sysInfoFreeBSD.cpp | 634 ---------------- ...__provider_src_extended__sources-CMakeLists.txt | 18 - ...der_src_extended__sources_groups-CMakeLists.txt | 22 - ...nded__sources_groups_include-groups_freebsd.hpp | 46 -- ..._sources_groups_include-user_groups_freebsd.hpp | 84 --- ...extended__sources_groups_src-groups_freebsd.hpp | 95 --- ...ded__sources_groups_src-user_groups_freebsd.hpp | 262 ------- ...ider_src_extended__sources_users-CMakeLists.txt | 21 - ...urces_users_include-logged_in_users_freebsd.hpp | 37 - ...tended__sources_users_include-users_freebsd.hpp | 69 -- ...__sources_users_src-logged_in_users_freebsd.cpp | 72 -- ...c_extended__sources_users_src-users_freebsd.cpp | 106 --- ...ended__sources_wrappers_unix-iutmpx_wrapper.hpp | 12 - ...tended__sources_wrappers_unix-utmpx_wrapper.hpp | 16 - ...sources_wrappers_unix_freebsd-group_wrapper.hpp | 93 --- ...ources_wrappers_unix_freebsd-igroup_wrapper.hpp | 70 -- ...urces_wrappers_unix_freebsd-ipasswd_wrapper.hpp | 72 -- ...ources_wrappers_unix_freebsd-passwd_wrapper.hpp | 96 --- .../files/patch-src_headers_pthreads_op.h | 40 -- .../wazuh-manager/files/patch-src_headers_shared.h | 10 - .../files/patch-src_remoted_manager.c | 16 - .../files/patch-src_rootcheck_os__string.c | 12 - ...red__modules_content__manager_testtool_main.cpp | 11 - ...patch-src_shared__modules_dbsync_CMakeLists.txt | 11 - ...ared__modules_indexer__connector_CMakeLists.txt | 11 - ...tch-src_shared__modules_keystore_CMakeLists.txt | 19 - ...patch-src_shared__modules_router_CMakeLists.txt | 19 - .../patch-src_shared__modules_rsync_CMakeLists.txt | 11 - ...ch-src_shared__modules_utils_rocksDBQueueCF.hpp | 20 - ...tch-src_shared__modules_utils_socketWrapper.hpp | 14 - ..._shared__modules_utils_xz_fileDataCollector.hpp | 11 - .../patch-src_syscheckd_src_db_CMakeLists.txt | 19 - ...-src_wazuh__modules_syscollector_CMakeLists.txt | 11 - ...__modules_vulnerability__scanner_CMakeLists.txt | 28 - ...ner_testtool_databaseFeedManager_argsParser.hpp | 12 - ...bility__scanner_testtool_scanner_argsParser.hpp | 12 - ...y__scanner_testtool_wazuhDBQuery_CMakeLists.txt | 8 - ...lity_scanner_src_vulnerabilityScannerFacade.cpp | 14 - .../files/patch-tools_mitre_mitredb.py | 16 - security/wazuh-manager/files/pthreads_portable.c | 91 --- security/wazuh-manager/files/pthreads_portable.h | 50 -- security/wazuh-manager/pkg-plist | 68 +- security/wazuh-server/Makefile | 9 +- security/wazuh-server/distinfo | 18 +- security/wazuh-server/files/pkg-message.in | 9 +- 103 files changed, 980 insertions(+), 5627 deletions(-) diff --git a/security/wazuh-agent/Makefile b/security/wazuh-agent/Makefile index c5f31572243c..be8c1013bcb5 100644 --- a/security/wazuh-agent/Makefile +++ b/security/wazuh-agent/Makefile @@ -1,9 +1,8 @@ PORTNAME= wazuh -DISTVERSION= 4.14.1 +DISTVERSION= 4.14.2 DISTVERSIONPREFIX= v -PORTREVISION= 6 CATEGORIES= security -MASTER_SITES= https://packages.wazuh.com/deps/47/libraries/sources/:wazuh_sources +MASTER_SITES= https://packages.wazuh.com/deps/48/libraries/sources/:wazuh_sources PKGNAMESUFFIX= -agent DISTFILES= ${EXTERNAL_DISTFILES} DIST_SUBDIR= ${PORTNAME}-${DISTVERSION} @@ -16,20 +15,20 @@ WWW= https://github.com/wazuh/wazuh LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/LICENSE -LIB_DEPENDS= libnghttp2.so:www/libnghttp2 +LIB_DEPENDS= libnghttp2.so:www/libnghttp2 \ + libepoll-shim.so:devel/libepoll-shim USES= cmake:indirect cpe gmake perl5 readline shebangfix sqlite:3 uidfix USE_GITHUB= yes -GH_TUPLE= alonsobsd:wazuh-freebsd:${WAZUH_EXTRAFILE_TAGNAME}:wazuh +GH_ACCOUNT= alonsobsd +GH_PROJECT= wazuh-freebsd +GH_TAGNAME= e3b7f4ccbb4cf0004ca58b1e56e4fe2d1b7474a7 USE_RC_SUBR= ${PORTNAME}${PKGNAMESUFFIX} MAKE_ARGS+= TARGET=agent -WAZUH_EXTRAFILE= alonsobsd-${PORTNAME}-freebsd-${WAZUH_EXTRAFILE_TAGNAME}_GH0${EXTRACT_SUFX} -WAZUH_EXTRAFILE_TAGNAME=830a911 - EXTERNAL_DISTFILES= cJSON.tar.gz:wazuh_sources \ curl.tar.gz:wazuh_sources \ libdb.tar.gz:wazuh_sources \ @@ -119,11 +118,6 @@ post-extract: .for FILE in ${EXTERNAL_DISTFILES} @cd ${WRKSRC}/src/external && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/${FILE:S/:wazuh_sources//} ${EXTRACT_AFTER_ARGS} .endfor - @${MKDIR} ${WRKSRC}/ruleset/sca/freebsd - @${MKDIR} ${WRKSRC}/src/data_provider/src/extended_sources/wrappers/unix/freebsd - @cd ${WRKDIR} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} ${_DISTDIR}/${WAZUH_EXTRAFILE} ${EXTRACT_AFTER_ARGS} - @${MV} ${WRKDIR}/${PORTNAME}-freebsd-${WAZUH_EXTRAFILE_TAGNAME} ${WRKDIR}/wazuh-freebsd - @cd ${WRKDIR}/wazuh-freebsd/var/ossec/ruleset/sca && ${CP} *.yml ${WRKSRC}/ruleset/sca/freebsd/ post-patch: ${REINPLACE_CMD} -e 's|CC=|CC?=|g' -e 's|AR=|AR?=|g' ${WRKSRC}/src/external/bzip2/Makefile diff --git a/security/wazuh-agent/distinfo b/security/wazuh-agent/distinfo index 8033f494b83b..ec269151e66a 100644 --- a/security/wazuh-agent/distinfo +++ b/security/wazuh-agent/distinfo @@ -1,41 +1,39 @@ -TIMESTAMP = 1768122381 -SHA256 (wazuh-4.14.1/cJSON.tar.gz) = da809f70b7d03ac529ae6223d4390bfa26cd29f8c32c8e8b3b631efa1667892d -SIZE (wazuh-4.14.1/cJSON.tar.gz) = 27920 -SHA256 (wazuh-4.14.1/curl.tar.gz) = 30cf7142e4282718ceb237e17b5cbf75afcd7c9f3880a039c5efea62db094709 -SIZE (wazuh-4.14.1/curl.tar.gz) = 4537356 -SHA256 (wazuh-4.14.1/libdb.tar.gz) = 7e9c44e8c7fdb186ff521a8d085b1bfa634d342dcc777ecea1fbf9a98ab5dc5e -SIZE (wazuh-4.14.1/libdb.tar.gz) = 3874990 -SHA256 (wazuh-4.14.1/libffi.tar.gz) = 0e971f64bacc22094e89f034bba075b40ecc2c2c2900eecd7ae85815fd6c9f69 -SIZE (wazuh-4.14.1/libffi.tar.gz) = 964576 -SHA256 (wazuh-4.14.1/libyaml.tar.gz) = 35daad608b372d5ce099f738c0f21bfcc03d6920d92f448386c584e664f1376a -SIZE (wazuh-4.14.1/libyaml.tar.gz) = 424656 -SHA256 (wazuh-4.14.1/openssl.tar.gz) = 0386fe3a0bf48bae2ca4d1742a53df9a8fcb1b73583ba22e8f8a7ddfa1375cd9 -SIZE (wazuh-4.14.1/openssl.tar.gz) = 53793192 -SHA256 (wazuh-4.14.1/procps.tar.gz) = 221f395e29d1bdbe4bacc9db39602eee0bae685a935437be0d7feb42e3192d07 -SIZE (wazuh-4.14.1/procps.tar.gz) = 55897 -SHA256 (wazuh-4.14.1/sqlite.tar.gz) = a81bff30bb4affd1b06a4983ff88ef827b4abaea3191b39aff7edb28d1ddd003 -SIZE (wazuh-4.14.1/sqlite.tar.gz) = 2564870 -SHA256 (wazuh-4.14.1/zlib.tar.gz) = b59d38149f0c29ec54d2766611ebc5a51a032bf9717e39a9af00fb6cb8532b8b -SIZE (wazuh-4.14.1/zlib.tar.gz) = 1593304 -SHA256 (wazuh-4.14.1/audit-userspace.tar.gz) = e82a32e5edf93b055160e14bc97f41dead39287925851dc80a7638e2d4d30434 -SIZE (wazuh-4.14.1/audit-userspace.tar.gz) = 1682820 -SHA256 (wazuh-4.14.1/msgpack.tar.gz) = 06d63bcf32896cd0af5480c401134b1ad1c166fd84ebe5b486e792101ee854e2 -SIZE (wazuh-4.14.1/msgpack.tar.gz) = 591294 -SHA256 (wazuh-4.14.1/bzip2.tar.gz) = 27688ee0316a64b39e511b2c224070cad97c394a5f711f9d055fc1809d895bcd -SIZE (wazuh-4.14.1/bzip2.tar.gz) = 71277 -SHA256 (wazuh-4.14.1/nlohmann.tar.gz) = 6e304c0942ac65f76f012a0ec64dde90e00273b6cc5a498b37cfdd16155e08b0 -SIZE (wazuh-4.14.1/nlohmann.tar.gz) = 141576 -SHA256 (wazuh-4.14.1/googletest.tar.gz) = 8c1e8a0a7f221c2125e99e6acb709da2ba472476b4d057c58de504bebf38d417 -SIZE (wazuh-4.14.1/googletest.tar.gz) = 885874 -SHA256 (wazuh-4.14.1/libpcre2.tar.gz) = 5a80d654d7d14b3db9fa3a49d7bf44a498683b46784a88cec514a8b194767b92 -SIZE (wazuh-4.14.1/libpcre2.tar.gz) = 1329651 -SHA256 (wazuh-4.14.1/libplist.tar.gz) = 88278d4bdfc1bd6a3a1a55a4f3d933683d2732ba09cf7a749fe8ec8eec406e3c -SIZE (wazuh-4.14.1/libplist.tar.gz) = 1520623 -SHA256 (wazuh-4.14.1/libarchive.tar.gz) = 540ff4a55defa75778a2c40567a830648ce5367b8aea123366874d96b734ef80 -SIZE (wazuh-4.14.1/libarchive.tar.gz) = 2360242 -SHA256 (wazuh-4.14.1/popt.tar.gz) = d6880a06622ca32dc4aa39ad5dcf7bef2faa81bd931afbe64ba434ad8fee1daa -SIZE (wazuh-4.14.1/popt.tar.gz) = 891309 -SHA256 (wazuh-4.14.1/wazuh-wazuh-v4.14.1_GH0.tar.gz) = aa59cb2baa7e7d38d8bb4ff6a22afbf2945de4fb555f9b8bb2657b6f89a773ed -SIZE (wazuh-4.14.1/wazuh-wazuh-v4.14.1_GH0.tar.gz) = 19810038 -SHA256 (wazuh-4.14.1/alonsobsd-wazuh-freebsd-830a911_GH0.tar.gz) = 4babef38a076f8be886d7190e18f6432f72671753ec96aaedc7e8d25b5c90259 -SIZE (wazuh-4.14.1/alonsobsd-wazuh-freebsd-830a911_GH0.tar.gz) = 221974 +TIMESTAMP = 1768553284 +SHA256 (wazuh-4.14.2/cJSON.tar.gz) = da809f70b7d03ac529ae6223d4390bfa26cd29f8c32c8e8b3b631efa1667892d +SIZE (wazuh-4.14.2/cJSON.tar.gz) = 27920 +SHA256 (wazuh-4.14.2/curl.tar.gz) = 30cf7142e4282718ceb237e17b5cbf75afcd7c9f3880a039c5efea62db094709 +SIZE (wazuh-4.14.2/curl.tar.gz) = 4537356 +SHA256 (wazuh-4.14.2/libdb.tar.gz) = 7e9c44e8c7fdb186ff521a8d085b1bfa634d342dcc777ecea1fbf9a98ab5dc5e +SIZE (wazuh-4.14.2/libdb.tar.gz) = 3874990 +SHA256 (wazuh-4.14.2/libffi.tar.gz) = 0e971f64bacc22094e89f034bba075b40ecc2c2c2900eecd7ae85815fd6c9f69 +SIZE (wazuh-4.14.2/libffi.tar.gz) = 964576 +SHA256 (wazuh-4.14.2/libyaml.tar.gz) = 35daad608b372d5ce099f738c0f21bfcc03d6920d92f448386c584e664f1376a +SIZE (wazuh-4.14.2/libyaml.tar.gz) = 424656 +SHA256 (wazuh-4.14.2/openssl.tar.gz) = 0386fe3a0bf48bae2ca4d1742a53df9a8fcb1b73583ba22e8f8a7ddfa1375cd9 +SIZE (wazuh-4.14.2/openssl.tar.gz) = 53793192 +SHA256 (wazuh-4.14.2/procps.tar.gz) = 221f395e29d1bdbe4bacc9db39602eee0bae685a935437be0d7feb42e3192d07 +SIZE (wazuh-4.14.2/procps.tar.gz) = 55897 +SHA256 (wazuh-4.14.2/sqlite.tar.gz) = a81bff30bb4affd1b06a4983ff88ef827b4abaea3191b39aff7edb28d1ddd003 +SIZE (wazuh-4.14.2/sqlite.tar.gz) = 2564870 +SHA256 (wazuh-4.14.2/zlib.tar.gz) = b59d38149f0c29ec54d2766611ebc5a51a032bf9717e39a9af00fb6cb8532b8b +SIZE (wazuh-4.14.2/zlib.tar.gz) = 1593304 +SHA256 (wazuh-4.14.2/audit-userspace.tar.gz) = e82a32e5edf93b055160e14bc97f41dead39287925851dc80a7638e2d4d30434 +SIZE (wazuh-4.14.2/audit-userspace.tar.gz) = 1682820 +SHA256 (wazuh-4.14.2/msgpack.tar.gz) = 06d63bcf32896cd0af5480c401134b1ad1c166fd84ebe5b486e792101ee854e2 +SIZE (wazuh-4.14.2/msgpack.tar.gz) = 591294 +SHA256 (wazuh-4.14.2/bzip2.tar.gz) = 27688ee0316a64b39e511b2c224070cad97c394a5f711f9d055fc1809d895bcd +SIZE (wazuh-4.14.2/bzip2.tar.gz) = 71277 +SHA256 (wazuh-4.14.2/nlohmann.tar.gz) = 6e304c0942ac65f76f012a0ec64dde90e00273b6cc5a498b37cfdd16155e08b0 +SIZE (wazuh-4.14.2/nlohmann.tar.gz) = 141576 +SHA256 (wazuh-4.14.2/googletest.tar.gz) = 8c1e8a0a7f221c2125e99e6acb709da2ba472476b4d057c58de504bebf38d417 +SIZE (wazuh-4.14.2/googletest.tar.gz) = 885874 +SHA256 (wazuh-4.14.2/libpcre2.tar.gz) = 5a80d654d7d14b3db9fa3a49d7bf44a498683b46784a88cec514a8b194767b92 +SIZE (wazuh-4.14.2/libpcre2.tar.gz) = 1329651 +SHA256 (wazuh-4.14.2/libplist.tar.gz) = 88278d4bdfc1bd6a3a1a55a4f3d933683d2732ba09cf7a749fe8ec8eec406e3c +SIZE (wazuh-4.14.2/libplist.tar.gz) = 1520623 +SHA256 (wazuh-4.14.2/libarchive.tar.gz) = 540ff4a55defa75778a2c40567a830648ce5367b8aea123366874d96b734ef80 +SIZE (wazuh-4.14.2/libarchive.tar.gz) = 2360242 +SHA256 (wazuh-4.14.2/popt.tar.gz) = d6880a06622ca32dc4aa39ad5dcf7bef2faa81bd931afbe64ba434ad8fee1daa +SIZE (wazuh-4.14.2/popt.tar.gz) = 891309 +SHA256 (wazuh-4.14.2/alonsobsd-wazuh-freebsd-v4.14.2-e3b7f4ccbb4cf0004ca58b1e56e4fe2d1b7474a7_GH0.tar.gz) = cbc5b4754abbf1ff160dbef92040169bd7c693af7e85f7fedcbe80aa7cb95574 +SIZE (wazuh-4.14.2/alonsobsd-wazuh-freebsd-v4.14.2-e3b7f4ccbb4cf0004ca58b1e56e4fe2d1b7474a7_GH0.tar.gz) = 20066719 diff --git a/security/wazuh-agent/files/patch-api_Makefile b/security/wazuh-agent/files/patch-api_Makefile deleted file mode 100644 index b1f811cab6e5..000000000000 --- a/security/wazuh-agent/files/patch-api_Makefile +++ /dev/null @@ -1,19 +0,0 @@ ---- api/Makefile.orig 2023-05-24 19:23:05 UTC -+++ api/Makefile -@@ -8,11 +8,11 @@ WAZUH_GROUP = wazuh - INSTALLDIR ?= /var/ossec - - RM_FILE = rm -f --INSTALL_DIR = install -o root -g ${WAZUH_GROUP} -m 0750 -d --INSTALL_RW_DIR = install -o root -g ${WAZUH_GROUP} -m 0770 -d --INSTALL_EXEC = install -o root -g ${WAZUH_GROUP} -m 0750 --INSTALL_FILE = install -o root -g ${WAZUH_GROUP} -m 0640 --INSTALL_CONFIG_FILE = install -o root -g ${WAZUH_GROUP} -m 0660 -+INSTALL_DIR = install -m 0750 -d -+INSTALL_RW_DIR = install -m 0770 -d -+INSTALL_EXEC = install -m 0750 -+INSTALL_FILE = install -m 0640 -+INSTALL_CONFIG_FILE = install -m 0660 - PYTHON_BIN = $(INSTALLDIR)/framework/python/bin/python3 - - diff --git a/security/wazuh-agent/files/patch-etc_ossec-agent.conf b/security/wazuh-agent/files/patch-etc_ossec-agent.conf deleted file mode 100644 index 584f94c64e36..000000000000 --- a/security/wazuh-agent/files/patch-etc_ossec-agent.conf +++ /dev/null @@ -1,59 +0,0 @@ ---- etc/ossec-agent.conf 2025-11-07 00:46:03.000000000 -0800 -+++ etc/ossec-agent.conf 2026-01-11 01:07:20.394414000 -0800 -@@ -8,8 +8,10 @@ - <client> - <server> - <address>IP</address> -+ <port>1514</port> -+ <protocol>tcp</protocol> - </server> -- <config-profile>debian, debian8</config-profile> -+ <config-profile>freebsd, freebsd%%FBSD_MAJOR_VERSION%%</config-profile> - <crypto_method>aes</crypto_method> - </client> - -@@ -32,7 +34,7 @@ - - <system_audit>/var/ossec/etc/shared/system_audit_rcl.txt</system_audit> - <system_audit>/var/ossec/etc/shared/system_audit_ssh.txt</system_audit> -- <system_audit>/var/ossec/etc/shared/cis_debian_linux_rcl.txt</system_audit> -+ <system_audit>/var/ossec/etc/shared/cis_freebsd%%FBSD_MAJOR_VERSION%%.yml</system_audit> - - <skip_nfs>yes</skip_nfs> - </rootcheck> -@@ -135,10 +137,25 @@ - - <localfile> - <log_format>syslog</log_format> -- <location>/var/log/syslog</location> -+ <location>/var/log/cron</location> - </localfile> - - <localfile> -+ <log_format>syslog</log_format> -+ <location>/var/log/daemon.log</location> -+ </localfile> -+ -+ <localfile> -+ <log_format>syslog</log_format> -+ <location>/var/log/debug.log</location> -+ </localfile> -+ -+ <localfile> -+ <log_format>syslog</log_format> -+ <location>/var/log/userlog</location> -+ </localfile> -+ -+ <localfile> - <log_format>command</log_format> - <command>df -P</command> - <frequency>360</frequency> -@@ -146,7 +163,7 @@ - - <localfile> - <log_format>full_command</log_format> -- <command>netstat -tan |grep LISTEN |grep -v 127.0.0.1 | sort</command> -+ <command>(netstat -n -f inet && netstat -n -f inet) | grep -e "udp" -e "tcp" | sed 's/\([[:alnum:]]*\)\ *[[:digit:]]*\ *[[:digit:]]*\ *\([[:digit:]\.]*\)\.\([[:digit:]]*\)\ *\([[:digit:]\.]*\).*/\1 \2 == \3 == \4/' | sort -k4 -g | sed 's/ == \(.*\) ==/.\1/'</command> - <frequency>360</frequency> - </localfile> - diff --git a/security/wazuh-agent/files/patch-framework_Makefile b/security/wazuh-agent/files/patch-framework_Makefile deleted file mode 100644 index 9d0c318654f7..000000000000 --- a/security/wazuh-agent/files/patch-framework_Makefile +++ /dev/null @@ -1,22 +0,0 @@ ---- framework/Makefile.orig 2023-05-24 19:23:05 UTC -+++ framework/Makefile -@@ -7,14 +7,14 @@ - WAZUH_GROUP = wazuh - INSTALLDIR ?= /var/ossec - --CC = gcc --CFLAGS = -pipe -Wall -Wextra -+CC ?= gcc -+CFLAGS ?= -pipe -Wall -Wextra - THREAD_FLAGS = -pthread - MV_FILE = mv -f - RM_FILE = rm -f --INSTALL_DIR = install -o root -g ${WAZUH_GROUP} -m 0750 -d --INSTALL_EXEC = install -o root -g ${WAZUH_GROUP} -m 0750 --INSTALL_FILE = install -o root -g ${WAZUH_GROUP} -m 0640 -+INSTALL_DIR = install -m 0750 -d -+INSTALL_EXEC = install -m 0750 -+INSTALL_FILE = install -m 0640 - - ifdef DEBUG - CFLAGS+=-g -I ../src diff --git a/security/wazuh-agent/files/patch-src-Makefile b/security/wazuh-agent/files/patch-src-Makefile deleted file mode 100644 index 27d1da76dd10..000000000000 --- a/security/wazuh-agent/files/patch-src-Makefile +++ /dev/null @@ -1,190 +0,0 @@ ---- src/Makefile 2025-09-23 06:59:40.000000000 -0700 -+++ src/Makefile 2025-10-12 08:02:29.393309000 -0700 -@@ -49,9 +49,11 @@ - - HAS_CHECKMODULE = $(shell command -v checkmodule > /dev/null && echo YES) - HAS_SEMODULE_PACKAGE = $(shell command -v semodule_package > /dev/null && echo YES) -+ifeq (${uname_S},Linux) - CHECK_ARCHLINUX := $(shell sh -c 'grep "Arch Linux" /etc/os-release > /dev/null && echo YES || echo not') - CHECK_CENTOS5 := $(shell sh -c 'grep "CentOS release 5." /etc/redhat-release 2>&1 > /dev/null && echo YES || echo not') - CHECK_ALPINE := $(shell sh -c 'grep "Alpine Linux" /etc/os-release 2>&1 > /dev/null && echo YES || echo not') -+endif - - ARCH_FLAGS = - -@@ -112,7 +114,7 @@ - USE_PRELUDE?=no - USE_ZEROMQ?=no - USE_GEOIP?=no --USE_INOTIFY=no -+USE_INOTIFY?=no - USE_BIG_ENDIAN=no - USE_AUDIT=no - MINGW_HOST=unknown -@@ -177,6 +179,8 @@ - DEFINES+=-DUSER=\"${WAZUH_USER}\" - DEFINES+=-DGROUPGLOBAL=\"${WAZUH_GROUP}\" - -+OSSEC_CFLAGS+=-I./ -I./headers/ -I${EXTERNAL_OPENSSL}include -I$(EXTERNAL_JSON) -I${EXTERNAL_LIBYAML}include -I${EXTERNAL_CURL}include -I${EXTERNAL_MSGPACK}include -I${EXTERNAL_BZIP2} -I${SHARED_MODULES}common -I${DBSYNC}include -I${RSYNC}include -I${SYSCOLLECTOR}include -I${SYSINFO}include -I${EXTERNAL_LIBPCRE2}include -I${EXTERNAL_RPM}/builddir/output/include -I${SYSCHECK}include -I${ROUTER}include -I${CONTENT_MANAGER}include -I${VULNERABILITY_SCANNER}include -I${INVENTORY_HARVESTER}include -I./shared_modules/ -+ - ifneq (${TARGET},winagent) - DEFINES+=-D${uname_S} - ifeq (${uname_S},Linux) -@@ -271,13 +275,14 @@ - ifeq (${uname_S},FreeBSD) - DEFINES+=-DFreeBSD - OSSEC_CFLAGS+=-pthread -I/usr/local/include -- OSSEC_LDFLAGS+=-pthread -+ OSSEC_LDFLAGS+=-pthread -lnghttp2 - OSSEC_LDFLAGS+=-L/usr/local/lib - OSSEC_LDFLAGS+='-Wl,-rpath,$$ORIGIN/../lib' -- AR_LDFLAGS+=-pthread -+ AR_LDFLAGS+=-pthread -lnghttp2 - AR_LDFLAGS+=-L/usr/local/lib - AR_LDFLAGS+='-Wl,-rpath,$$ORIGIN/../../lib' - PRECOMPILED_OS:=freebsd -+ CC?=cc - else - ifeq (${uname_S},NetBSD) - DEFINES+=-DNetBSD -@@ -436,7 +441,6 @@ - - OSSEC_CFLAGS+=${DEFINES} - OSSEC_CFLAGS+=-pipe -Wall -Wextra -std=gnu99 --OSSEC_CFLAGS+=-I./ -I./headers/ -I${EXTERNAL_OPENSSL}include -I$(EXTERNAL_JSON) -I${EXTERNAL_LIBYAML}include -I${EXTERNAL_CURL}include -I${EXTERNAL_MSGPACK}include -I${EXTERNAL_BZIP2} -I${SHARED_MODULES}common -I${DBSYNC}include -I${RSYNC}include -I${SYSCOLLECTOR}include -I${SYSINFO}include -I${EXTERNAL_LIBPCRE2}include -I${EXTERNAL_RPM}/builddir/output/include -I${SYSCHECK}include -I${ROUTER}include -I${CONTENT_MANAGER}include -I${VULNERABILITY_SCANNER}include -I${INVENTORY_HARVESTER}include -I./shared_modules/ - - OSSEC_CFLAGS += ${CFLAGS} - OSSEC_LDFLAGS += ${LDFLAGS} -@@ -533,8 +537,8 @@ - ifneq (,$(filter ${USE_INOTIFY},YES auto yes y Y 1)) - DEFINES+=-DINOTIFY_ENABLED - ifeq (${uname_S},FreeBSD) -- OSSEC_LDFLAGS+=-L/usr/local/lib -I/usr/local/include -- OSSEC_LIBS+=-linotify -+ OSSEC_LDFLAGS+=-I/usr/local/include -L/usr/local/lib -+ OSSEC_LIBS+=-L/usr/local/lib -linotify - OSSEC_CFLAGS+=-I/usr/local/include - endif - endif -@@ -960,6 +964,8 @@ - EXTERNAL_LIBS += $(LIBCURL_LIB) - else ifeq (${uname_S},Linux) - EXTERNAL_LIBS += $(LIBCURL_LIB) -+else ifeq (${uname_S},FreeBSD) -+ EXTERNAL_LIBS += $(LIBCURL_LIB) - else ifeq (${uname_S},Darwin) - EXTERNAL_LIBS += $(LIBCURL_LIB) - endif -@@ -1032,7 +1038,7 @@ endif - - #### OpenSSL ########## - --OPENSSL_FLAGS = enable-weak-ssl-ciphers no-shared -+OPENSSL_FLAGS = enable-weak-ssl-ciphers no-shared $(OSSL_TARGET) - - ifeq (${uname_M}, i386) - ifeq ($(findstring BSD,${uname_S}), BSD) -@@ -1196,9 +1202,13 @@ else - cd $(EXTERNAL_CURL) && CPPFLAGS="-fPIC -I${ROUTE_PATH}/${EXTERNAL_OPENSSL}include" LDFLAGS="-L${ROUTE_PATH}/${EXTERNAL_OPENSSL}" LIBS="-ldl -lpthread" ./configure --with-openssl="${ROUTE_PATH}/${EXTERNAL_OPENSSL}" --disable-ldap --without-libidn2 --without-libpsl --without-brotli --without-nghttp2 --without-zstd - endif - else -+ifeq (${uname_S},FreeBSD) -+ cd $(EXTERNAL_CURL) && CPPFLAGS="-fPIC -I${ROUTE_PATH}/${EXTERNAL_OPENSSL}include" LDFLAGS="-L${ROUTE_PATH}/${EXTERNAL_OPENSSL}" LIBS="-pthread" ./configure --with-ssl="${ROUTE_PATH}/${EXTERNAL_OPENSSL}" --disable-ldap --without-libidn2 --without-brotli --without-nghttp2 --without-librtmp --without-zstd --without-libpsl -+else - cd $(EXTERNAL_CURL) && CPPFLAGS="-fPIC -I${ROUTE_PATH}/${EXTERNAL_OPENSSL}include" LDFLAGS="-L${ROUTE_PATH}/${EXTERNAL_OPENSSL}" LIBS="-lpthread" ./configure --with-openssl="${ROUTE_PATH}/${EXTERNAL_OPENSSL}" --disable-ldap --without-libidn2 --without-brotli --without-nghttp2 --without-librtmp --without-zstd --without-libpsl - endif - endif -+endif - - - #### procps ######### -@@ -2308,7 +2318,7 @@ - #### FIM ###### - - wazuh-syscheckd: librootcheck.a libwazuh.a ${WAZUHEXT_LIB} build_shared_modules -- cd syscheckd && mkdir -p build && cd build && cmake ${SYSCHECK_OS} ${CMAKE_OPTS} -DCMAKE_C_FLAGS="${DEFINES} -pipe -Wall -Wextra -std=gnu99" ${SYSCHECK_TEST} ${SYSCHECK_RELEASE_TYPE} .. && ${MAKE} -+ cd syscheckd && mkdir -p build && cd build && cmake ${CMAKE_OPTS} -DCMAKE_C_FLAGS="${DEFINES} ${OSSEC_CFLAGS} -pipe -Wall -Wextra -std=gnu99" -DCMAKE_EXE_LINKER_FLAGS="${OSSEC_LDFLAGS} ${OSSEC_LIBS}" ${SYSCHECK_TEST} ${SYSCHECK_RELEASE_TYPE} .. && ${MAKE} - - #### Monitor ####### - -@@ -2340,13 +2350,13 @@ - os_auth_o := $(os_auth_c:.c=.o) - - os_auth/%.o: os_auth/%.c -- ${OSSEC_CC} ${OSSEC_CFLAGS} -I./os_auth -DARGV0=\"wazuh-authd\" -c $^ -o $@ -+ ${OSSEC_CC} -I${LOCALBASE}/include/libepoll-shim ${OSSEC_CFLAGS} -I./os_auth -DARGV0=\"wazuh-authd\" -c $^ -o $@ - - agent-auth: addagent/validate.o os_auth/main-client.o os_auth/ssl.o os_auth/check_cert.o - ${OSSEC_CCBIN} ${OSSEC_LDFLAGS} $^ ${OSSEC_LIBS} -o $@ - - wazuh-authd: addagent/validate.o os_auth/main-server.o os_auth/local-server.o os_auth/ssl.o os_auth/check_cert.o os_auth/config.o os_auth/authcom.o os_auth/auth.o os_auth/key_request.o os_auth/generate_cert.o -- ${OSSEC_CCBIN} ${OSSEC_LDFLAGS} $^ ${OSSEC_LIBS} -o $@ -+ ${OSSEC_CCBIN} ${OSSEC_LDFLAGS} $^ ${OSSEC_LIBS} -lepoll-shim -o $@ - - #### integratord ##### - -@@ -2486,7 +2496,7 @@ - WPYTHON_DIR := ${INSTALLDIR}/framework/python - OPTIMIZE_CPYTHON?=no - WPYTHON_TAR=cpython.tar.gz --WLIBPYTHON=libpython3.10.so.1.0 -+WLIBPYTHON=libpython3.11.so.1.0 - - ifneq (,$(filter ${OPTIMIZE_CPYTHON},YES yes y Y 1)) - CPYTHON_FLAGS=--enable-optimizations -@@ -2500,22 +2510,45 @@ - endif - - ifeq (,$(wildcard ${EXTERNAL_CPYTHON}/python)) -- export WPATH_LIB="'\$$\$$ORIGIN/../../../lib'" && export SOURCE_PATH=${ROUTE_PATH} && export WAZUH_FFI_PATH=${EXTERNAL_LIBFFI} && export LD_LIBRARY_PATH=${ROUTE_PATH} && cd ${EXTERNAL_CPYTHON} && ./configure --prefix="${WPYTHON_DIR}" --libdir="${WPYTHON_DIR}/lib" --enable-shared --with-openssl="${ROUTE_PATH}/${EXTERNAL_OPENSSL}" LDFLAGS="${ARCH_FLAGS} -L${ROUTE_PATH} -lwazuhext -Wl,-rpath,'\$$\$$ORIGIN/../../../lib',--disable-new-dtags" CPPFLAGS="-I${ROUTE_PATH}/${EXTERNAL_OPENSSL}" $(CPYTHON_FLAGS) && ${MAKE} -+ export WPATH_LIB="'\$$\$$ORIGIN/../../../lib'" && export SOURCE_PATH=${ROUTE_PATH} && export WAZUH_FFI_PATH=${EXTERNAL_LIBFFI} && export LD_LIBRARY_PATH=${ROUTE_PATH} && cd ${EXTERNAL_CPYTHON} && ./configure --prefix="${WPYTHON_DIR}" --libdir="${WPYTHON_DIR}/lib" --enable-shared --with-openssl="${ROUTE_PATH}/${EXTERNAL_OPENSSL}" LIBSQLITE3_CFLAGS="-I${LOCALBASE}/include" LIBSQLITE3_LIBS="-L${LOCALBASE}/lib -lsqlite3" LDFLAGS="${ARCH_FLAGS} -L${ROUTE_PATH} -lwazuhext -Wl,-rpath,'\$$\$$ORIGIN/../../../lib',--disable-new-dtags" CPPFLAGS="-I${ROUTE_PATH}/${EXTERNAL_OPENSSL}" $(CPYTHON_FLAGS) && ${MAKE} - endif - - build_python: $(WAZUHEXT_LIB) - - install_python: - ifneq (,$(wildcard ${EXTERNAL_CPYTHON})) -- cd ${EXTERNAL_CPYTHON} && export WPATH_LIB=${INSTALLDIR}/lib && export SOURCE_PATH=${ROUTE_PATH} && export WAZUH_FFI_PATH=${EXTERNAL_LIBFFI} && ${MAKE} install -+ cd ${EXTERNAL_CPYTHON} && export WPATH_LIB=${INSTALLDIR}/lib && export SOURCE_PATH=${ROUTE_PATH} && export WAZUH_FFI_PATH=${EXTERNAL_LIBFFI} && export LD_LIBRARY_PATH=${ROUTE_PATH} && ${MAKE} install - else - mkdir -p ${WPYTHON_DIR} - cp external/${WPYTHON_TAR} ${WPYTHON_DIR}/${WPYTHON_TAR} && ${TAR} ${WPYTHON_DIR}/${WPYTHON_TAR} -C ${WPYTHON_DIR} && rm -rf ${WPYTHON_DIR}/${WPYTHON_TAR} - endif -+ifeq (${uname_S},FreeBSD) -+ mkdir -p $(STAGEDIR)${INSTALLDIR}/lib -+ find $(STAGEDIR)${WPYTHON_DIR} -name "*${WLIBPYTHON}" -exec ln -f {} $(STAGEDIR)${INSTALLDIR}/lib/${WLIBPYTHON} \; -+else - find ${WPYTHON_DIR} -name "*${WLIBPYTHON}" -exec ln -f {} ${INSTALLDIR}/lib/${WLIBPYTHON} \; -+endif - - python_dependencies := requirements.txt - -+ifeq (${uname_S},FreeBSD) -+install_dependencies: -+ifneq (,$(wildcard ${EXTERNAL_CPYTHON})) -+ $(STAGEDIR)${WPYTHON_DIR}/bin/python3 -B -m pip install --upgrade pip --prefix=${WPYTHON_DIR} --root=$(STAGEDIR) --no-index --find-links=wazuh-cache/ --cache-dir=wazuh-cache/ --no-compile -+ LD_LIBRARY_PATH="$(STAGEDIR)${INSTALLDIR}/lib" LDFLAGS="-L$(STAGEDIR)${INSTALLDIR}/lib" $(STAGEDIR)${WPYTHON_DIR}/bin/python3 -m pip install wazuh-cache-any/*.whl --root=$(STAGEDIR) --prefix=${WPYTHON_DIR} --no-deps --no-compile -+ LD_LIBRARY_PATH="$(STAGEDIR)${INSTALLDIR}/lib" LDFLAGS="-L$(STAGEDIR)${INSTALLDIR}/lib" $(STAGEDIR)${WPYTHON_DIR}/bin/python3 -m pip install wazuh-cache/*.whl --root=$(STAGEDIR) --prefix=${WPYTHON_DIR} --no-deps --no-compile -+endif -+ -+install_framework: -+ LD_LIBRARY_PATH="$(STAGEDIR)${INSTALLDIR}/lib" LDFLAGS="-L$(STAGEDIR)${INSTALLDIR}/lib" $(STAGEDIR)${WPYTHON_DIR}/bin/python3 -m pip install wazuh-python/wazuh*.whl --root=$(STAGEDIR) --prefix=${WPYTHON_DIR} --no-deps --no-compile -+ chmod -R o=- $(STAGEDIR)${WPYTHON_DIR} -+ -+install_api: -+ LD_LIBRARY_PATH="$(STAGEDIR)${INSTALLDIR}/lib" LDFLAGS="-L$(STAGEDIR)${INSTALLDIR}/lib" $(STAGEDIR)${WPYTHON_DIR}/bin/python3 -m pip install wazuh-python/api*.whl --root=$(STAGEDIR) --prefix=${WPYTHON_DIR} --no-deps --no-compile -+ -+install_mitre: -+ export CRYPTOGRAPHY_OPENSSL_NO_LEGACY=1 && cd ../tools/mitre && $(STAGEDIR)${WPYTHON_DIR}/bin/python3 mitredb.py -d $(STAGEDIR)${INSTALLDIR}/var/db/mitre.db -+else - install_dependencies: install_python - ifneq (,$(wildcard ${EXTERNAL_CPYTHON})) - ${WPYTHON_DIR}/bin/python3 -m pip install --upgrade pip --index-url=file://${ROUTE_PATH}/${EXTERNAL_CPYTHON}/Dependencies/simple -@@ -2532,6 +2565,7 @@ - - install_mitre: install_python - cd ../tools/mitre && ${WPYTHON_DIR}/bin/python3 mitredb.py -d ${INSTALLDIR}/var/db/mitre.db -+endif - - #################### - #### test ########## diff --git a/security/wazuh-agent/files/patch-src-shared_modules-utils_sqliteWrapperTemp.h b/security/wazuh-agent/files/patch-src-shared_modules-utils_sqliteWrapperTemp.h deleted file mode 100644 index a6eeb2973d97..000000000000 --- a/security/wazuh-agent/files/patch-src-shared_modules-utils_sqliteWrapperTemp.h +++ /dev/null @@ -1,34 +0,0 @@ ---- src/shared_modules/utils/sqliteWrapperTemp.h 2025-11-07 00:46:03.000000000 -0800 -+++ src/shared_modules/utils/sqliteWrapperTemp.h 2026-01-01 13:52:11.656050000 -0800 -@@ -235,8 +235,8 @@ - public: - ~Connection() = default; - -- explicit Connection(const std::string& path) -- : m_db{ openSQLiteDb(path), [](sqlite3 * p) -+ explicit Connection(const std::string& path, const int flags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE) -+ : m_db{ openSQLiteDb(path, flags), [](sqlite3 * p) - { - sqlite3_close_v2(p); - } } -@@ -245,7 +245,10 @@ - - if (path.compare(DB_MEMORY) != 0) - { -- const auto result { chmod(path.c_str(), DB_PERMISSIONS) }; -+ const auto result = -+ (flags == SQLITE_OPEN_READONLY) -+ ? 0 -+ : chmod(path.c_str(), DB_PERMISSIONS); - - if (result != 0) - { -@@ -255,7 +258,7 @@ - }; - } - -- m_db.reset(openSQLiteDb(path, SQLITE_OPEN_READWRITE), [](sqlite3 * p) -+ m_db.reset(openSQLiteDb(path, flags), [](sqlite3 * p) - { - sqlite3_close_v2(p); - }); diff --git a/security/wazuh-agent/files/patch-src-shared_modules-utils_stringHelper.h b/security/wazuh-agent/files/patch-src-shared_modules-utils_stringHelper.h deleted file mode 100644 index e60c6542e5a4..000000000000 --- a/security/wazuh-agent/files/patch-src-shared_modules-utils_stringHelper.h +++ /dev/null @@ -1,44 +0,0 @@ ---- src/shared_modules/utils/stringHelper.h 2025-09-23 06:59:40.000000000 -0700 -+++ src/shared_modules/utils/stringHelper.h 2025-10-16 14:04:29.575997000 -0700 -@@ -19,6 +19,7 @@ - #include <sstream> - #include <string> - #include <vector> -+#include <map> - #if __cplusplus >= 201703L - #include <string_view> - #endif -@@ -150,6 +151,15 @@ - return haystack; - } - -+ static std::string join(const std::vector<std::string>& vec, const std::string& delimiter) { -+ std::ostringstream joinResult; -+ for (size_t i = 0; i < vec.size(); ++i) { -+ joinResult << vec[i]; -+ if (i != vec.size() - 1) joinResult << delimiter; -+ } -+ return joinResult.str(); -+ } -+ - static std::vector<std::string> split(const std::string& str, const char delimiter) - { - std::vector<std::string> tokens; -@@ -257,6 +267,17 @@ - - // LCOV_EXCL_STOP - return ret; -+ } -+ -+ static std::string trimToOneSpace(const std::string& str) -+ { -+ std::string str_output; -+ -+ str_output.clear(); -+ std::unique_copy (str.begin(), str.end(), std::back_insert_iterator<std::string>(str_output), -+ [](char a,char b){ return std::isspace(a) && std::isspace(b);}); -+ -+ return str_output; - } - - static std::string toUpperCase(const std::string& str) diff --git a/security/wazuh-agent/files/patch-src-shared_modules-utils_timeHelper.h b/security/wazuh-agent/files/patch-src-shared_modules-utils_timeHelper.h deleted file mode 100644 index 6cd990bde29e..000000000000 --- a/security/wazuh-agent/files/patch-src-shared_modules-utils_timeHelper.h +++ /dev/null @@ -1,20 +0,0 @@ ---- src/shared_modules/utils/timeHelper.h.orig 2024-10-17 00:22:27.000000000 -0700 -+++ src/shared_modules/utils/timeHelper.h 2024-10-20 00:02:09.915969000 -0700 -@@ -196,6 +196,17 @@ - return output.str(); - } - -+ static std::string timeToSeconds(std::string& str) { -+ int seconds; -+ std::tm t; -+ std::istringstream ss(str); -+ ss >> std::get_time(&t, "%H:%M.%S"); -+ -+ seconds = t.tm_hour * 3600 + t.tm_min * 60 + t.tm_sec; -+ -+ return std::to_string(seconds); -+ } -+ - /** - * @brief Get seconds from epoch, since 1970-01-01 00:00:00 UTC. - * @return seconds from epoch. diff --git a/security/wazuh-agent/files/patch-src-wazuh_modules_wm_database.c b/security/wazuh-agent/files/patch-src-wazuh_modules_wm_database.c deleted file mode 100644 index c453bfae2a78..000000000000 --- a/security/wazuh-agent/files/patch-src-wazuh_modules_wm_database.c +++ /dev/null @@ -1,14 +0,0 @@ ---- src/wazuh_modules/wm_database.c 2024-01-05 08:38:26.000000000 -0500 -+++ src/wazuh_modules/wm_database.c 2024-01-11 15:18:58.255136000 -0500 -@@ -16,6 +16,11 @@ - #include "addagent/manage_agents.h" // FILE_SIZE - #include "external/cJSON/cJSON.h" - -+#if defined(__FreeBSD__) -+#include <sys/param.h> -+#define HOST_NAME_MAX MAXHOSTNAMELEN -+#endif -+ - #ifndef CLIENT - - #ifdef INOTIFY_ENABLED diff --git a/security/wazuh-agent/files/patch-src_data__provider-CMakeLists.txt b/security/wazuh-agent/files/patch-src_data__provider-CMakeLists.txt deleted file mode 100644 index 03dd0efcd223..000000000000 --- a/security/wazuh-agent/files/patch-src_data__provider-CMakeLists.txt +++ /dev/null @@ -1,39 +0,0 @@ ---- src/data_provider/CMakeLists.txt 2025-11-07 08:46:03.000000000 +0000 -+++ src/data_provider/CMakeLists.txt 2026-01-13 15:21:46.999172000 +0000 -@@ -104,7 +104,6 @@ - include_directories(${CMAKE_SOURCE_DIR}/src/extended_sources/wrappers/unix/darwin) - endif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") - -- - if(CMAKE_SYSTEM_NAME STREQUAL "HP-UX") - link_directories(${INSTALL_PREFIX}/lib) - endif(CMAKE_SYSTEM_NAME STREQUAL "HP-UX") -@@ -119,6 +118,11 @@ - include_directories(${CMAKE_SOURCE_DIR}/src/extended_sources/wrappers/unix/darwin) - endif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") - -+if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") -+ include_directories(${CMAKE_SOURCE_DIR}/src/extended_sources/wrappers/unix/) -+ include_directories(${CMAKE_SOURCE_DIR}/src/extended_sources/wrappers/unix/freebsd) -+endif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") -+ - link_directories(${SRC_FOLDER}) - link_directories(${SRC_FOLDER}/external/sqlite/) - link_directories(${SRC_FOLDER}/external/cJSON/) -@@ -210,6 +214,7 @@ - - if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR - CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR -+ CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR - CMAKE_SYSTEM_NAME STREQUAL "Windows") - add_subdirectory(src/extended_sources) - endif() -@@ -250,7 +255,7 @@ - target_link_libraries(sysinfo cjson ${SRC_FOLDER}/external/libplist/bin/lib/libplist-2.0.a ${iokit_lib} ${corefoundation_lib} groups users services browser_extensions) - endif(CMAKE_SYSTEM_NAME STREQUAL "Windows") - --target_link_libraries(sysinfo wazuhext) -+target_link_libraries(sysinfo nghttp2 wazuhext users groups) - - if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - set(CURL_DEP "wazuhext") diff --git a/security/wazuh-agent/files/patch-src_data__provider_src-sysInfoFreeBSD.cpp b/security/wazuh-agent/files/patch-src_data__provider_src-sysInfoFreeBSD.cpp deleted file mode 100644 index 8ef1dd376f3e..000000000000 --- a/security/wazuh-agent/files/patch-src_data__provider_src-sysInfoFreeBSD.cpp +++ /dev/null @@ -1,634 +0,0 @@ ---- src/data_provider/src/sysInfoFreeBSD.cpp 2025-11-07 08:46:03.000000000 +0000 -+++ src/data_provider/src/sysInfoFreeBSD.cpp 2026-01-14 16:59:37.014537000 +0000 -@@ -11,20 +11,33 @@ - #include "sysInfo.hpp" - #include "cmdHelper.h" - #include "stringHelper.h" -+#include "timeHelper.h" - #include "osinfo/sysOsParsers.h" -+#include "sqliteWrapperTemp.h" -+#include "filesystemHelper.h" - #include <sys/sysctl.h> - #include <sys/vmmeter.h> - #include <sys/utsname.h> - #include "sharedDefs.h" -+#include <regex> -+#include "groups_freebsd.hpp" -+#include "user_groups_freebsd.hpp" -+#include "logged_in_users_freebsd.hpp" -+#include "sudoers_unix.hpp" -+#include "users_freebsd.hpp" - -+const std::string PKG_DB_PATHNAME {"/var/db/pkg/local.sqlite"}; -+const std::string PKG_QUERY {"SELECT p.name, p.maintainer, p.version, p.arch, p.comment, p.flatsize, p.time, v.annotation AS repository,p.origin FROM packages p LEFT JOIN (SELECT pa.package_id, pa.value_id FROM pkg_annotation pa JOIN annotation t ON t.annotation_id = pa.tag_id AND t.annotation = 'repository') pr ON pr.package_id = p.id LEFT JOIN annotation v ON v.annotation_id = pr.value_id;"}; -+ - static void getMemory(nlohmann::json& info) - { -+ constexpr auto vmFree{"vm.stats.vm.v_free_count"}; -+ constexpr auto vmInactive{"vm.stats.vm.v_inactive_count"}; - constexpr auto vmPageSize{"vm.stats.vm.v_page_size"}; -- constexpr auto vmTotal{"vm.vmtotal"}; -+ constexpr auto vmTotal{"hw.physmem"}; - uint64_t ram{0}; -- const std::vector<int> mib{CTL_HW, HW_PHYSMEM}; - size_t len{sizeof(ram)}; -- auto ret{sysctl(const_cast<int*>(mib.data()), mib.size(), &ram, &len, nullptr, 0)}; -+ auto ret{sysctlbyname(vmTotal, &ram, &len, nullptr, 0)}; - - if (ret) - { -@@ -52,11 +65,23 @@ - }; - } - -- struct vmtotal vmt {}; -+ uint64_t freeMem{0}; -+ len = sizeof(freeMem); -+ ret = sysctlbyname(vmFree, &freeMem, &len, nullptr, 0); - -- len = sizeof(vmt); -+ if (ret) -+ { -+ throw std::system_error -+ { -+ ret, -+ std::system_category(), -+ "Error reading free memory size." -+ }; -+ } - -- ret = sysctlbyname(vmTotal, &vmt, &len, nullptr, 0); -+ uint64_t inactiveMem{0}; -+ len = sizeof(inactiveMem); -+ ret = sysctlbyname(vmInactive, &inactiveMem, &len, nullptr, 0); - - if (ret) - { -@@ -64,11 +89,11 @@ - { - ret, - std::system_category(), -- "Error reading total memory." -+ "Error reading inactive memory size." - }; - } - -- const auto ramFree{(vmt.t_free * pageSize) / KByte}; -+ const auto ramFree{(freeMem + inactiveMem) * pageSize / KByte}; - info["ram_free"] = ramFree; - info["ram_usage"] = 100 - (100 * ramFree / ramTotal); - } -@@ -96,7 +121,43 @@ - - static std::string getSerialNumber() - { -- return UNKNOWN_VALUE; -+ size_t len{0}; -+ auto ret{sysctlbyname("kern.hostuuid", nullptr, &len, nullptr, 0)}; -+ -+ if (ret) -+ { -+ throw std::system_error -+ { -+ ret, -+ std::system_category(), -+ "Error reading serial number (aka hostuuid)." -+ }; -+ } -+ -+ const auto spBuff{std::make_unique<char[]>(len + 1)}; -+ -+ if (!spBuff) -+ { -+ throw std::runtime_error -+ { -+ "Error allocating memory to read the serial number (aka hostuuid)." -+ }; -+ } -+ -+ ret = sysctlbyname("kern.hostuuid", spBuff.get(), &len, nullptr, 0); -+ -+ if (ret) -+ { -+ throw std::system_error -+ { -+ ret, -+ std::system_category(), -+ "Error reading serial number (aka hostuuid)." -+ }; -+ } -+ -+ spBuff.get()[len] = 0; -+ return std::string{reinterpret_cast<const char*>(spBuff.get())}; - } - - static int getCpuCores() -@@ -184,8 +245,12 @@ - - nlohmann::json SysInfo::getProcessesInfo() const - { -- // Currently not supported for this OS -- return nlohmann::json {}; -+ nlohmann::json ret; -+ getProcessesInfo([&ret](nlohmann::json & data) -+ { -+ ret.push_back(data); -+ }); -+ return ret; - } - - nlohmann::json SysInfo::getOsInfo() const -@@ -196,11 +261,12 @@ - - if (!spParser->parseUname(Utils::exec("uname -r"), ret)) - { -- ret["os_name"] = "BSD"; - ret["os_platform"] = "bsd"; - ret["os_version"] = UNKNOWN_VALUE; - } - -+ ret["os_name"] = "FreeBSD"; -+ - if (uname(&uts) >= 0) - { - ret["sysname"] = uts.sysname; -@@ -215,44 +281,260 @@ - - nlohmann::json SysInfo::getPorts() const - { -- // Currently not supported for this OS. -- return nlohmann::json {}; --} -+ nlohmann::json ports {}; -+ -+ /* USER COMMAND PID FD PROTO LOCAL_ADDRESS FOREIGN_ADDRESS PATH_STATE CONN_STATE */ -+ -+#if __FreeBSD_version > 1500045 -+ const auto query{exec(R"(sockstat -46qs --libxo json)")}; - --void SysInfo::getProcessesInfo(std::function<void(nlohmann::json&)> /*callback*/) const --{ -- // Currently not supported for this OS. -+ if (!query.empty()) -+ { -+ nlohmann::json portsjson; -+ portsjson = nlohmann::json::parse(query); -+ auto &portsResult = portsjson["sockstat"]["socket"]; -+ -+ for(auto &port : portsResult) { -+ std::string localip = ""; -+ std::string localport = ""; -+ std::string remoteip = ""; -+ std::string remoteport = ""; -+ std::string statedata = ""; -+ -+ if (port["pid"] != nullptr) { -+ -+ localip = port["local"]["address"]; -+ remoteip = port["foreign"]["address"]; -+ statedata = port["conn-state"] != nullptr ? (port["conn-state"] == "LISTEN" ? "listening" : Utils::toLowerCase(port["conn-state"])) : statedata; -+ -+ if (port["local"]["address"] == "*") { -+ if ((port["proto"] == "udp4") || (port["proto"] == "tcp4")) { -+ localip = "0.0.0.0"; -+ } else { -+ localip = "::"; -+ } -+ } -+ -+ localport = port["local"]["port"]; -+ -+ if (port["foreign"]["address"] == "*") { -+ if ((port["proto"] == "udp4") || (port["proto"] == "tcp4")) { -+ remoteip = 0.0.0.0; -+ } else { -+ remoteip = "::"; -+ } -+ } -+ -+ remoteport = port["foreign"]["port"]; -+ -+ nlohmann::json portRecord {}; -+ -+ portRecord["protocol"] = port["proto"]; -+ portRecord["local_ip"] = localip; -+ portRecord["local_port"] = localport == "*" ? "0" : localport; -+ portRecord["remote_ip"] = remoteip; -+ portRecord["remote_port"] = remoteport == "*" ? "0" : remoteport; -+ portRecord["tx_queue"] = 0; -+ portRecord["rx_queue"] = 0; -+ portRecord["inode"] = port["fd"]; *** 6718 LINES SKIPPED ***home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?696a0034.d536.6a0196a2>
