3586 Commits

Author SHA1 Message Date
Gabor Berkes
b97b61b711
Merge branch 'owasp-modsecurity:v3/master' into refactor/default-pcre2 2025-02-20 09:56:01 +01:00
Ervin Hegedus
40af573759
Merge pull request #3335 from RooHTaylor/v3/master
Fix for issue #3334: build not finding YAJL
2025-01-30 14:20:59 +01:00
Andrew Taylor
199056b916 Fix for issue #3334: build not finding YAJL
When searching for YAJL during ./configure, pkg-config is checked first,
and then a list of directories is searched if pkg-config bears no fruit.
The previous version of yajl.m4 was looping over YAJL_POSSIBLE_LIB_NAMES
instead of YAJL_POSSIBLE_PATHS and passing the lib name to the
CHECK_FOR_YAJL_AT() function instead of the path. The would lead to YAJL
never being found if pkg-config could not find it.
2025-01-30 01:19:50 -05:00
Ervin Hegedus
9e685bf86d
Merge pull request #3322 from airween/v3/validatebyterange
fix: add value checking to @validateByteRange
2025-01-06 19:16:49 +01:00
Ervin Hegedus
9158477561
Add check after intervall parsing, spell fix 2025-01-06 17:36:49 +01:00
Ervin Hegedus
4c5bc45dfd
Add value checking to @validateByteRange 2025-01-06 16:36:36 +01:00
Ervin Hegedus
f260a75c14
Merge pull request #3314 from ElevationsRPG/v3/master
Update README.md
2025-01-06 11:49:41 +01:00
Gabor Berkes
6a2eee629c
Merge branch 'owasp-modsecurity:v3/master' into refactor/default-pcre2 2025-01-06 09:02:00 +01:00
Elevations
d9acf3d0cd
Merge branch 'owasp-modsecurity:v3/master' into v3/master 2025-01-06 13:28:23 +13:00
Ervin Hegedus
eb7e2b8a5f
Merge pull request #3319 from airween/v3/osxcifix
fix: build library on OSX without GeoIP brew package
2025-01-05 17:05:30 +01:00
Ervin Hegedus
a332567b85
Set correct order of commands 2025-01-05 16:41:05 +01:00
Ervin Hegedus
72bb873460
Use latest released version by commit id.
Co-authored-by: Max Leske <250711+theseion@users.noreply.github.com>
2025-01-05 16:09:03 +01:00
Ervin Hegedus
849131c8cf
Change depth value to 1 2025-01-04 23:46:09 +01:00
Ervin Hegedus
d76f3e741e
Update .github/workflows/ci.yml
Co-authored-by: Max Leske <250711+theseion@users.noreply.github.com>
2025-01-04 20:46:36 +01:00
Ervin Hegedus
900e7bcd06
Fix OSX build without GeoIP brew package 2025-01-04 13:48:39 +01:00
Gabor Berkes
10d1c2be74 Refactor: improve PCRE settings output in configure.ac
Enhanced the `configure.ac` script to provide clearer and more readable output for PCRE and PCRE2 settings during configuration. This change improves usability by ensuring that the configuration process displays relevant details in a structured and user-friendly format.

This update aligns with the broader PCRE to PCRE2 migration effort, making the build configuration process more transparent and consistent.
2024-12-20 08:12:06 +00:00
Gabor Berkes
e92507868e Fix macOS GitHub Actions build: add PCRE2_CFLAGS/LDADD/LDFLAGS
Introduced PCRE2_CFLAGS, PCRE2_LDADD, and PCRE2_LDFLAGS in all relevant Makefile.am files to align with the existing PCRE_* variable usage. This change addresses potential issues with linking and configuration for builds on macOS GitHub runners.

