File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 22v3.0.????? - ?
33---------------------------
44
5+ - Limits [request|response] body size while saving audit logs
6+ [Issue: #1519 - Lasse Karstensen/@lkarsten and Felipe Zimmerle/@zimmerle]
57 - Makes parallel logging to work when SELinux is enabled.
68 [Issue: #1562 - David Buckle/@met3or]
79 - Adds possibility to run the pm operator inside a mutex to avoid concurrent
Original file line number Diff line number Diff line change @@ -48,6 +48,16 @@ typedef struct Rules_t Rules;
4848#include " modsecurity/collection/collection.h"
4949#include " modsecurity/variable_origin.h"
5050
51+ #define LOGFY_ADD_N (a, b, c ) \
52+ yajl_gen_string (g, reinterpret_cast <const unsigned char *>(a), strlen(a)); \
53+ if (b == NULL ) { \
54+ yajl_gen_string (g, reinterpret_cast <const unsigned char *>(" " ), \
55+ strlen (" " )); \
56+ } else { \
57+ yajl_gen_string (g, reinterpret_cast <const unsigned char *>(b), \
58+ c); \
59+ }
60+
5161
5262#define LOGFY_ADD (a, b ) \
5363 yajl_gen_string (g, reinterpret_cast <const unsigned char *>(a), strlen(a)); \
Original file line number Diff line number Diff line change @@ -1549,8 +1549,7 @@ std::string Transaction::toJSON(int parts) {
15491549 LOGFY_ADD (" uri" , this ->m_uri );
15501550
15511551 if (parts & audit_log::AuditLog::CAuditLogPart) {
1552- // FIXME: check for the binary content size.
1553- LOGFY_ADD (" body" , this ->m_requestBody .str ().c_str ());
1552+ LOGFY_ADD_N (" body" , this ->m_requestBody .str ().c_str (), this ->m_requestBody .size ());
15541553 }
15551554
15561555 /* request headers */
@@ -1580,7 +1579,7 @@ std::string Transaction::toJSON(int parts) {
15801579 yajl_gen_map_open (g);
15811580
15821581 if (parts & audit_log::AuditLog::GAuditLogPart) {
1583- LOGFY_ADD (" body" , this ->m_responseBody .str ().c_str ());
1582+ LOGFY_ADD_N (" body" , this ->m_responseBody .str ().c_str (), this -> m_responseBody . size ());
15841583 }
15851584 LOGFY_ADD_NUM (" http_code" , m_httpCodeReturned);
15861585
You can’t perform that action at this time.
0 commit comments