From cb8d6249a8fd046c87cbe55fa97c8ac5959452b6 Mon Sep 17 00:00:00 2001 From: Felipe Zimmerle Date: Thu, 9 Jul 2015 15:53:05 -0300 Subject: [PATCH] Adds connector information to the audit logs --- headers/modsecurity/assay.h | 1 + src/assay.cc | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/headers/modsecurity/assay.h b/headers/modsecurity/assay.h index a71a0f58..6524482c 100644 --- a/headers/modsecurity/assay.h +++ b/headers/modsecurity/assay.h @@ -157,6 +157,7 @@ class Assay { std::string id; std::ofstream myfile; Rules *m_rules; + ModSecurity *m_ms; const char *m_clientIpAddress; const char *m_serverIpAddress; diff --git a/src/assay.cc b/src/assay.cc index e54132d5..cd9b469a 100644 --- a/src/assay.cc +++ b/src/assay.cc @@ -88,7 +88,8 @@ Assay::Assay(ModSecurity *ms, Rules *rules) save_in_auditlog(false), do_not_save_in_auditlog(false), m_timeStamp(std::time(NULL)), - http_code_returned(200) { + http_code_returned(200), + m_ms(ms) { id = std::to_string(this->m_timeStamp) + \ std::to_string(generate_assay_unique_id()); m_rules->incrementReferenceCount(); @@ -784,6 +785,9 @@ std::string Assay::to_json(int parts) { /* producer > libmodsecurity */ LOGFY_ADD("modsecurity", ModSecurity::whoAmI().c_str()); + /* producer > connector */ + LOGFY_ADD("connector", m_ms->getConnectorInformation().c_str()); + /* end: producer */ yajl_gen_map_close(g);