Skip to content

ModSec Audit logs in JSON format - not JSON? #3310

@paul-hammant

Description

@paul-hammant

Describe the bug

I'm running ModSec as a library for testing purposes (with GoTestWAF, but that's not important I don't think). It is printing JSON audit files (one per request) to the file system. Field time_stamp looks corrupted though as I gaze and the files with JSON that won't parse cos "time_stamp": "\u0014\u00108....\u0006" is choking subsequent parsers (like the one in browsers).

Source code question

In src/transaction.cc, should c_str() be called twice?

    std::string ts = utils::string::ascTime(&m_timeStamp).c_str();

    .. snip .. 

    LOGFY_ADD("time_stamp", ts.c_str());

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.xRelated to ModSecurity version 3.x

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions