47 Commits

Author SHA1 Message Date
Ervin Hegedus
646881085c
Change release version to v3.0.14 2025-02-25 10:52:04 +01:00
eduar-hte
4df297b596 Avoid passing RuleMessage by std::shared_ptr and use a reference instead.
- Avoids copying std::shared_ptr when lifetime of the RuleMessage
  is controlled by the caller.
  - The RuleMessage instance is created in RuleWithActions::evaluate and
    then used to call the overloaded version of this method that is
    specialized by subclasses.
  - Once the call to the overloaded method returns, the std::shared_ptr
    is destroyed as it's not stored by any of the callers, so it can
    be replaced with a stack variable and avoid paying the cost of
    copying the std::shared_ptr (and its control block that is
    guaranteed to be thread-safe and thus is not a straightforward
    pointer copy)
- Introduced RuleMessage::reset because this is required by
  RuleWithActions::performLogging when it's not the 'last log', the rule
  has multimatch and it's to be logged.
  - The current version is creating allocating another instance of
    RuleMessage on the heap to copy the Rule & Transaction related state
    while all the other members in the RuleMessage are set to their
    default values.
  - The new version leverages the existent, unused and incomplete
    function 'clean' (renamed as 'reset') to do this on the current
    instance.
    - Notice that the current code preserves the value of m_saveMessage,
      so 'reset' provides an argument for the caller to control whether
      this member should be reinitialized.
2024-10-07 11:45:00 -03:00
Ervin Hegedus
24dbcfe637
Change release version to v3.0.13 2024-09-03 15:24:29 +02:00
gberkes
c46f470d6b Refactor: moved 3 #include directives to the top of the file.
To aid code readability, all #include directives in a code file
should be grouped together near the top. The only items that may
precede an #include in a file are other preprocessor directives or comments.

Reference: https://sonarcloud.io/project/issues?sinceLeakPeriod=true&issueStatuses=OPEN%2CCONFIRMED&id=owasp-modsecurity_ModSecurity&open=AY8-ffgqm_fzkWiCOtCs&tab=code

