mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 11:16:33 +03:00
Adds support for the server log integration
This commit is contained in:
@@ -159,7 +159,7 @@ class ModSecurityStringVariables :
|
||||
/** @ingroup ModSecurity_CPP_API */
|
||||
class Assay {
|
||||
public:
|
||||
Assay(ModSecurity *assay, Rules *rules);
|
||||
Assay(ModSecurity *assay, Rules *rules, void *logCbData);
|
||||
~Assay();
|
||||
|
||||
/** TODO: Should be an structure that fits an IP address */
|
||||
@@ -292,6 +292,7 @@ class Assay {
|
||||
std::ostringstream m_requestBody;
|
||||
std::ostringstream m_responseBody;
|
||||
ModSecurityCollectionsVariables m_variables_collections;
|
||||
void *m_logCbData;
|
||||
};
|
||||
|
||||
|
||||
@@ -302,7 +303,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/** @ingroup ModSecurity_C_API */
|
||||
Assay *msc_new_assay(ModSecurity *ms, Rules *rules);
|
||||
Assay *msc_new_assay(ModSecurity *ms, Rules *rules, void *logCbData);
|
||||
|
||||
/** @ingroup ModSecurity_C_API */
|
||||
int msc_process_connection(Assay *assay, const char *client, int cPort,
|
||||
|
@@ -120,6 +120,8 @@ typedef struct ModSecurity_t ModSecurity;
|
||||
#define MODSECURITY_VERSION_NUM MODSECURITY_MAJOR \
|
||||
MODSECURITY_MINOR MODSECURITY_PATCHLEVEL MODSECURITY_TAG_NUM
|
||||
|
||||
typedef void (*LogCb) (void *, const char *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
namespace ModSecurity {
|
||||
|
||||
@@ -140,6 +142,8 @@ class ModSecurity {
|
||||
|
||||
static std::string whoAmI();
|
||||
void setConnectorInformation(std::string connector);
|
||||
void setServerLogCb(LogCb cb);
|
||||
void serverLog(void *data, const std::string& msg);
|
||||
const std::string& getConnectorInformation();
|
||||
|
||||
/**
|
||||
@@ -220,6 +224,7 @@ class ModSecurity {
|
||||
|
||||
private:
|
||||
std::string m_connector;
|
||||
LogCb m_logCb;
|
||||
};
|
||||
|
||||
|
||||
@@ -236,6 +241,8 @@ const char *msc_who_am_i(ModSecurity *msc);
|
||||
/** @ingroup ModSecurity_C_API */
|
||||
void msc_set_connector_info(ModSecurity *msc, const char *connector);
|
||||
/** @ingroup ModSecurity_C_API */
|
||||
void msc_set_log_cb(ModSecurity *msc, LogCb cb);
|
||||
/** @ingroup ModSecurity_C_API */
|
||||
void msc_cleanup(ModSecurity *msc);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
Reference in New Issue
Block a user