893 Commits

Author SHA1 Message Date
Felipe Zimmerle
ec61749a68 Changes JSON parser to not accept parcial contents
Also cleanup installer file.
2014-03-31 16:22:10 -07:00
Felipe Zimmerle
966e7e1ff1 Adds verification before access the strcmp
Audit log was making the assumption that "arg->origin" was filled which
is not necessary true. This commit adds an verification.
2014-03-31 16:22:09 -07:00
Felipe Zimmerle
c5c2690809 Adds origin to the paramenters that cames from JSON
That is necessary otherwise the Auditlog will try to access it generating
a segfault.
2014-03-31 16:22:09 -07:00
Felipe Zimmerle
a95f37196e Adds JSON support on ISS port
The JSON parse is already supported in Nginx and Apache
versions. This patch adds support on the IIS port.
2014-03-31 16:22:09 -07:00
Felipe Zimmerle
0787b45481 Adds support to JSON parser in the nginx module
Building with --enable-standalone-module was failing due
the lack of the reference to the msc_json.c file inside the
standalone/Makefile.am. This patch also place the dependency
of the yajl to the nginx module config script.
2014-03-31 16:22:09 -07:00
Felipe Zimmerle
09ced44ffa Supports the yajl version 2
Initially the code was made to support the yajl version 1. The
version 2 is now the default option in most of Linux distributions.
2014-03-31 16:22:09 -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
410aca9d78 Optimization on the status engine call
The status string was too long. By removing meaningless stuff, such as: runtime
version of Lua, we have reduced the length of the status string. Limitations
were also placed regarding the size of the ModSecurity version. Big queries may
lead to failure, due to restrictions of "gethostbyname". There is also a bit of
code cosmetics in this patch: big functions were broken into smaller.
2014-03-31 16:22:05 -07:00
Felipe "Zimmerle" Costa
20014c808c Adds modsecStatusEngineCall to standalone API
In ModSecurityIIS the configuration is loaded upon the first request
is received. In other words, SecStatusEngine value can be only
loaded once the first request hit the server, and so, the status
function was moved to proceed just after the configuration got loaded.
This update is IIS only.
2014-03-31 07:14:55 -07:00
Felipe Zimmerle
a6d93441c1 Places StatusEngine to be Off by default
StatusEngine is now marked as Off by default. This patch also adds the
SecStatusEngine directive to our recommend configuration file.
2014-03-31 07:14:55 -07:00
Felipe Zimmerle
e131e2222d Adds support to status engine on IIS version
Fixes on the windows versions: build, mac address and machine name retrieval
2014-03-31 07:14:55 -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
0c6a661c69 First version of the status engine implementation
The Status Engine allow the measurements of how many ModSecurity
instances are running around the world, as long as information
on how many times it had been restarted and so on. Everytime that
the server is started it perform a DNS query that is redirected
to our servers, that query constains information about the
ModSecurity version and it dependencies versions. It also sends a
unique indetification generate locally for the server, avoiding
counting the same server twice while generating the statistics.
This id is a sha-1 hash of the machine name + mac address of the
first network adapter. In this commit it is enabled by default,
in the release will be a configuration option to disable this
functionality. It also important to cite that the information
gather by this query will be also available in ModSecurity website
public open via a JSON stateless API. There will be an fancy
heatmap as well.
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
Greg Chow
5b0c933cf3 Fixes UTF8 to Unicode conversion bug in 4-byte encodings 2014-03-31 07:14:55 -07:00
Ewald Dieterich
7e459827e0 Log why writing to audit log failed
Add error description from apr_strerror() to message that is logged if
writing to audit log failed.
2014-03-31 07:14:55 -07:00
Ewald Dieterich
607dfd229a Fix segmentation fault if writing to audit log fails
A segmentation fault occurs if concurrent audit log format is enabled
(SecAuditLogType Concurrent) and writing to the log fails.
2014-03-31 07:14:55 -07:00
David Andrews
27dd513ab6 Flip allocations that happen during initialization (typically) over to use non-global apr memory pools. 2014-03-03 08:00:53 -08:00
Felipe Zimmerle
31d7fc6d38 Code cosmetics: Place copy_rules in nice shape.
Continuation of kukackajiri's work to provide fixes for errors pointed by
Parfait. The function copy_rules had an integer as return code but it was not
filed proper neither checked by its callers. This commit just adds sanity
checks and documentation for the copy_rules function. Marking were placed
on the copy_rules callers, but the return code is not handled yet.
For kukackajiri's work, see merge request: #612
2014-03-03 04:27:29 -08:00
Jiri Kukacka
62a6f228f8 Fixes for Parfait errors - mostly unhandled NULL pointer dereference and data type mismatch 2014-02-28 17:05:41 -08:00
Justin Gerace
498b9b2e7a Don't reject a large request with ProcessPartial set 2014-02-28 12:36:48 -08:00
Felipe Zimmerle
063dd640e5 Adds internal error messages while parsing the configutarion
Before this patch, if something went wrong while loading the configuration in
memory, not in terms of syntax but other run time factors such as memory
allocation, the webserver will refuse to start and no further message was given
to the user. This patch adds "Internal Error messages" that are intend to let
the user know more information about the problem that he/she is facing.
2014-02-24 03:56:17 -08:00
Felipe Zimmerle
795d6a64d2 nginx: Warn about not workable 'proxy'
Proxy is not yet ready for nginx. Instead of give a generic error, this patch
adds a clean message explains that such functionality is not available on the
nginx port. This patch also modifies the test cases to reflect this changes.
2014-01-09 11:12:28 -08:00
Felipe Zimmerle
7ac515ee29 nginx: Adds proper support to SecServerSignature
SecServerSignature was leading nginx to crash. It was trying to write over a
memory area that it was not allowed to. In order to fix that a new function was
created on the standalone api. This function is called
modsecIsServerSignatureAvailale. Whenever it returns data it means that the
function SecServerSignature was used by the user. Nginx module was also patched
to support this new function.
2014-01-08 18:06:32 -08:00
Chase Venters
0ddd2b4639 Add mod_extract_forwarded.c to run before mod_security2.c
mod_extract_forwarded2.c is already present in this list, but there is a
(seemingly better) alternative for Apache 2.2 which is distributed in
Fedora EPEL that is called mod_extract_forwarded.c.
2013-12-18 18:05:03 -08:00
Nick Galbreath
74ec784005 libinjection sync 2013-12-18 04:19:02 +00: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
Felipe Zimmerle
2f5af6af73 Merge tag 'refs/tags/v2.7.7' 2013-12-18 14:56:22 -08:00
Felipe Zimmerle
c473aabb4a Changes release version to 2.7.7
Release version is now 2.7.7.
2013-12-18 03:46:36 -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
Felipe Zimmerle
1cde4d2dd9 Organizes all Makefile.am
Now using one file per line (sorted). This is the better way
to handle it, since it reduces the possibility of merge conflicts.
2013-12-13 09:44:51 -08:00
Felipe \"Zimmerle\" Costa
5046c8327e iis: Cosmetics fixies on sqli.
This is needed to get it compiled with VS2011 on Windows8
2013-12-12 14:53:49 -08:00
Felipe \\\"Zimmerle\\\" Costa
a4202146b8 iis: Fix inet_pton build problem
There is a function named inet_pton on windows API, with different
signature. This patch just override the windows function and point
the inet_pton to our implementation.
2013-11-07 17:15:52 -02:00
Felipe Zimmerle
b0c3977845 Merge pull request #578 from client9/remotes/trunk
libinjection sync to v3.8.0
2013-10-18 05:14:17 -07:00
Nick Galbreath
a5f175d79f libinjection sync 2013-10-18 14:18:55 +09:00
Felipe Zimmerle
88ebf8a0bd Merge pull request #152 from client9/remotes/trunk
Merge pull request #152 from client9/remotes/trunk