Deleted some unnecessary trailing spaces as well.
2024-08-07 10:39:06 +02:00
Marc Stern
ca5f5163b4
Merge pull request #3027 from StarryVae/comment-spell-fix
Fix a small comment spell
2024-02-01 10:50:38 +01:00
Ervin Hegedus
5f44383236
Change release version to v3.0.12 2024-01-30 16:43:48 +01:00
wangkai19
3f8de775f9 Fix small comment spell 2023-12-14 17:30:11 +08:00
Martin Vierula
bbde9381cb
Change release version to v3.0.11 2023-12-06 10:52:41 -08:00
Martin Vierula
ccc2d9b536
Change release version to v3.0.10 2023-07-25 07:23:07 -07:00
Martin Vierula
205dac0e8c
Change release version to v3.0.9 2023-04-12 10:45:09 -07:00
Martin Vierula
996c7e1e1f
Change release version to v3.0.8 2022-09-07 11:53:30 -07:00
Martin Vierula
1bdd047400
Change release version to v3.0.7 2022-05-30 06:29:36 -07:00
Martin Vierula
c3d7f4b560
Change release version to v3.0.6 2021-11-19 11:23:27 -08:00
Felipe Zimmerle
bf881a4eda Change release version to v3.0.5 2021-07-07 10:13:14 -03:00
Felipe Zimmerle
3748d62f19
Changes copyright dates on the code 2021-01-19 09:24:37 -03:00
Felipe Zimmerle
59d4268882
Refactoring: renames Rule to RuleWithOperator 2020-03-31 10:00:08 -03:00
Felipe Zimmerle
f1d22f9b02
Fix version check 2020-03-24 17:20:22 -03:00
Felipe Zimmerle
357c140003
Changens copyright year 2020-01-31 10:32:37 -03:00
Felipe Zimmerle
fe98ce4c7d
Cosmetics: address cppcheck warnings 2020-01-30 18:19:34 -03:00
Felipe Zimmerle
753145fbd1
Change release version to v3.0.4 2020-01-10 09:32:41 -03:00
Felipe Zimmerle
4e6e4243a8
Change release version to v3.0.3 2018-11-01 22:19:44 -03:00
Steven
004047ef6c Add correct C function prototypes for msc_init and msc_create_rule_set 2018-10-13 19:25:13 -04:00
Felipe Zimmerle
8d0f51beda
Change release version to v3.0.2 2018-04-03 10:47:48 -03:00
Felipe Zimmerle
f67ff0aa67
Change release version to v3.0.1 2018-04-01 21:23:25 -03:00
Andrei Belov
ebc068b8ce
Fix msc_who_am_i() to return pointer to a valid C string
Previously this function was unusable as it returned pointer
to some garbage data.
2018-02-23 18:42:33 -03:00
Felipe Zimmerle
c1cd668acb
Change release version to v3.0.0 2017-12-13 19:09:08 -03:00
Felipe Zimmerle
cca3642530
Changes release tag to -rc1 2017-08-27 22:06:20 -03:00
Felipe Zimmerle
e2af60e765
Expands log_cb to share ruleMessage structure instead text
Text version still available and it is the default options
2017-03-06 15:02:04 -03:00
Felipe Zimmerle
027d50b76b
Adds first version of `processContentOffset'
This commit also includes an example application on how to use the
`processContentOffset' method.
2017-03-06 15:02:02 -03:00
Felipe Zimmerle
b48e4b3a37
refactoring: Moves Phases enum to outside ModSecurity class 2016-10-07 19:05:50 -03:00
Felipe Zimmerle
c680ddf2cd
Refactoring on rulesProperties class
Among of other things the merge process was improved to detect if
certain properties were set on the origin rule set.
2016-10-05 12:01:15 -03:00
Felipe Zimmerle
2477470607
Adds support to the resource collection 2016-06-24 15:17:29 -03:00
Felipe Zimmerle
758ecb5d6d Adds support to USER collection, setuid action and USERID variable
More details on: #1026, #1024, #1048
2016-05-09 20:27:08 -03:00
Felipe Zimmerle
a2a47798e9 Adds support to the collection SESSION and setsid action 2016-05-06 14:38:04 -03:00
Felipe Zimmerle
3062ff2aa5 Using Collection instead of GlobalCollection
Both has the same methods and characteristics except for the fact that
one is global and the other not. That can be handled by the backend.
2016-05-04 22:42:24 -03:00
Felipe Zimmerle
5643d2fa28 Warming up to the remote collections support
Huge refactoring to have the code in shape to later support the
remote collections with different backends.
2016-05-03 17:39:49 -03:00
Felipe Zimmerle
e5acc95de8 First version of global' and ip' collections 2016-03-30 18:22:00 -03:00
Felipe Zimmerle
a51e707517 Renames class Assay to Transaction 2016-01-13 15:57:00 -03:00
Felipe Zimmerle
fb3696ac04 Fix a few things to provide an easy interface for script bindings 2015-12-22 11:53:36 -03:00
Felipe Zimmerle
42ce0475b2 Coding style: changes the namespace in the comments 2015-12-10 13:20:32 -03:00
Felipe Zimmerle
b5a43871e6 Changes library namespace from ModSecurity to modsecurity 2015-12-01 10:55:59 -03:00
Felipe Zimmerle
d0c215d78b Adds support for the server log integration 2015-09-17 09:01:52 -03:00
Felipe Zimmerle
41bf1490b7 Adds MODSEC_BUILD variable 2015-07-20 20:43:07 -03:00
Felipe Zimmerle
001d5ebf7f Properly deal with classes destructors
There are some classes such as AuditLog that demands a reference count. That is
needed because this class can be used by different instances of the Rules
classes.
2015-07-13 14:16:48 -03:00
Felipe Zimmerle
2138dd1369 Adds method setConnectorInformation to ModSecurity class
For the purpose of log it is necessary for modsecurity to understand which
'connector' is consuming the API.
2015-07-10 18:37:48 -03:00
Felipe Zimmerle
8dab5ac30c Adds whoAmI method to ModSecurity class
The method returns information about the ModSecurity's version and the platform
that it was compiled. Further it will be used by the audit logs and by the
connectors. msc_who_am_i was added accordingly, to the C api.
2015-07-10 18:37:48 -03:00
Felipe Zimmerle
95cb4c56ab Very first commit: libmodsecurity
Check the README.md file for further information about the libmodsecurity.
2015-06-26 14:35:15 -03:00