131 Commits

Author SHA1 Message Date
Felipe Zimmerle
112ba45e7a
Makes global mutex for collections optional 2017-05-21 08:53:11 -03:00
Mladen Turk
84d2f30cc8
Use global mutex instead sdbm file lock to fix issues with threaded mpm's 2017-05-19 17:16:08 -03:00
Robert Paprocki
5bc75ec871 Do not compile in JSON logging support if yajl is not found 2016-01-29 11:59:52 -03:00
Robert Paprocki
7a39b4b5b9 Make JSON audit logging a configurable option
Remove compile-time setting for generating audit logs
as JSON, creating a new config option (SecAuditLogFormat).
sec_audit_logger is now a wrapper for sec_audit_logger_json
or sec_audit_logger_native. This has the disadvantage of
making the audit log generation code harder to maintain,
but the logger function itself now is no longer pepper
with binary branches.
2016-01-29 11:59:52 -03:00
Justin Gerace
3f9e2ccc7c Stop buffering when the request is larger than SecRequestBodyLimit and in ProcessPartial mode 2016-01-25 10:37:40 -03:00
Felipe Zimmerle
a235b536a4 Fix apr_crypto.h include in modsecurity.h and msc_remote_rules.c
apr_crypto is not always available, configure scripts are looking for
it and setting WITH_APU_CRYPTO in case it is found. There were two
places where apr_crypto.h was included without validating if
WITH_APU_CRYPTO was set. This patch removes the inclusion from the
first place (it seems not to be mandatory) and add the check for
WITH_APU_CRYPTO in the second one. This fix issue #834.
2015-02-11 08:15:30 -08:00
Felipe Zimmerle
ce4cf24f6e Refactoring external resources download warn messages
Holding the message to be displayed when Apache is ready to write on the
error_log instead of the default output. Regression tests were added.
2014-12-11 12:42:49 -08:00
Felipe Zimmerle
23823bb2c3 Makes Curl no longer a mandatory depedency for ModSecurity core
As reported by Rainer Jung, Curl may not be mandatory to build
	ModSecurity core. This patch make it optional by:
	- Concentrate all downloads using curl on msc_remote_rules.c
	- Split Curl build definitions checks into: WITH_CURL, WITH_REMOTE_RULES
	and WITH_CRYPTO.
	  - WITH_CURL: Contains Culr headers and binaries during the build time.
	  - WITH_REMOTE_RULES: Currently enabled if Curl is present.
	  - WITH_CRYPTO: Set if apr tool was compiled with crypto support.
	- Renames msc_remote_grab_content to msc_remote_download_content