Sync to libinjection v3.7.1
2013-10-14 07:11:39 -07:00
Nick Galbreath
fcb6dc13ed libinjection sync 2013-10-12 22:04:16 +09:00
Nick Galbreath
f52242a013 libinjection sync 2013-10-12 21:51:26 +09:00
Breno Silva
9a630eea23 Merge pull request #141 from client9/remotes/trunk
libinjection sync to v3.6.0
2013-09-16 10:06:25 -07:00
Nick Galbreath
11217207e8 libinjection sync 2013-09-12 11:47:12 +09:00
Breno Silva
f8d441cd25 Fix Chunked string case sensitive issue - CVE-2013-5705 2013-09-04 08:57:07 -03:00
Breno Silva
3901128f17 Revert "Fix Chuncked string case sensitive issue"
This reverts commit 16a815a3c2735f62238ef99af26090a2b8430d3d.
2013-09-04 08:53:40 -03:00
Breno Silva
16a815a3c2 Fix Chuncked string case sensitive issue 2013-09-04 08:43:34 -03:00
Nick Galbreath
2268626c20 libinjection sync 2013-08-25 15:30:19 +09:00
Breno Silva
7e0a9ecf7d Fix logical disjunction and conjunction issues 2013-08-12 18:43:56 -03:00
Breno Silva
464ac1ecac Fix crash when use SessionID as paramenter in SecHashKey 2013-07-17 08:51:31 -07:00
Breno Silva
50f9d01406 Merge pull request #130 from client9/remotes/trunk
libinjection sync v3.4.1
2013-07-17 20:33:45 -07:00
Nick Galbreath
cefddebe13 libinjection sync 2013-07-14 14:33:34 +09:00
Breno Silva
3f080fa8ce Merge pull request #128 from client9/remotes/trunk
libinjection v3.3.0 sync
2013-07-13 12:26:20 -07:00