101 Commits

Author SHA1 Message Date
Gabor Berkes
a07d0c7d34 Fix missing libpcre2 dependency on macOS GitHub runner
Identified an issue where the macOS GitHub runner no longer includes the libpcre2 library by default. Updated the workflow configuration to explicitly add libpcre2 as a dependency, ensuring successful builds and compatibility with the updated build system.

This change prevents build failures on macOS environments and aligns the runner's setup with project requirements.
2024-12-10 21:40:09 +00:00
Gabor Berkes
106ed22b6d Fix typo in pcre.m4: corrected PCRE_CFLAGS assignment 2024-12-10 10:58:20 +00:00
Gabor Berkes
c6433df7b2 Refactor build system to use libpcre2 as the default
Updated the build system and related source files to use libpcre2 as the
default regex library instead of the deprecated libpcre. This change
ensures future compatibility and aligns with the library's maintenance status.

To build with the old libpcre, the `--with-pcre` configuration parameter
can be specified.
2024-12-10 10:16:14 +00:00
eduar-hte
e313ac7de7 Introduce ModSecurityTestContext to encapsulate setup of objects required to execute transactions
- Simplifies memory management on error conditions
- Context will be used in unit tests too, in order to provide
  Transaction related instances.
2024-10-07 11:45:00 -03:00
Eduardo Arias
4bf9616f9e Adding multithreaded example from issue #3054 (by airween)
- Rewritten to use C++ libModSecurity API and std::thread (instead of
  pthreads)
2024-08-09 11:34:41 -07:00
Eduardo Arias
293cd214c7 Removed usage of pthreads and replaced with std C++ features
- Replaced pthread_mutex_t in modsecurity::operators::Pm with std::mutex
- Replaced pthread's thread usage in reading_logs_via_rule_message
  example with std::thread.
  - Simplified and modernized C++ code.
- Removed unnecessary includes of pthread.h
2024-08-09 11:34:40 -07:00
Eduardo Arias
4e15f9ef71 Turn off LMDB by default in Windows build to align with defaults for other platforms
- Replaced WITHOUT_XXX build options with WITH_XXX to make it easier to
  understand and configure.
- Updated GitHub workflow to align with these changes and include a
  build 'with lmdb' (again, analogous to non-Windows configurations)
2024-08-09 11:34:40 -07:00
Eduardo Arias
59254fe3bd Simplifiy configuration to build libModSecurity with std C++17
- Leveraged autoconf again to check whether the C++ compiler supports
  the required standard version and build using it.
- Replaced the outdaded `ax_cxx_compile_stdcxx_11.m4` macro with the
  latest version of `ax_cxx_compile_stdcxx` which supports C++17.
  - https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html
  - https://raw.githubusercontent.com/autoconf-archive/autoconf-archive/e4e5269db2764b9f53d759c24750ac6ca38e02ea/m4/ax_cxx_compile_stdcxx.m4
- This should also streamline updating to C++20 in the future.
2024-08-08 11:23:35 -07:00
Eduardo Arias
e31ff7e60b Build on macOS 14 arm64 2024-08-05 11:49:58 -07:00
Behzad Eslami Tehrani
4fce2e3c1d Fixing typo in Dockerfile
Fixing typo in environment variable SRC_DIR.
SCR_DIR -> SRC_DIR
2024-07-22 10:09:27 +03:30
Eduardo Arias
a3f40ef03c Replace Mbed TLS source code in repository with a submodule
- Updated to latest Mbed TLS version (v3.6.0)
2024-05-31 00:41:10 +00:00
Eduardo Arias
7732b5e8f3 Update libinjection to version v3.9.2-92-gb9fcaaf 2024-05-31 00:41:10 +00:00
Eduardo Arias
9e44964dc7 Use SRC_DIR argument 2024-05-19 21:12:34 +00:00
Eduardo Arias
1b2de5a5d3 Add support to turn 3rd party dependencies off
- By default, all the 3rd party dependencies are enabled.
- A dependency can be turned off by adding the "-DWITHOUT_xxx=ON" to
  the call of vcbuild.bat
- List of 3rd party dependencies and associated option to turn them off:
  - LMDB: WITHOUT_LMDB
  - LUA: WITHOUT_LUA
  - LibXML2: WITHOUT_LIBXML2
  - MaxMind: WITHOUT_MAXMIND
  - cURL: WITHOUT_CURL
2024-05-14 21:53:52 +00:00
Eduardo Arias
e6e2989bd5 Configure test fixture using CTest for Windows build
- Added new test/test_suite.in with list of regression and unit tests
  previously in Makefile.am, to be shared between Unix and Windows
  builds.
- Updated regression.cc & unit.cc to return the number of failed tests
  to indicate to CTest that the test failed. Similarly, a crash or
  unhandled exception terminates the process with a non-zero exit code.
  - This change doesn't affect running the tests with autotest in Unix
    builds because this processes test output from custom-test-driver &
    test-suite.sh, and ignores the exit code of the test runner.
- Removed comment in test/test-cases/regression-offset-variable.json as
  this is not supported by JSON and prevents strict parsers to read and
  process the file.
- Minor change in regression.cc's clearAuditLog to replace std::ifstream
  with std::ofstream as the mode to open the flag applies to an output
  stream.
- Minor change in unit.cc to simplify code that deletes tests.
- Minor changes to test/custom-test-driver to correct usage information.
2024-05-13 10:22:12 -07:00
Eduardo Arias
faae58eed7 Added Windows build scripts using Build Tools for Visual Studio 2022 (MSVC compiler & CMake) and Conan package manager
- Included Dockerfile to automate the setup process of prerequisites
  and build of libModSecurity binaries.