These modifications aim to resolve the build failure observed exclusively in the macOS environment while maintaining compatibility across other platforms. Testing will confirm if this adjustment corrects the issue.
2024-12-11 12:48:20 +00:00
Gabor Berkes
784cf0b64c Debug: increase verbosity in pcre2.m4 for macOS GitHub Actions
Added AC_MSG_NOTICE macros to pcre2.m4 to enhance debugging output. This change aims to identify the cause of build failures on macOS runners in GitHub Actions, which do not occur locally or on other platforms (Linux, Windows).

The added verbosity will help trace the build process and inspect variable values for inconsistencies in the macOS runner environment.
2024-12-11 08:57:43 +00:00
Elevations
c0681b6239
Update README.md
Remove conan center change
2024-12-11 19:29:32 +13:00
Elevations
7b4c3a2c0f
Update Dockerfile
Update Docker to latest conan version 2.10.2
2024-12-11 19:06:59 +13:00
Elevations
17700eca5b
Update README.md
Update Windows README to use latest conan version and conan center.
2024-12-11 17:45:37 +13:00
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
Gabor Berkes
4fb22466a0 Cleanup: Remove useless/nonfunctional AM_CONDITIONAL macros
- Deleted AM_CONDITIONAL macros from configure.ac that had no functional
  impact on the build system.
2024-12-10 07:32:13 +00:00
Ervin Hegedus
d9101a4fe1
Merge pull request #3306 from airween/v3/time_mon_fix
fix: align TIME_MON variable's behavior
2024-11-24 16:28:47 +00:00
Ervin Hegedus
daf550ef5f
Fix regex for test 2024-11-24 14:06:50 +01:00
Ervin Hegedus
db7e4cb67b
Align TIME_MON variable's behavior 2024-11-23 10:58:35 +01:00
Ervin Hegedus
fd4564131f
Merge pull request #3307 from gberkes/v3/cppcheck_v2_16_upgrade
Fix: Add false positive cppcheck-suppress for compatibility with upda…
2024-11-23 09:28:08 +00:00
Gabor Berkes
530919439b Fix: Add false positive cppcheck-suppress for compatibility with updated cppcheck version
- Added a cppcheck-suppress directive to handle a false positive detected
  by cppcheck 2.16.
- This change addresses an issue caused by the recent Homebrew update
  on macOS CI runner, which upgraded cppcheck from version 2.15 to 2.16.
2024-11-22 23:36:40 +00:00
Ervin Hegedus
41fd21b0fb
Merge pull request #3298 from airween/v3/sethostnamefix
Fix m_requestHostName variable behavior
2024-11-19 20:49:00 +00:00
Ervin Hegedus
d422b36966
Add condition before set hostname; move setRequestHostName() before processConnection() 2024-11-12 16:55:02 +01:00
Ervin Hegedus
4a720004dd
Merge pull request #3287 from hnakamur/fix_modsecurity-regression-test-secremoterules.txt_url_in_example
Fix modsecurity-regression-test-secremoterules.txt URL in example
2024-11-06 10:20:58 +00:00
Hiroaki Nakamura
42a401892b
Fix modsecurity-regression-test-secremoterules.txt URL in example 2024-11-06 14:33:28 +09:00
Ervin Hegedus
5bec188146
Merge pull request #3291 from hnakamur/add_test_regression_rules
Add regression rules for test
2024-11-05 11:03:04 +00:00
Hiroaki Nakamura
742f97ccc0
Add regression rules for test
Copied from:
- faa96c7838/modsecurity-regression-rules.txt
- b9321f190e/modsecurity-regression-ip-list.txt

