Skip to content

Timezone is not included in the time_stamp field of audit log in JSON format #2340

Open
@jatgh

Description

@jatgh

Description

Timezone is not included in the time_stamp field of audit log if SecAuditLogFormat is set to JSON

If SecAuditLogFormat is set to Native, the time and date are written to audit log like following:

---immbqR4e---A--
[16/Jun/2020:11:24:03 +0300]

Keeping all other setting the same, but setting SecAuditLogFormat to JSON, the time and date are written to audit log like following:

"time_stamp":"Tue Jun 16 11:24:03 2020"

Note that it's not UTC time, it's local time on the server.

Steps to reproduce the behavior

  1. Configure SecAuditLogFormat to JSON
  2. Make sure 'A' section is enabled in SecAuditLogFormat parameter. Ex.: SecAuditLogParts ABJFHZ
  3. Restart nginx to apply new settings
  4. Perform any request to the web server that would get a new record put into audit log
  5. Check the audit log, specifically time_stamp field in the latest record

Expected behavior

  • Either timezone is specified in time_stamp field when SecAuditLogFormat is set to JSON
  • Or time_stamp always contains UTC time and not local time
  • Or there's an option to set up time_stamp format in configuration file (which I couldn't find)

Rationale

Imagine modsecurity audit logs are shipped to ELK or other log management system from multiple servers, including those located in regions with with daylight saving time. Then there's no common way to correctly parse the time_stamp field given that different servers might be in different timezone and also timezone is not persistent for some of them.

Server

  • ModSecurity v3.0.4 with nginx-connector v1.0.1
  • WebServer: ngingx-1.18.0-1~bionic
  • OS: Ubuntu 18.04.4

Metadata

Metadata

Assignees

Labels

3.xRelated to ModSecurity version 3.xenhancementworkaround availableThe issue has either a temporary or permanent workaround available

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions