Felipe Zimmerle
39ac4760ea
Refactoring on Action - having RuleWithAction and RuleWithActionsProperties
2020-11-16 10:01:43 -03:00
Felipe Zimmerle
730328897d
Constify Transaction on variable resolution
2020-11-16 10:01:43 -03:00
Felipe Zimmerle
3317f498f6
Uses unique_ptr on REMOTE_USER
2020-11-16 10:01:43 -03:00
Felipe Zimmerle
09ec92e66a
Reduce the workload on VariableValue
...
Last compute at the last minute, if needed.
2020-11-16 10:01:42 -03:00
Felipe Zimmerle
44791be5e0
Adds support for string_view in Variable
2020-11-16 10:01:42 -03:00
Felipe Zimmerle
952473368a
Replaces getKeyWithCollection with getName on VariableValue
2020-11-16 10:01:42 -03:00
Felipe Zimmerle
a8ba54e1ab
Cosmetics: Using VariableValues instead of std::vector<...>
...
Making the code more readable.
2020-11-16 10:01:42 -03:00
Felipe Zimmerle
f917d07950
Refactoring on variables::Variable
...
Using the references on key and collection as shared pointers
2020-11-16 10:01:42 -03:00
WGH
1b13e041ce
Use std::shared_ptr for variable resolution
...
AnchoredSetVariable::resolve is called for every rule
(see RuleWithOperator::evaluate). The previous implementation allocated
a new copy of every variable, which quickly added up. In my tests,
AnchoredSetVariable::resolve function consumed 7.8% of run time.
AnchoredSetVariable (which is a multimap) values are never changed,
only added. This means it's safe to store them in std::shared_ptr,
and make resolve return shared_ptr pointing to the same object.
Other resolve implementation could also use this optimization by not
allocating new objects, however, they are not hot spots, so this
optimization was not implemented there.
In my benchmark, this raises performance from 117 requests per second to
131 RPS, and overhead is lowered from 7.8% to 2.4%.
As a bonus, replacing plain pointer with smart pointers make code
cleaner, since using smart pointers makes manual deletes no longer necessary.
Additionally, VariableOrigin is now stored in plain std::vector,
since it's wasteful to store structure containing just two integer
values using std::list<std::unique_ptr<T>>.
2020-11-16 10:01:42 -03:00
Felipe Zimmerle
2ee9ccffa9
actions: Compute the rule association during rules load
2020-11-16 10:01:40 -03:00
Felipe Zimmerle
3fb4266ebf
Adds method getVariableNames to variables
2020-11-16 10:01:39 -03:00
Felipe Zimmerle
bab7d6ccdf
Moves rule* headers to src/
2020-11-16 10:01:39 -03:00
Felipe Zimmerle
38a814411b
Cleanup on Action class
2020-11-16 10:01:39 -03:00
Felipe Zimmerle
a5a0f261e2
Refactoring in the Rule class to make it more elegant
2020-11-16 10:01:38 -03:00
Felipe Zimmerle
1518015687
Adds new method for rule merge
...
IMPORTANT: SecDefaultAction specified on a child configuration will
overwrite the ones specified on the parent; Previously it was
concatenating.
2020-11-16 10:01:38 -03:00
Felipe Zimmerle
4b425850cf
Cosmetics: fix cppcheck warnings
2020-10-23 08:29:07 -03:00
Felipe Zimmerle
7a48245aed
Creates RuleUnconditional
...
Makes RuleScript child of RuleWithActions instead of Operator
2020-03-31 14:44:19 -03:00
Felipe Zimmerle
59d4268882
Refactoring: renames Rule to RuleWithOperator
2020-03-31 10:00:08 -03:00
Felipe Zimmerle
fda03c0016
Yet another refactoring in Rule
2020-03-30 15:38:51 -03:00
Felipe Zimmerle
6a742cdf76
Refactoring: Renames RulesProperties to RulesSetProperties
2020-02-17 13:17:03 -03:00
Felipe Zimmerle
7495675d54
Refactoring: Renames Rules to RulesSet
...
RulesSet does not only contain rules but alse properties
2020-02-11 14:26:47 -03:00
martinhsv
1b1fdc055b
Fix rule-update-target exclusions for plain (non-regex) variables
2020-02-11 09:42:37 -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
68ef2dece3
Cosmetics: address cppcheck warnings on src/variables
2020-01-27 09:08:31 -03:00
Felipe Zimmerle
4f13fecbaf
cppcheck: make static analysis more pedantic
2020-01-22 09:16:10 -03:00
Felipe Zimmerle
86a5f471a9
Cosmetics: fixed static analysis issues.
2020-01-15 20:35:59 -03:00
Felipe Zimmerle
47dd9c5df4
Refactoring on the VariableValue class
2019-06-14 10:13:54 -03:00
Felipe Zimmerle
5472362313
Fix SecRuleUpdateTargetByTag with regular expressions
2019-05-31 01:42:47 -03:00
Julien Leproust
49900eec97
Fix variables output in debug logs
2019-05-27 17:39:04 -03:00
Felipe Zimmerle
4e76c6adf0
Renames namespace Variables to variables
2019-03-06 15:53:20 -03:00
Felipe Zimmerle
ef7f65db90
Changes debuglogs schema to avoid unecessary str allocation
2018-10-23 17:00:16 -03:00
Felipe Zimmerle
8bda7c0a45
Fix RULE lookup in chained rules.
2018-10-23 16:37:54 -03:00
Felipe Zimmerle
3e8e28da48
Refactoring on the RULE variable
2018-10-23 16:26:11 -03:00
Felipe Zimmerle
554251bade
Refactoring on the Rule class
2018-10-23 16:26:10 -03:00
Felipe Zimmerle
74841779f8
Adds partial support to UpdateActionById
2018-10-23 16:26:10 -03:00
Felipe Zimmerle
bc3d3f1915
Adds support to setenv action
...
Issue #1044
2018-09-25 10:19:52 -03:00
Felipe Zimmerle
98b9ae659d
Having a better organization for Variables::
2018-09-24 16:39:48 -03:00
Felipe Zimmerle
ee50fea266
Handling key exceptions on the variable itself
...
This is the first step towords to solve #1697
2018-09-24 16:16:30 -03:00
Felipe Zimmerle
892beb5360
Refactoring on {global,ip,resources,session,tx,user} collections
...
Now using the same name schema and interface for these "special"
collection.
Fix : #1754 , #1778
2018-05-29 23:48:05 -03:00
Felipe Zimmerle
ac100785d1
Fix compilation issue while xml is disabled
2018-02-21 16:15:05 -03:00
Felipe Zimmerle
eeec7efb68
Renames collection::Variable to VariableValue
2018-02-20 13:40:01 -03:00
Felipe Zimmerle
de7c5c89bb
Using shared var for variables names
2018-02-20 13:40:01 -03:00
Felipe Zimmerle
6f7fdd9493
Using direct variable access instead m_collections
2018-02-20 13:40:01 -03:00
Felipe Zimmerle
f17af95728
Using RunTimeString on setvar action
2018-02-20 13:40:01 -03:00
Felipe Zimmerle
2d892a3176
Adds support for multipart vars on the parser
2018-02-20 13:40:00 -03:00
Felipe Zimmerle
3fb71f32d8
Coding style fixes
2017-11-13 22:32:11 -03:00
Felipe Zimmerle
23cf656f93
Adds support to WEBAPPID variable
2017-11-08 10:28:56 -03:00
Felipe Zimmerle
082a3e3287
Adds support to SecWebAppID
2017-11-08 09:33:14 -03:00
Felipe Zimmerle
a676f313c3
Initial support for Lua script engine
2017-11-05 23:30:50 -03:00