owasp-modsecurity / owasp-modsecurity/ModSecurity
Timezone is not included in the time_stamp field of audit log in JSON format
@martinhsv is already working on this.
Since Jun 17, 2020.
- Dominant language
- C++
- Stars
- 9.8k
- Forks
- 1.8k
- Avg merge
- 2h 46m
- Merged PRs (30d)
- 1
Description
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
- Configure
SecAuditLogFormattoJSON - Make sure 'A' section is enabled in
SecAuditLogFormatparameter. Ex.:SecAuditLogParts ABJFHZ - Restart nginx to apply new settings
- Perform any request to the web server that would get a new record put into audit log
- Check the audit log, specifically
time_stampfield in the latest record
Expected behavior
- Either timezone is specified in
time_stampfield whenSecAuditLogFormatis set toJSON - Or
time_stampalways contains UTC time and not local time - Or there's an option to set up
time_stampformat 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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.