A Web Application Firewall (WAF) alert does not confirm that an attacker compromised a website. Security teams must trace the flagged activity through firewall, web server and application logs to establish whether an attempted exploit reached its target and caused unauthorised activity.
This distinction matters when investigating SQL injection, remote code execution and malicious file upload attempts. A firewall may detect an attack without allowing it through, while an allowed connection could require further examination.
The following workflow shows how administrators can investigate these events using a WAF and an Nginx-powered server.
1. Examine the firewall detection
Start with the original security event and collect its essential details:
- Timestamp of the activity.
- Source IP address.
- Target URL and HTTP method.
- Matched security rule and rule ID.
- Relevant parameters and payload.
- Enforcement action, such as BLOCK, ALLOW or LOG.
For example, an illustrative WAF event might look like this:
json { "timestamp": "2026-11-20T08:30:00Z", "client_ip": "203.0.113.25", "method": "GET", "uri": "/products?id=1", "rule_id": "942100", "action": "BLOCK" }The BLOCK action indicates that the firewall denied the matching traffic. However, investigators should examine related events to establish whether other attempts reached the origin server.
An ALLOW action means the traffic was permitted by the relevant security policy. It does not establish that the payload successfully exploited the target.
2. Trace activity through Nginx
Next, examine the web server records for evidence of the same action.
On many Linux installations, Nginx stores access records at:
bash /var/log/nginx/access.logThe configured location may differ depending on the installation and server configuration.
Search for the affected endpoint:
bash grep 'products?id=1' /var/log/nginx/access.logYou can also search for the recorded client address:
bash grep '203.0.113.25' /var/log/nginx/access.logCompare timestamps, URLs, HTTP methods and available request identifiers with the original firewall event.
One important consideration: when a reverse proxy sits between the WAF and origin server, Nginx may record the proxy’s IP rather than the original visitor’s address. Check trusted proxy headers and your logging configuration before drawing conclusions.
Inspect the corresponding error records as well:
bash grep 'products' /var/log/nginx/error.logThese can reveal upstream failures, application communication problems and other processing errors.
These can reveal upstream failures, application communication problems and other processing errors.
3. Identify evidence of successful exploitation
A matching server entry does not prove that an attack worked. Investigators must establish what happened after the traffic reached the application.
For suspected SQL injection, examine database audit records and application activity for unexpected queries, unauthorised data retrieval or modifications.
For malicious file uploads, inspect upload directories for unfamiliar files and compare their modification times with the incident timeline.
For suspected remote code execution, investigate unexpected processes, command execution records and unusual outbound network connections.
Administrators can identify recently modified website files using:
bash find /var/www/html -type f -mmin -60 -lsThis lists files modified within the previous 60 minutes. Legitimate deployments and updates can also produce these results, so investigate each finding before classifying it as malicious.
4. Respond to confirmed compromises
Classify the investigation as blocked, unsuccessful, successful or inconclusive based on the available evidence.
If exploitation is confirmed, preserve relevant records, isolate affected systems where appropriate and investigate the extent of unauthorised activity.
If the evidence is inconclusive, retain the findings and continue investigating rather than automatically dismissing the alert.
Finally, review the relevant WAF rules and application controls to identify gaps that could allow similar attacks in the future.
The objective is to establish what happened beyond the initial detection and ensure that any confirmed compromise receives an appropriate response.



