Context
A request receives an unexpected response, and the access log suggests ModSecurity participated. Before discussing rule changes, the team needs the correct transaction evidence. An audit log is a structured record with selected sections; it is not guaranteed to contain every request or every part of a request.
Identify the ModSecurity major version, web-server connector, ruleset and logging destination. This guide focuses on evidence collection rather than rule exceptions. Use a harmless synthetic request and restrict log access. Request headers, cookies and bodies can contain credentials or customer data, so collecting every section is not automatically a useful diagnostic choice.
Locate one transaction
- Reproduce an approved synthetic request with a unique marker and record timestamp, hostname, path and response status. Correlate it with the web-server access/error log and the connector's transaction identifier where available. Request time alone can be ambiguous on busy hosts, and a proxy may replace or introduce its own correlation ID.
- Inspect effective audit configuration for the deployed version.
SecAuditEnginecontrols audit selection, while status-based relevance and rule behavior can affect which transactions qualify. Confirm whether logging is serial, concurrent or routed through another collector in this environment. A file path from a tutorial may not be the destination used by the installed connector. - Review
SecAuditLogPartsand the version's documented format. Determine which sections contain headers, bodies, rule messages and completion information. Missing request-body content may be intentional or depend on request-body processing. Do not enable complete bodies simply because a transaction is hard to find; first establish whether metadata and matched-rule evidence are sufficient. - Follow the selected record to its final destination. For concurrent or forwarded logging, an index entry and a transaction record can have different paths or processing stages. Check writer permissions, storage health and collector freshness. Preserve the original restricted record and share only a sanitized extract with reviewers.
An illustrative missing audit record
In an illustrative application gateway, an operator expects every successful request to appear in audit storage. The deployed audit engine records only relevant transactions, and the harmless test did not meet that selection. Switching the entire site to full body logging would create unnecessary sensitive data. The team first verifies selection behavior with a controlled relevant test and appropriate logging metadata.
| Observation | Evidence to check | Meaning |
|---|---|---|
| Access entry, no audit transaction | Audit mode and relevance | Selection may be intentional |
| Index entry, missing record | Concurrent storage or forwarding path | Delivery or retention issue |
| Transaction lacks body section | Configured parts and processing | Collection policy differs |
| Record found, ID mismatch | Connector and proxy correlation | Wrong transaction association |
Correct and verify evidence collection
Repair a demonstrated destination, permission or selection configuration through the owning team. Preserve the prior logging policy and avoid changing enforcement and audit collection simultaneously. These changes answer different questions and make results harder to attribute when combined.
Verify one expected recorded transaction and one expected non-recorded transaction using synthetic data. Confirm that the required rule messages and completion marker are available and that sensitive fields are handled according to the logging policy. Check rotation and collector ingestion too; finding a local record once does not establish ongoing evidence availability.
Maintain an audit-evidence SOP
Document version, connector, transaction-ID mapping, audit selection, recorded sections and retention owner. Monitor audit write failures and destination freshness. Include sanitized extraction instructions in the support procedure. Clouvenix server hardening can help make request evidence useful without broadening data collection unnecessarily.
Technical reference
ModSecurity audit configuration and version 2 audit formats. Confirm equivalent behavior for other engine versions.