2024-05-10 02:28:13 +00:00
Ervin Hegedus
d0f3cf1389
Replace obsolete macros 2024-02-25 22:01:07 +01:00
Martin Vierula
31cbd7309a
Configure: add additional name to pcre2 pkg-config list 2023-08-02 05:45:58 -07:00
martinhsv
e56f53b719
Merge pull request #2596 from ffontaine/v3/master
build/libmaxmind.m4: fix build with host-pkgconf
2022-12-02 11:33:56 -08:00
martinhsv
700a9e9ff1
Merge pull request #2806 from hughmcmaster/as_help_string
Use AS_HELP_STRING instead of obsolete AC_HELP_STRING macro
2022-11-11 14:33:25 -05:00
Martin Vierula
791964a0ea
During configure, do not check for pcre if pcre2 specified 2022-11-10 07:50:52 -08:00
Hugh McMaster
f05f322302 Use AS_HELP_STRING instead of the obsolete AC_HELP_STRING macro
AC_HELP_STRING has been obsolete since at least Autoconf 2.53,
which was released in 2003.
2022-10-16 18:16:01 +11:00
Hugh McMaster
d76c527751 build/libxml.m4: Check for libxml2 via pkg-config then xml2-config
Debian is taking steps to remove xml2-config in favour of pkg-config.
This means ModSecurity will build without libxml2 support by default
on Debian, Ubuntu and other distributions tracking Debian packages.

This patch modifies build/libxml.m4 to check for libxml2 via
pkg-config, falling back to xml2-config if necessary.
2022-10-05 15:43:33 +11:00
Martin Vierula
f84614fe06 Support PCRE2 2022-04-13 10:44:56 -07:00
Fabrice Fontaine
d2b700d7af build/libmaxmind.m4: fix build with host-pkgconf
Build with maxminddb is broken since version 3.0.5 and
785958f9b5
because libmaxminddb has been removed from MAXMIND_POSSIBLE_LIB_NAMES

So, as suggested by Arnout in #2131, don't use
MAXMIND_POSSIBLE_LIB_NAMES for pkg-config, because it was never called
anything other than libmaxminddb

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2021-07-25 18:35:59 +02:00
Takaya Saeki
3bfe4b81af build: Fix pcre's JIT support detection was not working 2021-05-24 10:33:11 -03:00
Felipe Zimmerle
662c05f89b build: Adding a new path while searching for liblua.
Alpine has a different folder to hold concurrent versions of
Lua. This commit address issue #2560.
2021-05-24 10:33:11 -03:00
Felipe Zimmerle
a589f6b693 Build: using PKG-CONFIG in a new fashion
Trying to avoid bulid errors if pkg-config is available.
2021-05-24 10:33:11 -03:00
Felipe Zimmerle
4cdcc15334
Revert "Adds suppor for HyperScan in the bulid system"
This reverts commit 912704b6d4e45aa601b87c5a4cf4b6061d1bbccb.
2021-02-26 11:33:12 -03:00
Felipe Zimmerle
912704b6d4
Adds suppor for HyperScan in the bulid system 2021-02-26 11:15:02 -03:00
Felipe Zimmerle
785958f9b5
Fix maxminddb link on FreeBSD
Issue #2131
2020-10-23 14:44:54 -03:00
Felipe Zimmerle
e9dce44f6a
build: Minor fixies on Lua detection 2020-08-18 09:19:51 -03:00
Felipe Zimmerle
8c85b78361
Adds support to lua 5.4 2020-08-17 11:08:03 -03:00
Felipe Zimmerle
fe98ce4c7d
Cosmetics: address cppcheck warnings 2020-01-30 18:19:34 -03:00
Felipe Zimmerle
a6620604d4
build: fix yajl messages 2020-01-22 09:16:13 -03:00
Victor Hora
20ef01d75c Allow LuaJIT 2.1 to be used 2018-10-12 17:32:10 -04:00
Victor Hora
0a88e0237f
Allow libMaxmind to work with Ubuntu PPA packages 2018-09-11 20:36:30 -03:00
Victor Hora
0ac23a47cf Add LUA compatibility for CentOS and try to use LuaJIT first if available 2018-08-22 14:13:09 -04:00
Victor Hora
857bf9da58 Allow LuaJIT to be used 2018-08-22 12:08:44 -04:00
Robert Paprocki
dee9898449 Implement support for Lua 5.1 2018-07-27 15:43:12 -04:00
Charles Peterson
b5528bb8de
fix when multiple lines for curl version
Issue #1771
2018-05-10 15:16:00 -03:00
Felipe Zimmerle
df169ea108
Adds support for libMaxMind 2018-03-22 19:11:42 -03:00
Ervin Hegedüs
9dff36f598
Added some cosmetics to autoconf related code 2018-02-23 18:37:21 -03:00
Andrei Belov
f4a05b6e1f
Configure: actually disable Lua on systems with liblua5.1
In particular, on CentOS 7.3.1611 building libmodsecurity with
default configure options ends up with failure while compiling
src/engine/lua.cc, while config.log states that Lua was disabled.
2017-12-26 16:04:23 +03:00
Victor Hora
c98e665475
Improvements on LUA build scripts and support for LUA 5.2 2017-12-12 09:51:10 -03:00
Minasu
af7e6ee169
Correction lua header 2017-11-17 09:52:33 -03:00
Felipe Zimmerle
381cf8ac21
Makes ssdeep enabled by default on the build scripts 2017-11-07 09:15:14 -03:00
Felipe Zimmerle
7fa5ca9ba0
Makes lua optional 2017-11-06 00:44:54 -03:00
Felipe Zimmerle
1189e9b0ef
Adds support to LUA in configure scripts 2017-10-31 09:59:12 -03:00
Felipe Zimmerle
a9d54c30a1
Fix on ssdeep search script 2017-10-27 16:57:26 -03:00