2014-12-03 08:28:59 -08:00
Felipe Zimmerle
9fe72b72de Improves the CA validation
On IIS CA validation was not working as libcurl on windows does not look for a
certificate store, unless it is specified. The resource downloads are now
respecting the SecRemoteRulesFailAction.
2014-11-17 19:32:32 -08:00
Felipe Zimmerle
c54bb746c6 Adds SecRemoteRules as an build option
SecRemoteRules adds a new dependency to libcurl. Before only mlogc was
depending on libcurl. SecRemoteRules also depends on the apr-tools with
crypto support, which (as reported by our buildbots) is not default in
some environments such as: MacOS X. This commit disable SecRemoteRules
support if apr-tools was not compiled with crypto support.
2014-11-14 11:53:40 -08:00
Felipe Zimmerle
38b9924705 Adds the SecRemoteRulesFailAction directive
This directive allows the user to set a default action whenever the
SecRemoteRules failed to download a set of rules. Current the supported
values are: Warn and Abort. By default `Abort' is selected.
2014-11-14 11:53:40 -08:00
Felipe Zimmerle
9b836b652a Initial support to load rules from a remote server
New directive `SecRemoteRules' was added. It allows the user to load a
set of rules from a given HTTP server.
2014-11-14 11:53:40 -08:00
Felipe Zimmerle
59a1746be7 Using real server signature on status call
On Apache platform the server signature can be replaced using the
SecServerSignature directive. Status call was using the signature informed by
this directive instead of using the original one. As reported at #702.
2014-11-14 11:53:39 -08:00
Felipe Zimmerle
a15f8813e9 Honor the SecRuleEngine while filtering connections
The SecRuleEngine has the capability to Enable, Disable or even to place the
ModSecurity in DetectionOnly mode. The SecReadStateLimit and SecWriteStateLimit
were not honoring such state, due the fact that our configuration belongs to
requests not to connections, the only struct that exists while those filters
are placed. By adding a global variable "conn_limits_filter_state" we are now
able to identify the current state of the ModSecurity, once the configuration
is loaded this variable is set and used by the connections filters.
2014-03-31 16:22:10 -07:00
Felipe Zimmerle
0037a0732a Using RadixTree instead of list to storage IPs
Used by the operator @ipMatch and variants, this structure storage all the IPs
addresses for later comparison. Last version was using RadixTree only if the
set of IPs was specified from files. IPs specified as parameters, was using
a chained list. Chained lists may affect the performance, since lookups in
worst case will be O(n). RadixTrees could provide better results depending
on the amount of elements and its contents.
2014-03-31 16:22:10 -07:00
Felipe Zimmerle
b9fdc4fe3b Adds support to suspicious and whitelist to Read and Write limits
The operators @ipMatch, @ipMatchF and @ipMatchFromFile were
added to the functions: SecReadStateLimit and SecReadStateLimit,
by using them it is possible to declare a suspicious list. When
a suspicious list is given, the {Read|Write}StateLimit will be
applied just to the IPs that belongs to that restricted list.
Note that the negative of those operators (e.g. !@ipMatch) can be
used to place a whitelist. The {Read|Write}StateLimit
restrictions will not be applied to those in the whitelist.
This current version the Sec{Read|Write}StateLimit can be used
varios times to add elements to both lists, however, the
last informed limit will be applied for the entire group. This
feature is experimental, and suggestions on how to improve it
are very welcome. For further discussion use the issue: #353.
2014-03-31 16:22:10 -07:00
Felipe Zimmerle
8d4c3e4f5c Makes the build system to look for yajl using a macro file
Now searching for yajl using find_yajl.m4 macro file instead
of using pkg-config directly. If YAJL was not found or if it
was disabled in the configure phase, the code will be compiled
without JSON support.
2014-03-31 16:22:09 -07:00
Ulisses Albuquerque
c23097ce18 Added support for JSON body processor 2014-03-31 16:22:09 -07:00
Felipe Zimmerle
f86a71f7a7 Adds SecStatusEngine On/Off switch
Add the possibility to turn the Status Engine On or Off using the
directive SecStatusEngine [On/Off]. By default it is On.
2014-03-31 07:14:55 -07:00
Felipe Zimmerle
d93ce9ceee Adds REQUEST_FULL and REQUEST_FULL_LENGTH variables
This variable is a combination from REQUEST_LINE, REQUEST_HEADERS and
REQUEST_BODY (if any). Expects for \n\n in between each of those values.
2014-03-31 07:14:55 -07:00
Felipe Zimmerle
227de9fb8a Reverts commit b1cbccdc6b18a0f3a4edda8a5dfa9f6621485e81
This belongs to a specific branch as long as it is not stable yet.
2013-12-18 15:05:01 -08:00
ivanr
b1cbccdc6b Added new directive (SecPdfProtectMethod) to enable the user to choose between using token redirection (falling back on forced download in some cases) and forced download (in all cases). 2013-12-17 07:14:25 -08:00
Breno Silva
cd31b39ce1 Removed SecDefineRemoteAddr and fixed Apache 2.4 mod_remoteip integration 2013-05-06 00:49:07 -04:00
Breno Silva
29ed5c4dc7 Added: SDBM_DELETE_ERROR variable 2013-05-02 08:04:26 -04:00
Breno Silva
6cd3a14db1 MODSEC-362 2013-04-22 13:36:13 -04:00
Breno Silva
aa18ec7f45 Updated copyright dates 2013-04-19 03:20:46 -04:00
Breno Silva
d4d80b38aa Added SecXmlExternalEntity 2013-03-04 16:54:20 -04:00
Breno Silva
4db1f51f39 Added MULTIPART_NAME and MULTIPART_FILENAME variables 2013-03-04 11:54:13 -04:00
Breno Silva
9725e71f06 ModSecurity: improving duplicate ID search 2013-01-31 10:22:37 -04:00
Breno Silva
eabc39ad83 Added SecCookieV0Separator 2013-01-26 18:45:34 -04:00
Breno Silva
53d422e9de Change names of HMAC feature to HASH 2012-10-30 18:02:22 -04:00
brenosilva
7355100712 MODSEC-297 2012-10-08 15:04:22 +00:00
brenosilva
5c5107a860 MODSEC-297 2012-10-08 13:55:11 +00:00
brenosilva
0d2307192c MODSEC-336 2012-10-05 18:03:58 +00:00
brenosilva
919e3f5e29 Reverted SecCookiev0Separator 2012-10-03 17:33:37 +00:00
brenosilva
aee22ea461 MODSEC-261 2012-10-03 13:49:00 +00:00
brenosilva
592ec392d1 Remove ctl:ruleUpdateTarget* and add ctl:ruleRemovetarget* 2012-08-02 18:04:53 +00:00
brenosilva
3bb931e188 Fix warnings 2012-06-17 13:32:07 +00:00
brenosilva
866cb6d6b4 Update trunk for 2.7 2012-05-10 23:18:39 +00:00
brenosilva
d4079971c6 MODSEC-160 2011-10-14 13:32:30 +00:00
brenosilva
6c89afcf7d MODSEC-211 2011-07-11 21:09:28 +00:00
brenosilva
ad168c801d Only reinject stream if data is changed by rsub 2011-06-15 14:38:42 +00:00
brenosilva
06dd5907b6 Build and code fixes 2011-06-14 15:01:17 +00:00
brenosilva
f595919107 Implement unicode map 2011-06-02 19:11:04 +00:00
brenosilva
5eaa1a7345 Added SecWriteStateLimit for slow post DoS 2011-05-05 17:01:57 +00:00
brenosilva
0cc30904b9 Fix issue in input stream 2011-04-28 16:32:41 +00:00
brenosilva
6b7edc4d47 Fixes, code cleanups, improvements 2011-04-27 15:58:22 +00:00
brenosilva
104f0de46e New License 2011-03-30 14:12:44 +00:00
brenosilva
1a2d377e34 MODSEC-178 2011-03-28 18:47:58 +00:00
brenosilva
49732256f6 Improvements, fixes and new features 2011-03-25 13:51:13 +00:00