1881 Commits

Author SHA1 Message Date
Felipe Zimmerle
25666005ed Modifies the CHANGES file to cite issue #609 2015-03-26 09:53:04 -07:00
Jeff Trawick
1ed95ad932 Fix invalid storage reference by apr_psprintf() when creating a string from salt[]. salt[] is not '\0'-terminated, so apr_psprintf() needs to be told the extent of the bytes to read.
It is easy to test old/new code standalone with valgrind;
jst insert the getkey() function into this template:

-----------getkey() goes here-----------------

int main(void)
{
    apr_pool_t *p;

    apr_initialize();
    apr_pool_create(&p, NULL);

    printf("%s\n", getkey(p));
    return 0;
}
2015-03-26 08:55:54 -07:00
Felipe Zimmerle
a9a39255b9 Version 2.9.0
Increasing version to 2.9.0.
v2.9.0
2015-02-12 10:58:11 -08:00
Felipe Zimmerle
b304ab1aa2 Improves SecRemoteRules messages on IIS
IIS was not displaying correctly the error messages and the amount of
loaded rules while the operator SecRemoteRules was used.
2015-02-12 09:37:32 -08:00
Felipe Zimmerle
f7c7a30db9 Uses our own version of ap_find_command
Keep compatibility among different versions of Apache is not a simple
task, in this case it can be avoided by the creation of our own version
of ap_find_command, that is now used by msc_remote_rules.
2015-02-12 09:34:42 -08:00
Felipe Zimmerle
462308be74 Improves the accuracy of version identification on status calls
Trying to differentiate among IIS, Apache, NGINX, and Standalone builds.
2015-02-11 18:37:01 -08: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
Chaim Sanders
2e09b8e542 Fixed comment incorrect comment 2014-12-29 18:03:19 -05:00
Felipe Zimmerle
de74b131c6 Version 2.9.0-RC2
Increasing version to 2.9.0-RC2.
v2.9.0-rc2
2014-12-15 12:55:11 -08:00
Felipe Zimmerle
b1e4954a86 Closes a file handle that was left opened on fuzzy hash
Fuzzy hash implementation was lefting a file handle behind whenever the results
matched.
2014-12-12 04:34:21 -08:00
Felipe Zimmerle
f6d6cea015 IIS: Creates IIS_VERSION definition
This definition is currently used in two different circumstances: Report with
accuracy that the server is an IIS  (status call), and also show the amount of
loaded remote rules on the windows logs. Different from Apache which loads the
rules twice, IIS just do it once.
2014-12-11 14:47:59 -08:00
Felipe Zimmerle
6c0cdab35a IIS: Changes Curl version and removes OpenSSL dependency
As the this new Curl version supports well the Windows certificate storage,
removing the dependency on the OpenSSL. Also changing the build scripts to work
accordingly. As the cmake build of Curl is said to broken abandoning it in
favor of the nmake files. Thanks to Gregg Smith and Steffen.
2014-12-11 14:47:59 -08:00
Felipe Zimmerle
0d2d01ba2c Disables mlogc compilation with Curl was not found
This commit automatic disables Curl compilation if Curl development files were
not found on build machine.
2014-12-11 14:47:55 -08:00
Felipe Zimmerle
069122194e Reducing the amount of compilation warnings 2014-12-11 12:42:58 -08:00
Felipe Zimmerle
fa77c93589 Fix typo on fuzzy hash match message
Replaced "Socore" with Score.
2014-12-11 12:42:58 -08:00
Felipe Zimmerle
dc81e4f852 Informs problems and successfully loaded external resources during reload
Resources load mechanism as the SecRemoteRuels were not showing information
about the loaded rules while Apache was reloaded. This patch add such
information to reload in the same way that it was showing on restart.
2014-12-11 12:42:58 -08:00
Felipe Zimmerle
fe22446bdd Adds missing 'ModSecurity:' prefix to log messages
As reported by Walter Hop, the status call functionality was printing a message
in the console without the expected 'ModSecurity:' prefix. SecServerSignature
was also printing messages without the expected prefix. Both are fixed by this
commit.
2014-12-11 12:42:56 -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
d4a055e78e Checks HTTP code after performing a resource download
As reported by Walter Hop on our dev- mailing list, remote resource download
was not validating the HTTP code, parsing errors pages as resources. This
commit fix  this issue, from now one HTTP error codes will be verified and
treated as errors. Operators are now dealing well with empty values that may
be produced in consequence of a download error.
2014-12-11 12:39:31 -08:00
Felipe Zimmerle
87a401af05 Fix remote resources download while hosting SSL site on Apache
As reported by Christian Folin and Walter Hop on our dev mailing list, Apache
mod_ssl was failing if a remote resource was utilized. That was happening
because Curl clean up was also cleaning up the OpenSSL data used by mod_ssl.
This patch moves Curl initialization to happens while ModSecurity is
initialized.
2014-12-11 12:39:27 -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
94fd570e31 Fix parser segfault on parser while parsing downloaded content
The error message was using a null pointer which was leading ModSecurity
to segfault
2014-11-21 03:52:03 -08:00
Felipe Zimmerle
23f6f6e6e6 Version 2.9.0-RC1
Increasing version to 2.9.0-RC1.
v2.9.0-rc1
2014-11-17 19:34:55 -08:00
Felipe Zimmerle
b019f6056f fix typo
- Adds a missing "s" while informing the amount of remote loaded rules.
- Renames text file that was wrongly named as .py
2014-11-17 19:32:43 -08:00
Felipe Zimmerle
277f2e1e6f iis: adds openssl to the build scripts
openssl is necessary to have curl talking in https.
2014-11-17 19:32:43 -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
b02256cf1e IIS: temporary removes ssdeep support on IIS
It seems likes ssdeep compilation is facing problems linking on 64bits
platforms. Temporary disable to 2.9.0-RC1 release (IIS only).
2014-11-16 16:56:23 -08:00
Felipe Zimmerle
85c7ba0c7e IIS: Adds ssdeep/libfuzzy to msi installer
fuzzy.dll should be installed by the ModSecurityIIS installer.
2014-11-16 16:56:14 -08:00
Felipe Zimmerle
858d480ec9 iis: Copy yajl.dll into release files folder
This will help the automagically release process
2014-11-15 07:37:57 -08:00
Felipe Zimmerle
9f005c3ded mlgoc: Adds option to enable or disable the SSL checks
Added the configuration option `InsecureNoCheckCert' to the mlogc
configuration file. This option allow to establish connections ignoring
SSL checks.
2014-11-14 17:27:37 -08:00
Felipe Zimmerle
73d7955ac1 Fix the compatible IIS versions
At installer file the IIS 6 was considered supported, however, it is
not supported. Supported IIS versions are 7 and 8.
2014-11-14 13:45:49 -08:00
Felipe Zimmerle
eb61e891ae Build: New alternative to identify the presence of libfuzzy
Searching for the fuzzy.h instead of the .so file.
2014-11-14 11:53:40 -08:00
Felipe Zimmerle
723336f1fb Adds regression test for FILE_TMP_CONTENT 2014-11-14 11:53:40 -08:00
Felipe Zimmerle
86787f2af9 Adds SecRemoteRules regression tests.
Added two test cases for SecRemoteRules. Contents are loaded from
https://www.modsecurity.org
2014-11-14 11:53:40 -08:00
Felipe Zimmerle
b5398abaf2 Forces downloads using https-only for resources or rules
This commit makes ModSecurity to refuse to download or install rules
(SecRemoteRules) from sites that are not running HTTPS with a valid and
trusted certificate.
2014-11-14 11:53:40 -08:00
Felipe Zimmerle
59fc243503 Adds the `crypto' option to SecRemoteRules directive
Originally the SecRemoteRules fetch the rules from an remote server in an
specific format, using cryptography. This patch adds the possibility to
load rules in plain/text format.
2014-11-14 11:53:40 -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
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