1542 Commits

Author SHA1 Message Date
Felipe Zimmerle
899ee0c365 Adds support to load remote resources to pmFromFile and ipMatchFromFile
Initially those directives were only able to load content from a
local file. This commit extends this functionality allowing the user to
provide an HTTP URI that can be downloaded and loaded by ModSecurity.
Initially the download is associated with a server restart. For next
versions we expect to load such resources as it become outdated (Without
need to resetart the server).
2014-11-14 11:53:40 -08:00
Felipe Zimmerle
81bde0842d Adds curl support to main core
Curl was used only by mlogc, as we want to expand ModSecurity to load
external rules/resources it is now a dependency of the core as well.
2014-11-14 11:53:40 -08:00
Felipe Zimmerle
f45c6fe874 Build: fix the build script that looks for yajl
The script was looking for the wrong header file. Instead of look for
yajl_parse.h it was looking for yajl.h. Originally reported by
@rpfilomeno at #804.
2014-11-14 11:53:39 -08:00
Felipe Zimmerle
288fedfd22 Adds real_server_signature symbol to msc_test
Missing symbol was leading the tests to fail
2014-11-14 11:53:39 -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
8305600d50 Trims long `apache version' in the status call
As reported at #714 status calls with long `apache version' name was broken.
DNS queries cannot be so long. This field is now limited to 25 characters
which is a valid size when encoded into base32
2014-11-14 11:53:39 -08:00
Felipe Zimmerle
cee205b109 Adds Status test case with the SecServerSignature being used
If SecServerSignature is used ModSecurity should send the real data, not the
one informed to SecServerSignature.
Originally reported by: Linas
2014-11-14 11:53:39 -08:00
Felipe Zimmerle
2615a5dfc8 mlogc: Checks if curl supports CURL_SSLVERSION_TLSv1_2 before use it
Seems like curl versions older than 7.34.0 does not have support for
`CURL_SSLVERSION_TLSv1_2'. In this cases, using CURL_SSLVERSION_TLSv1
which was added at version 7.9.2. ModSecurity demands a curl version
newer than 7.15.1.
2014-11-14 11:53:39 -08:00
Felipe Zimmerle
54bf71f8bd mlogc: Changes the default SSL algo to TLS 1.2
As reported by Josh Amishav-Zlatin, mlogc was making usage of SSLv3 instead of
TLS 1.2. Servers should not answer SSLv3 after poodle.
2014-11-14 11:53:39 -08:00
Daniel J. Luke
d554b94d1e Include apr-util's LDFLAGS
Using apr-util installed by Macports results in build failure because apr-util uses BerkeleyDB that MacPorts installs into a subdir of $prefix/lib and $prefix/include (so that multiple versions of BerkeleyDB can be installed simultaneously). apu-1-config's --ldflags output includes the -L/path/to/bdb that's needed.
2014-11-14 11:53:39 -08:00
Felipe Zimmerle
66bb840a5d Adds doxygen configuration files 2014-11-14 11:53:39 -08:00
Felipe Zimmerle
f2b45bfafa Automake: Using ../ instead of $(top_srcdir)
After enable `subdir-objects', the variable $(top_srcdir) was not being
resolved, a directory labeled "$(top_srcdir)" was created instead.
2014-11-14 11:53:39 -08:00
Felipe Zimmerle
11ede79bc5 Adds automake subdir-objects option
As of Automake 1.4, it starts to warning about the lack of utilization
of `subdir-objects' option, which will be default in the further
releases. Avoiding break stuff we are patching ModSecurity to support
such option when it still an option (Issue #760).
2014-11-14 11:53:39 -08:00
Felipe Zimmerle
c64a681c65 Temporarily disable a test that is leading nginx buildbot to fail. 2014-11-14 11:53:39 -08:00
Felipe Zimmerle
de1c028d12 Declares msre_var *rvar at the beggining of the function
Necessary to fix the build on Win8 VS 2011
2014-11-14 11:53:39 -08:00
Felipe Zimmerle
a45fe95ed5 FuzzyHash: if disable giving an run time error instead of config
FuzzyHash operator is optional and only installed if the headers for libfuzzy
was found in the system. Otherwise, the FuzzyHash operator is disable during
the compilation. After this commit, if some rules tries to use it, ModSecurity
will produce an runtime error not a config time error, allowing the web server
to procede normal with its operations.
2014-11-14 11:53:39 -08:00
Felipe Zimmerle
fa0c97ea7b Adds regression test to cover the @fuzzeHash operator
Added 30-fuzzyHash.t and the ssdeep hash files. Hash files was generated using
files from ModSecurity repository.
2014-11-14 11:53:39 -08:00
Felipe \"Zimmerle\" Costa
7affec82a8 iis: Adds ssdeep support 2014-11-14 11:53:39 -08:00
Felipe Zimmerle
96865a92d3 Adds fuzzyHash operator
The fuzzyHash operator can be used to match files. In conjuntcion
with FILES_TMP_CONTENT collection it can scan uploaded files and
try to match it with a pre caculated list of know malicious content,
more details on how it works can be found on ssdeep website:
http://ssdeep.sourceforge.net/
2014-11-14 11:53:39 -08:00
Felipe Zimmerle
873c628b1a Adds ssdeep support in our build system
ssdeep will be used with the @fuzzyHash operator which is under
development
2014-11-14 11:53:39 -08:00
Felipe Zimmerle
accb1820e0 Adds collection FILES_TMP_CONTENT
The collection is filled with a key-value set where value is the content of
the file which was uploaded. This collection can be used with all supported
operators, however SecUploadKeepFiles should be set to 'On' in order
to have this collection filled.
2014-11-14 11:52:56 -08:00
Mauro Faccenda
87df4827dc Print YAJL version on startup. Closing issue: #703 2014-09-30 10:40:03 -03:00
Felipe Zimmerle
79639b5e47 Accepts random port on FULL_REQUEST regression test
FULL_REQUEST regression test was failing over the buildbots due the
usage of non default ports. Now it is accepting any number.
2014-07-25 04:46:59 -07:00
Felipe Zimmerle
6b5e9b1270 Merge branch '0xbin-master' 2014-07-24 14:02:55 -07:00
Rishi Narang
ed52c5462b typo rectify
Typo - plataform -> platform
2014-07-22 02:52:07 +05:30
Felipe Zimmerle
046b553736 Fix ipMatch entry on ErrorLog and DebugLog
ipMatch message on error log was not correct, it was missing the matched
ip address. This commit adds the correct matched ip address.
(See issue #738)
2014-06-12 15:49:19 -07:00
Felipe Zimmerle
5d92e448ae Fixes subnets representations using slash notation
The ipv4 representation was only accepting slash notation with masks
represented in 2 digits. In the ipv6 implementation several fixies were made:
The maximum value to a bitmask was 64 which is not the reality, as ipv6 can
handle 128 bits. The second change was also to enable mask representation with
more and less than 2 digits. A more general fix was added to allow the unit
tests to work even if a invalid ip/range was informed during the creation of
the "tree", now it is checking if the tree is NULL while performing the
execution of the operator. Initial problem was reported at the issue: #706.
2014-06-11 09:31:53 -07:00
Felipe Zimmerle
731466cff0 Adds @ipMatch operator unit test.
As reported on issue #706 the @ipMatch operator is not working as expected
creating this test case to confirm the issue and to avoid that happens in
the future.
2014-06-11 09:31:53 -07:00
Felipe "Zimmerle" Costa
d4c2b96b89 IIS: Changes event ID (Issue #676)
ModSecurityIIS was reporting events to Windows using ID 0
which seems cause an unexpected verbose message at the
event logger window as reported on #676, changing the ID
to 0x1, although will be nice to have separated events for
misconfiguration, warnings, etc...
2014-05-23 09:35:00 -03:00
Felipe "Zimmerle" Costa
0f7cbced8c IIS: Cosmetics: Removes CLFR.
Converts mymodule.cpp from CLRF to Unix format as the rest
of the repository.
2014-05-23 09:30:19 -03:00
Felipe "Zimmerle" Costa
1d3c8349fa IIS: Adds a VS Custom build to speed up the dev process
Custom build stops the IIS Server before start the compilation.
After finish the compilation the ModSecurity.DLL is copied to the
inetsrv folder and the IIS is restarted.
2014-05-23 09:28:15 -03:00
Felipe "Zimmerle" Costa
3a7def63a3 IIS: Adds mlogc to ModSecurity solution 2014-05-22 18:34:29 -03:00
Felipe "Zimmerle" Costa
90c5a420da IIS: Cosmetics: Files are better grouped in VS
This commit places the files inside the correct filters
2014-05-22 10:22:18 -03:00
Felipe Zimmerle
c4a5a1e11a Version 2.8.0
* Updated change log.
* Removed -RC1 from the release version.
2014-04-14 10:12:03 -07:00
Felipe Zimmerle
50e4961dd4 Uses autotools to idenfiy if sys/utsname.h is present
Fix build problem on the msc_status_engine, reported by: Walter Hop and
Derek Werthmuller.
2014-04-14 07:55:21 -07:00
Felipe Zimmerle
33231378d7 Increases the package version on the configure.ac
Changed to 2.8
2014-04-11 05:32:19 -07:00
Felipe Zimmerle
480f6bac77 Merge pull request #692 from rcbarnett/master
Update CHANGES for Chunked Encoding CVE Credits
2014-04-03 09:40:51 -03:00
Ryan Barnett
62a76e1ed6 Update CHANGES 2014-04-03 08:36:42 -04:00
Felipe Zimmerle
ad5824c00c Fix type on the CHANGES file. 2014-04-01 03:11:01 -07:00
Felipe Zimmerle
0826380acd Version 2.8.0 2014-03-31 19:31:02 -07:00
Felipe Zimmerle
385a2828e8 Code cosmetics: Reduces the amounts of warning.
Removes the warnings by adding missing headers and removed unused variables.
2014-03-31 16:22:11 -07:00
Felipe Zimmerle
1e63e49db4 Uses %zu to print size_t instead of %d.
This will help to reduce the amount of warnings during the compilation
See #631 for further information.
2014-03-31 16:22:11 -07:00
Felipe Zimmerle
503e8f6c8e Updates the libinjection
Windows compilation was failing due to the utilization of size_t which is part
of the strings.h. strings.h was not part of windows and so the compilation
was failing. This update fix that. Issue #65 on libinjection:
https://github.com/client9/libinjection/issues/65
2014-03-31 16:22:11 -07:00
Felipe Zimmerle
66939d059b Adds initial support to @detectXSS
Libinject was recently updated to support XSS detection. This commit adds
initial support to it.
2014-03-31 16:22:11 -07:00
Felipe Zimmerle
47f5cf92db Removes forced chartset
Apperantly forcing the charset is not placing any benefits, instead it is
cousing problems as documented on #650. This still experimental, just
testing against our regression tests. Such feature was added by the commit:
177b5b9c989b0095e5c91b01d205df64e65e6c9e.
2014-03-31 16:22:11 -07:00
Felipe Zimmerle
efef989ddd Renames Sec{Read|Write}StateLimits
The Sec{Read|Write}StateLimits are filters related to the connections, when the
server did not know yet which vhost the request goes to. This means that once
those configrations are set it will be applied to entire server. This patch
just renames the Sec{Read|Write}StateLimits to SecConn{Read|Write}StateLimits
to make it more clear to the user. SecConnectionEngine was also renamed to
SecConnEngine.
2014-03-31 16:22:11 -07:00
Felipe Zimmerle
48d85c7d6e Places connection filter engine in a separated configuration
Different from the Rules or other options, the connections filters are applied
to entire server, not to a single vhost, or so. In order to keep it clear to
the user this patches adds "SecConnectionEngine" which works in the same way
that SecRuleEngine does.
2014-03-31 16:22:10 -07: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
80185e2a90 Bugfix: Missing ipv6 support check
The Function "ip_tree_from_file" was making a reference for
IPV6_TREE whitout checkingx if it was supported or not.
2014-03-31 16:22:10 -07:00