diff --git a/test/test-cases/regression/operator-ipMatchFromFile.json b/test/test-cases/regression/operator-ipMatchFromFile.json
index 4a225954..1eb4d44a 100644
--- a/test/test-cases/regression/operator-ipMatchFromFile.json
+++ b/test/test-cases/regression/operator-ipMatchFromFile.json
@@ -129,7 +129,7 @@
     },
     "rules":[
       "SecRuleEngine On",
-      "SecRule REMOTE_ADDR \"@ipMatchFromFile b9321f190e/modsecurity-regression-ip-list.txt\" \"id:1
2024-11-02 20:17:24 +09:00
Ervin Hegedus
29a86b17df
Merge pull request #3283 from eduar-hte/cppcheck2142
Use latest version of cppcheck (2.15.0) to analyze codebase
2024-10-22 13:54:52 +02:00
Eduardo Arias
aca93f568e Remove no longer needed cppcheck inline suppressions. 2024-10-21 17:04:26 -03:00
Eduardo Arias
7ec50eb53f Make GeoLookup::debug function static (and non-member), as suggested by cppcheck. 2024-10-21 17:04:26 -03:00
Eduardo Arias
4e68edf0e5 Replace usage of sscanf with strtol to remove cppcheck inline suppression 2024-10-21 17:04:26 -03:00
Eduardo Arias
cdaf32f521 Remove cppcheck suppression by replacing use of local variable to alias this->m_variables
- The name of the local variable would clash with the namespace of the
  same name, which may have lead cppcheck to think the variable was not
  used.
2024-10-21 17:04:26 -03:00
Eduardo Arias
ce9a3167fa Use initialization list to initialize m_service
- This is correct because base class is initialized before members are
  initialized.
- Removes cppcheck suppression by addressing reported issue.
- Leverage C++11's 'default member initializer' to initialize m_provider
  & m_demandsPassword and address Sonarcloud issue.
2024-10-21 17:03:30 -03:00
Eduardo Arias
b0497d9cb9 Avoid this unnecessary copy by using a "const" reference.
- Reported by Sonarcloud
2024-10-19 15:27:39 -03:00
Eduardo Arias
d1e7e7b4f2 Refactor to remove duplicate code in ValidateSchema & ValidateDTD
- Reported by Sonarcloud
2024-10-19 15:27:39 -03:00
Eduardo Arias
2fb446ab2d Address cppcheck warnings generated after addressing Sonarcloud suggestions
- The following two warnings were generated after introducing the change
  to instantiate the DigestImpl template with the address of mbedtls_md5
  or mbedtls_sha1:
  - warning: src/utils/sha1.h,62,error,danglingTemporaryLifetime,Using
    pointer that is a temporary.
  - warning: src/utils/sha1.h,60,style,constVariablePointer,Variable
    'ret' can be declared as pointer to const
- See https://github.com/owasp-modsecurity/ModSecurity/pull/3231#issuecomment-2312511500
2024-10-19 11:48:05 -03:00
Eduardo Arias
bbef22b3b5 Added const reported by cppcheck 2.14 2024-10-19 11:48:05 -03:00
Eduardo Arias
d053ec6de6 Add cppcheck suppressions for false positives 2024-10-19 11:48:05 -03:00
Eduardo Arias
c2b86ddc49 Suppress warnings on seclang-parser.hh
warning: seclang-parser.hh,2116,warning,duplInheritedMember,The struct 'basic_symbol < by_kind >' defines member function with name 'clear' also defined in its parent struct 'by_kind'.
warning: seclang-parser.hh,2376,warning,duplInheritedMember,The struct 'basic_symbol < by_kind >' defines member function with name 'type_get' also defined in its parent struct 'by_kind'.
warning: seclang-parser.hh,2116,warning,duplInheritedMember,The struct 'basic_symbol < by_state >' defines member function with name 'clear' also defined in its parent struct 'by_state'.
warning: seclang-parser.hh,2120,style,constVariableReference,Variable 'yysym' can be declared as reference to const
2024-10-19 11:48:05 -03:00
Eduardo Arias
7d9c80dede Address cppcheck warnings: uselessOverride (The function '...' overrides a function in a base class but is identical to the overridden function) 2024-10-19 11:48:05 -03:00
Eduardo Arias
da38f20e19 Added missing override keyword as reported by cppcheck 2.14 2024-10-19 11:48:05 -03:00