diff options
Diffstat (limited to 'security/wazuh-agent')
| -rw-r--r-- | security/wazuh-agent/Makefile | 10 | ||||
| -rw-r--r-- | security/wazuh-agent/distinfo | 82 | ||||
| -rw-r--r-- | security/wazuh-agent/files/patch-src-Makefile | 54 | ||||
| -rw-r--r-- | security/wazuh-agent/files/patch-src-data_provider-src_sysInfoFreeBSD.cpp | 198 | ||||
| -rw-r--r-- | security/wazuh-agent/files/patch-src-shared_modules-utils_stringHelper.h | 40 | ||||
| -rw-r--r-- | security/wazuh-agent/pkg-plist | 15 |
6 files changed, 260 insertions, 139 deletions
diff --git a/security/wazuh-agent/Makefile b/security/wazuh-agent/Makefile index b36ffd41b6c7..e4e77b9c01e4 100644 --- a/security/wazuh-agent/Makefile +++ b/security/wazuh-agent/Makefile @@ -1,8 +1,8 @@ PORTNAME= wazuh -DISTVERSION= 4.12.0 +DISTVERSION= 4.14.1 DISTVERSIONPREFIX= v CATEGORIES= security -MASTER_SITES= https://packages.wazuh.com/deps/40/libraries/sources/:wazuh_sources +MASTER_SITES= https://packages.wazuh.com/deps/47/libraries/sources/:wazuh_sources PKGNAMESUFFIX= -agent DISTFILES= ${EXTERNAL_DISTFILES} DIST_SUBDIR= ${PORTNAME}-${DISTVERSION} @@ -27,7 +27,7 @@ USE_RC_SUBR= ${PORTNAME}${PKGNAMESUFFIX} MAKE_ARGS+= TARGET=agent WAZUH_EXTRAFILE= alonsobsd-${PORTNAME}-freebsd-${WAZUH_EXTRAFILE_TAGNAME}_GH0${EXTRACT_SUFX} -WAZUH_EXTRAFILE_TAGNAME=cd0051b +WAZUH_EXTRAFILE_TAGNAME=2f1307c EXTERNAL_DISTFILES= cJSON.tar.gz:wazuh_sources \ curl.tar.gz:wazuh_sources \ @@ -96,8 +96,10 @@ WAZUHPREFIX= /var/ossec FBSD_MAJOR_VERSION=13 .elif ${OSVERSION} >= 1400000 && ${OSVERSION} < 1500000 FBSD_MAJOR_VERSION=14 -.elif ${OSVERSION} >= 1500000 +.elif ${OSVERSION} >= 1500000 && ${OSVERSION} < 1600000 FBSD_MAJOR_VERSION=15 +.elif ${OSVERSION} >= 1600000 +FBSD_MAJOR_VERSION=16 .else IGNORE= FreeBSD ${OSVERSION} ${ARCH} is not supported .endif diff --git a/security/wazuh-agent/distinfo b/security/wazuh-agent/distinfo index aaf1436beda3..d937b05666dc 100644 --- a/security/wazuh-agent/distinfo +++ b/security/wazuh-agent/distinfo @@ -1,41 +1,41 @@ -TIMESTAMP = 1746862127 -SHA256 (wazuh-4.12.0/cJSON.tar.gz) = 678d796318da57d5f38075e74bbb3b77375dc3f8bb49da341ad1b43c417e8cc1 -SIZE (wazuh-4.12.0/cJSON.tar.gz) = 27863 -SHA256 (wazuh-4.12.0/curl.tar.gz) = a93b5b839255d92487a3f9ad7dfada1dc73ab016802c7f669dc09a891c6546fa -SIZE (wazuh-4.12.0/curl.tar.gz) = 4525465 -SHA256 (wazuh-4.12.0/libdb.tar.gz) = 7e9c44e8c7fdb186ff521a8d085b1bfa634d342dcc777ecea1fbf9a98ab5dc5e -SIZE (wazuh-4.12.0/libdb.tar.gz) = 3874990 -SHA256 (wazuh-4.12.0/libffi.tar.gz) = 0e971f64bacc22094e89f034bba075b40ecc2c2c2900eecd7ae85815fd6c9f69 -SIZE (wazuh-4.12.0/libffi.tar.gz) = 964576 -SHA256 (wazuh-4.12.0/libyaml.tar.gz) = 35daad608b372d5ce099f738c0f21bfcc03d6920d92f448386c584e664f1376a -SIZE (wazuh-4.12.0/libyaml.tar.gz) = 424656 -SHA256 (wazuh-4.12.0/openssl.tar.gz) = 238415641120c8f79d9c1c2caf97b88d3d6dbed562859dd0663bd4b68dc2179e -SIZE (wazuh-4.12.0/openssl.tar.gz) = 15637517 -SHA256 (wazuh-4.12.0/procps.tar.gz) = 221f395e29d1bdbe4bacc9db39602eee0bae685a935437be0d7feb42e3192d07 -SIZE (wazuh-4.12.0/procps.tar.gz) = 55897 -SHA256 (wazuh-4.12.0/sqlite.tar.gz) = 9a8fa6a916f8c2107ed65dab8dced392604e175104d6a8c3c9c1383479869f07 -SIZE (wazuh-4.12.0/sqlite.tar.gz) = 2486661 -SHA256 (wazuh-4.12.0/zlib.tar.gz) = b59d38149f0c29ec54d2766611ebc5a51a032bf9717e39a9af00fb6cb8532b8b -SIZE (wazuh-4.12.0/zlib.tar.gz) = 1593304 -SHA256 (wazuh-4.12.0/audit-userspace.tar.gz) = e82a32e5edf93b055160e14bc97f41dead39287925851dc80a7638e2d4d30434 -SIZE (wazuh-4.12.0/audit-userspace.tar.gz) = 1682820 -SHA256 (wazuh-4.12.0/msgpack.tar.gz) = 06d63bcf32896cd0af5480c401134b1ad1c166fd84ebe5b486e792101ee854e2 -SIZE (wazuh-4.12.0/msgpack.tar.gz) = 591294 -SHA256 (wazuh-4.12.0/bzip2.tar.gz) = 27688ee0316a64b39e511b2c224070cad97c394a5f711f9d055fc1809d895bcd -SIZE (wazuh-4.12.0/bzip2.tar.gz) = 71277 -SHA256 (wazuh-4.12.0/nlohmann.tar.gz) = cefb07936d3d5bfdd3efc5e9bb8d3c807d681273bdac2e83b3d67aef2d1158c4 -SIZE (wazuh-4.12.0/nlohmann.tar.gz) = 135749 -SHA256 (wazuh-4.12.0/googletest.tar.gz) = 8c1e8a0a7f221c2125e99e6acb709da2ba472476b4d057c58de504bebf38d417 -SIZE (wazuh-4.12.0/googletest.tar.gz) = 885874 -SHA256 (wazuh-4.12.0/libpcre2.tar.gz) = 5a80d654d7d14b3db9fa3a49d7bf44a498683b46784a88cec514a8b194767b92 -SIZE (wazuh-4.12.0/libpcre2.tar.gz) = 1329651 -SHA256 (wazuh-4.12.0/libplist.tar.gz) = 88278d4bdfc1bd6a3a1a55a4f3d933683d2732ba09cf7a749fe8ec8eec406e3c -SIZE (wazuh-4.12.0/libplist.tar.gz) = 1520623 -SHA256 (wazuh-4.12.0/libarchive.tar.gz) = c958048175dad5a13d0851d03c7c1a36361e12e8e93e7432c1844e9549ddf58a -SIZE (wazuh-4.12.0/libarchive.tar.gz) = 7512700 -SHA256 (wazuh-4.12.0/popt.tar.gz) = d6880a06622ca32dc4aa39ad5dcf7bef2faa81bd931afbe64ba434ad8fee1daa -SIZE (wazuh-4.12.0/popt.tar.gz) = 891309 -SHA256 (wazuh-4.12.0/wazuh-wazuh-v4.12.0_GH0.tar.gz) = a0af093328df4658ff52cf78d8d6a03cc943fbd95a160cccd8b3e5e294b71ac5 -SIZE (wazuh-4.12.0/wazuh-wazuh-v4.12.0_GH0.tar.gz) = 18498222 -SHA256 (wazuh-4.12.0/alonsobsd-wazuh-freebsd-cd0051b_GH0.tar.gz) = d20100f8840e6f600aa0a49585bac80e62850fe5f2be40e11eaa1ffd50adf5c1 -SIZE (wazuh-4.12.0/alonsobsd-wazuh-freebsd-cd0051b_GH0.tar.gz) = 178174 +TIMESTAMP = 1763764526 +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-2f1307c_GH0.tar.gz) = a955c569217122779ab5b6b58bdfabbfa1cd452b4719cc35c791f7047b1f364f +SIZE (wazuh-4.14.1/alonsobsd-wazuh-freebsd-2f1307c_GH0.tar.gz) = 221983 diff --git a/security/wazuh-agent/files/patch-src-Makefile b/security/wazuh-agent/files/patch-src-Makefile index 70420cde9198..a45608e5dff6 100644 --- a/security/wazuh-agent/files/patch-src-Makefile +++ b/security/wazuh-agent/files/patch-src-Makefile @@ -1,5 +1,5 @@ ---- src/Makefile 2025-04-30 02:30:26.000000000 -0700 -+++ src/Makefile 2025-05-09 19:40:18.856441000 -0700 +--- 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) @@ -12,7 +12,7 @@ ARCH_FLAGS = -@@ -110,7 +112,7 @@ +@@ -112,7 +114,7 @@ USE_PRELUDE?=no USE_ZEROMQ?=no USE_GEOIP?=no @@ -21,16 +21,16 @@ USE_BIG_ENDIAN=no USE_AUDIT=no MINGW_HOST=unknown -@@ -175,6 +177,8 @@ +@@ -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./shared_modules/ ++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) -@@ -269,10 +273,10 @@ +@@ -271,13 +275,14 @@ ifeq (${uname_S},FreeBSD) DEFINES+=-DFreeBSD OSSEC_CFLAGS+=-pthread -I/usr/local/include @@ -43,15 +43,19 @@ AR_LDFLAGS+=-L/usr/local/lib AR_LDFLAGS+='-Wl,-rpath,$$ORIGIN/../../lib' PRECOMPILED_OS:=freebsd -@@ -434,7 +438,6 @@ ++ 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./shared_modules/ +-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} -@@ -531,8 +534,8 @@ +@@ -533,8 +537,8 @@ ifneq (,$(filter ${USE_INOTIFY},YES auto yes y Y 1)) DEFINES+=-DINOTIFY_ENABLED ifeq (${uname_S},FreeBSD) @@ -62,21 +66,21 @@ OSSEC_CFLAGS+=-I/usr/local/include endif endif -@@ -957,6 +960,8 @@ +@@ -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) ++ EXTERNAL_LIBS += $(LIBCURL_LIB) else ifeq (${uname_S},Darwin) EXTERNAL_LIBS += $(LIBCURL_LIB) endif -@@ -1186,9 +1191,13 @@ +@@ -1193,9 +1199,13 @@ 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 ++ 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 @@ -85,7 +89,7 @@ #### procps ######### -@@ -2295,7 +2304,7 @@ +@@ -2308,7 +2318,7 @@ #### FIM ###### wazuh-syscheckd: librootcheck.a libwazuh.a ${WAZUHEXT_LIB} build_shared_modules @@ -94,7 +98,23 @@ #### Monitor ####### -@@ -2473,7 +2482,7 @@ +@@ -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 @@ -103,7 +123,7 @@ ifneq (,$(filter ${OPTIMIZE_CPYTHON},YES yes y Y 1)) CPYTHON_FLAGS=--enable-optimizations -@@ -2487,22 +2496,45 @@ +@@ -2500,22 +2510,45 @@ endif ifeq (,$(wildcard ${EXTERNAL_CPYTHON}/python)) @@ -151,7 +171,7 @@ 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 -@@ -2519,6 +2551,7 @@ +@@ -2532,6 +2565,7 @@ install_mitre: install_python cd ../tools/mitre && ${WPYTHON_DIR}/bin/python3 mitredb.py -d ${INSTALLDIR}/var/db/mitre.db 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 index 86f1fdf985af..929fef4ec8c1 100644 --- a/security/wazuh-agent/files/patch-src-data_provider-src_sysInfoFreeBSD.cpp +++ b/security/wazuh-agent/files/patch-src-data_provider-src_sysInfoFreeBSD.cpp @@ -1,6 +1,6 @@ ---- src/data_provider/src/sysInfoFreeBSD.cpp 2025-01-15 06:26:54.000000000 -0800 -+++ src/data_provider/src/sysInfoFreeBSD.cpp 2025-02-17 14:38:11.834720000 -0800 -@@ -11,6 +11,7 @@ +--- src/data_provider/src/sysInfoFreeBSD.cpp 2025-09-23 06:59:40.000000000 -0700 ++++ src/data_provider/src/sysInfoFreeBSD.cpp 2025-10-16 15:42:56.638994000 -0700 +@@ -11,20 +11,23 @@ #include "sysInfo.hpp" #include "cmdHelper.h" #include "stringHelper.h" @@ -8,7 +8,9 @@ #include "osinfo/sysOsParsers.h" #include <sys/sysctl.h> #include <sys/vmmeter.h> -@@ -19,12 +20,13 @@ + #include <sys/utsname.h> + #include "sharedDefs.h" ++#include <regex> static void getMemory(nlohmann::json& info) { @@ -25,7 +27,7 @@ if (ret) { -@@ -52,11 +54,23 @@ +@@ -52,11 +55,23 @@ }; } @@ -52,7 +54,7 @@ if (ret) { -@@ -64,11 +78,11 @@ +@@ -64,11 +79,11 @@ { ret, std::system_category(), @@ -66,7 +68,7 @@ info["ram_free"] = ramFree; info["ram_usage"] = 100 - (100 * ramFree / ramTotal); } -@@ -184,8 +198,12 @@ +@@ -184,8 +199,12 @@ nlohmann::json SysInfo::getProcessesInfo() const { @@ -81,7 +83,7 @@ } nlohmann::json SysInfo::getOsInfo() const -@@ -196,11 +214,12 @@ +@@ -196,11 +215,12 @@ if (!spParser->parseUname(Utils::exec("uname -r"), ret)) { @@ -95,93 +97,148 @@ if (uname(&uts) >= 0) { ret["sysname"] = uts.sysname; -@@ -215,18 +234,145 @@ +@@ -215,18 +235,200 @@ nlohmann::json SysInfo::getPorts() const { - // Currently not supported for this OS. - return nlohmann::json {}; -+ const auto query{Utils::exec(R"(sockstat -46qs)")}; -+ -+ /* USER COMMAND PID FD PROTO LOCAL_ADDRESS FOREIGN_ADDRESS PATH_STATE CONN_STATE */ -+ + 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)")}; + + if (!query.empty()) + { -+ const auto lines{Utils::split(Utils::trimToOneSpace(query), '\n')}; ++ nlohmann::json portsjson; ++ portsjson = nlohmann::json::parse(query); ++ auto &portsResult = portsjson["sockstat"]["socket"]; + -+ for (const auto& line : lines) -+ { ++ for(auto &port : portsResult) { + std::string localip = ""; + std::string localport = ""; + std::string remoteip = ""; + std::string remoteport = ""; + std::string statedata = ""; + -+ const auto data{Utils::split(line, ' ')}; -+ auto localdata{Utils::split(data[5], ':')}; -+ auto remotedata{Utils::split(data[6], ':')}; ++ if (port["pid"] != nullptr) { + -+ localip = localdata[0]; -+ localport = localdata[1]; -+ remoteip = remotedata[0]; -+ remoteport = remotedata[1]; ++ 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((data[4] != "udp4") && (data[4] != "udp6") && (data[4] != "udp46")) { -+ statedata = Utils::toLowerCase(data[7]); -+ } ++ if (port["local"]["address"] == "*") { ++ if ((port["proto"] == "udp4") || (port["proto"] == "tcp4")) { ++ localip = "0.0.0.0"; ++ } else { ++ localip = "::"; ++ } ++ } + -+ if(statedata == "listen") { -+ statedata = "listening"; -+ } ++ localport = port["local"]["port"]; + -+ if(localdata.size() == 4) { -+ localip = localdata[0] + ":"+ localdata[1] + ":" + localdata[2]; -+ localport = localdata[3]; -+ } ++ if (port["foreign"]["address"] == "*") { ++ if ((port["proto"] == "udp4") || (port["proto"] == "tcp4")) { ++ remoteip = 0.0.0.0; ++ } else { ++ remoteip = "::"; ++ } ++ } + -+ if(localip == "*") { -+ if((data[4] == "tcp6") || (data[4] == "udp6")) { -+ localip = "0:0:0:0:0:0:0:0"; -+ } else if((data[4] == "tcp4") || (data[4] == "udp4")) { -+ localip = "0.0.0.0"; -+ } -+ } ++ remoteport = port["foreign"]["port"]; + -+ if(localport == "*") { -+ localport = "0"; -+ } ++ nlohmann::json portRecord {}; + -+ if(remotedata.size() == 4) { -+ remoteip = remotedata[0] + ":"+ remotedata[1] + ":" + remotedata[2]; -+ remoteport = remotedata[3]; -+ } ++ 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"]; ++ portRecord["state"] = statedata == "??" ? "" : statedata; ++ portRecord["pid"] = port["pid"]; ++ portRecord["process"] = port["command"]; + -+ if(remoteport == "*") { -+ remoteip = ""; -+ remoteport = "0"; -+ } ++ ports.push_back(portRecord); ++ } ++ } ++ } ++#else ++ const auto query{Utils::exec(R"(sockstat -46qs)")}; + -+ if(data[0] != "?") { -+ nlohmann::json port {}; -+ port["protocol"] = data[4]; -+ port["local_ip"] = localip; -+ port["local_port"] = localport; -+ port["remote_ip"] = remoteip; -+ port["remote_port"] = remoteport; -+ port["tx_queue"] = 0; -+ port["rx_queue"] = 0; -+ port["inode"] = data[3]; -+ port["state"] = statedata; -+ port["pid"] = data[2]; -+ port["process"] = data[1]; ++ if (!query.empty()) ++ { ++ const auto lines{Utils::split(Utils::trimToOneSpace(query), '\n')}; ++ ++ std::regex expression(R"(^(\S+)\s+(\S+)\s+(\d+)\s+(\d+)\s*(\S+)\s+(\S+)\s+(\S+)(?:\s+(\S+))?\s*$)"); ++ ++ for (const auto& line : lines) ++ { ++ std::smatch data; ++ ++ if (std::regex_search(line, data, expression)) ++ { ++ std::string localip = ""; ++ std::string localport = ""; ++ std::string remoteip = ""; ++ std::string remoteport = ""; ++ std::string statedata = ""; ++ ++ auto localdata{Utils::split(data[6], ':')}; ++ auto remotedata{Utils::split(data[7], ':')}; + -+ ports.push_back(port); ++ if (data[8].matched ) { ++ statedata = data[8] == "LISTEN" ? "listening" : Utils::toLowerCase(data[8]); ++ } ++ ++ localport = localdata[localdata.size() - 1]; ++ localdata.pop_back(); ++ localip = Utils::join(localdata, ":"); ++ remoteport = remotedata[remotedata.size() - 1]; ++ remotedata.pop_back(); ++ remoteip = Utils::join(remotedata, ":"); ++ ++ if(localip == "*") { ++ if((data[5] == "tcp4") || (data[5] == "udp4")) { ++ localip = "0.0.0.0"; ++ } else { ++ localip = "::"; ++ } ++ } ++ ++ if(remoteip == "*") { ++ if((data[5] == "tcp4") || (data[5] == "udp4")) { ++ remoteip = "0.0.0.0"; ++ } else { ++ remoteip = "::"; ++ } ++ } ++ ++ if(data[0] != "?") { ++ nlohmann::json port {}; ++ ++ port["protocol"] = data[5]; ++ port["local_ip"] = localip; ++ port["local_port"] = localport == "*" ? "0" : localport; ++ port["remote_ip"] = remoteip; ++ port["remote_port"] = remoteport == "*" ? "0" : remoteport; ++ port["tx_queue"] = 0; ++ port["rx_queue"] = 0; ++ port["inode"] = data[4]; ++ port["state"] = statedata == "??" ? "" : statedata; ++ port["pid"] = data[3]; ++ port["process"] = data[2]; ++ ++ ports.push_back(port); ++ } + } -+ } ++ } + } -+ ++#endif + return ports; } @@ -246,7 +303,7 @@ if (!query.empty()) { -@@ -235,18 +381,22 @@ +@@ -235,6 +437,9 @@ for (const auto& line : lines) { const auto data{Utils::split(line, '|')}; @@ -254,8 +311,11 @@ + const auto sectiondata{Utils::split(data[8], '/')}; + nlohmann::json package; + std::string vendor { UNKNOWN_VALUE }; + std::string email { UNKNOWN_VALUE }; +@@ -244,14 +449,15 @@ package["name"] = data[0]; - package["vendor"] = data[1]; + package["vendor"] = vendor; package["version"] = data[2]; - package["install_time"] = UNKNOWN_VALUE; + package["install_time"] = data[6]; 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 index fa94a0278e65..e60c6542e5a4 100644 --- a/security/wazuh-agent/files/patch-src-shared_modules-utils_stringHelper.h +++ b/security/wazuh-agent/files/patch-src-shared_modules-utils_stringHelper.h @@ -1,9 +1,35 @@ ---- src/shared_modules/utils/stringHelper.h.orig 2024-10-17 00:22:27.000000000 -0700 -+++ src/shared_modules/utils/stringHelper.h 2024-10-19 23:58:11.231439000 -0700 -@@ -256,6 +256,17 @@ - return ret; +--- 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; @@ -13,8 +39,6 @@ + [](char a,char b){ return std::isspace(a) && std::isspace(b);}); + + return str_output; -+ } -+ + } + static std::string toUpperCase(const std::string& str) - { - std::string temp {str}; diff --git a/security/wazuh-agent/pkg-plist b/security/wazuh-agent/pkg-plist index d66c337de3a7..e9c7b5c566ad 100644 --- a/security/wazuh-agent/pkg-plist +++ b/security/wazuh-agent/pkg-plist @@ -138,6 +138,7 @@ /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/centos/8/rootcheck.agent.template /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/centos/8/rootcheck.manager.template /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/centos/8/sca.files +/var/ossec/packages_files/agent_installation_scripts/etc/templates/config/centos/9/sca.files /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/centos/rootcheck.agent.template /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/centos/rootcheck.manager.template /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/centos/sca.files @@ -164,6 +165,7 @@ /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/debian/10/sca.files /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/debian/11/sca.files /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/debian/12/sca.files +/var/ossec/packages_files/agent_installation_scripts/etc/templates/config/debian/13/sca.files /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/debian/7/sca.files /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/debian/8/sca.files /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/debian/9/sca.files @@ -211,6 +213,7 @@ /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/generic/wodle-indexer.manager.template /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/generic/wodle-syscollector.template /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/generic/wodle-vulnerability-detection.manager.template +/var/ossec/packages_files/agent_installation_scripts/etc/templates/config/ol/10/sca.files /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/ol/9/sca.files /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/rhel/10/sca.files /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/rhel/5/rootcheck.agent.template @@ -231,6 +234,7 @@ /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/rhel/rootcheck.agent.template /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/rhel/rootcheck.manager.template /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/rhel/sca.files +/var/ossec/packages_files/agent_installation_scripts/etc/templates/config/rocky/10/sca.files /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/rocky/8/sca.files /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/rocky/9/sca.files /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/rocky/sca.files @@ -306,6 +310,7 @@ /var/ossec/packages_files/agent_installation_scripts/sca/centos/6/cis_centos6_linux.yml /var/ossec/packages_files/agent_installation_scripts/sca/centos/7/cis_centos7_linux.yml /var/ossec/packages_files/agent_installation_scripts/sca/centos/8/cis_centos8_linux.yml +/var/ossec/packages_files/agent_installation_scripts/sca/centos/9/cis_centos9_linux.yml /var/ossec/packages_files/agent_installation_scripts/sca/darwin/15/cis_apple_macOS_10.11.yml /var/ossec/packages_files/agent_installation_scripts/sca/darwin/16/cis_apple_macOS_10.12.yml /var/ossec/packages_files/agent_installation_scripts/sca/darwin/17/cis_apple_macOS_10.13.yml @@ -319,6 +324,7 @@ /var/ossec/packages_files/agent_installation_scripts/sca/debian/cis_debian10.yml /var/ossec/packages_files/agent_installation_scripts/sca/debian/cis_debian11.yml /var/ossec/packages_files/agent_installation_scripts/sca/debian/cis_debian12.yml +/var/ossec/packages_files/agent_installation_scripts/sca/debian/cis_debian13.yml /var/ossec/packages_files/agent_installation_scripts/sca/debian/cis_debian7.yml /var/ossec/packages_files/agent_installation_scripts/sca/debian/cis_debian8.yml /var/ossec/packages_files/agent_installation_scripts/sca/debian/cis_debian9.yml @@ -326,11 +332,13 @@ /var/ossec/packages_files/agent_installation_scripts/sca/freebsd/cis_freebsd13.yml /var/ossec/packages_files/agent_installation_scripts/sca/freebsd/cis_freebsd14.yml /var/ossec/packages_files/agent_installation_scripts/sca/freebsd/cis_freebsd15.yml +/var/ossec/packages_files/agent_installation_scripts/sca/freebsd/cis_freebsd16.yml /var/ossec/packages_files/agent_installation_scripts/sca/generic/sca_distro_independent_linux.yml /var/ossec/packages_files/agent_installation_scripts/sca/hpux/cis_hpux_11i.yml /var/ossec/packages_files/agent_installation_scripts/sca/hpux/cis_hpux_11i_bastille.yml /var/ossec/packages_files/agent_installation_scripts/sca/mongodb/cis_mongodb_36.yml /var/ossec/packages_files/agent_installation_scripts/sca/nginx/cis_nginx_1.yml +/var/ossec/packages_files/agent_installation_scripts/sca/ol/10/cis_oracle_linux_10.yml /var/ossec/packages_files/agent_installation_scripts/sca/ol/9/cis_oracle_linux_9.yml /var/ossec/packages_files/agent_installation_scripts/sca/oracledb/cis_oracle_database_19c.yml /var/ossec/packages_files/agent_installation_scripts/sca/rhel/10/cis_rhel10_linux.yml @@ -339,6 +347,7 @@ /var/ossec/packages_files/agent_installation_scripts/sca/rhel/7/cis_rhel7_linux.yml /var/ossec/packages_files/agent_installation_scripts/sca/rhel/8/cis_rhel8_linux.yml /var/ossec/packages_files/agent_installation_scripts/sca/rhel/9/cis_rhel9_linux.yml +/var/ossec/packages_files/agent_installation_scripts/sca/rocky/cis_rocky_linux_10.yml /var/ossec/packages_files/agent_installation_scripts/sca/rocky/cis_rocky_linux_8.yml /var/ossec/packages_files/agent_installation_scripts/sca/rocky/cis_rocky_linux_9.yml /var/ossec/packages_files/agent_installation_scripts/sca/sles/11/cis_sles11_linux.yml @@ -451,6 +460,7 @@ @dir /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/centos/6 @dir /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/centos/7 @dir /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/centos/8 +@dir /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/centos/9 @dir /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/centos @dir /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/darwin/15 @dir /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/darwin/16 @@ -466,6 +476,7 @@ @dir /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/debian/10 @dir /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/debian/11 @dir /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/debian/12 +@dir /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/debian/13 @dir /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/debian/7 @dir /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/debian/8 @dir /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/debian/9 @@ -480,6 +491,7 @@ @dir /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/fedora @dir /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/generic/localfile-logs @dir /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/generic +@dir /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/ol/10 @dir /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/ol/9 @dir /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/ol @dir /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/rhel/10 @@ -489,6 +501,7 @@ @dir /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/rhel/8 @dir /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/rhel/9 @dir /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/rhel +@dir /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/rocky/10 @dir /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/rocky/8 @dir /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/rocky/9 @dir /var/ossec/packages_files/agent_installation_scripts/etc/templates/config/rocky @@ -543,6 +556,7 @@ @dir /var/ossec/packages_files/agent_installation_scripts/sca/centos/6 @dir /var/ossec/packages_files/agent_installation_scripts/sca/centos/7 @dir /var/ossec/packages_files/agent_installation_scripts/sca/centos/8 +@dir /var/ossec/packages_files/agent_installation_scripts/sca/centos/9 @dir /var/ossec/packages_files/agent_installation_scripts/sca/centos @dir /var/ossec/packages_files/agent_installation_scripts/sca/darwin/15 @dir /var/ossec/packages_files/agent_installation_scripts/sca/darwin/16 @@ -561,6 +575,7 @@ @dir /var/ossec/packages_files/agent_installation_scripts/sca/hpux @dir /var/ossec/packages_files/agent_installation_scripts/sca/mongodb @dir /var/ossec/packages_files/agent_installation_scripts/sca/nginx +@dir /var/ossec/packages_files/agent_installation_scripts/sca/ol/10 @dir /var/ossec/packages_files/agent_installation_scripts/sca/ol/9 @dir /var/ossec/packages_files/agent_installation_scripts/sca/ol @dir /var/ossec/packages_files/agent_installation_scripts/sca/oracledb |
