eComscan and Sansec Shield both write their findings to local files. A log shipper on the server reads those files and sends each new line to your SIEM. This page describes both output formats. Your security team uses them to build the integration for your SIEM.
Example setups:
eComscan output
Run eComscan from cron with --format=jsonline and append the output to a log file. Each line is a JSON object for one detection:
{"name":"eicar_test_file_33958","class":"malware","source":"file:/var/www/magento2/pub/eicar.php","description":"","snippet":"X5O!P%@AP[4\\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*","confidence":100,"path":"/var/www/magento2/pub/eicar.php","moreinfo":"","timestamp":"2026-11-17T03:00:12.408092603Z","meta":{"file_ctime":"2026-11-17T02:58:40Z","file_mtime":"2026-11-17T02:58:40Z"}}
The fields are described in the integration guide. class is malware or vulnerability. timestamp is the time of the scan in UTC. The file times of the detected file are in meta. The line does not include a hostname, so the log shipper adds it.
Create /var/log/ecomscan, then add this cron entry to run a nightly scan as root:
0 3 * * * ECOMSCAN_KEY=<key> /usr/local/bin/ecomscan --newonly --format=jsonline /var/www/magento2 >> /var/log/ecomscan/detections.jsonl
With --newonly, eComscan compares the scan with the previous run. If nothing changed, it writes nothing. If a detection was added or fixed, it writes every current detection, so your SIEM gets the open detections again on each change. Leave out --newonly to get the full list after every scan. You need a paid eComscan license to use --format.
The log file keeps growing, so rotate it with logrotate, for example in /etc/logrotate.d/ecomscan:
/var/log/ecomscan/detections.jsonl {
weekly
rotate 4
compress
missingok
notifempty
}
Use jsonline for a SIEM. The --format=json output is one multi-line document per scan and also contains your license key.
Shield output
Shield logs every blocked request to var/log/sansec_shield.log in your Magento root. The file uses the Magento log format: a timestamp, the log level, a message and a JSON context. A blocked request on Magento 2.4.4 or later:
[2026-11-17T10:00:00.123456+00:00] main.INFO: Blocked request {"uri":"/?SANSEC-SHIELD-TEST","rule":{"Sansec\\Shield\\Model\\Rule":{"action":"block","conditions":[{"target":"req.uri","type":"contains","value":"SANSEC-SHIELD-TEST"}]}},"ips":["203.0.113.7"]} []
The context has the request URI, the matching rule conditions and the client IPs from REMOTE_ADDR and proxy headers. It does not have the HTTP method, user agent or a rule name. Requests that match a report-only rule are not logged locally. They are only sent to your Shield dashboard.
The same file also has rule synchronization messages (Finished synchronization of 120 rules.) and errors, which you can filter on the message field.
CrowdStrike Falcon Next-Gen SIEM
This section shows an example setup, based on the CrowdStrike documentation. Your security team decides how to implement it in your Falcon tenant: connector names, parser fields, field normalization and correlation rules depend on how you use Next-Gen SIEM. Sansec does not support the Falcon side of the setup.
In the example, the Falcon LogScale Collector on each Magento server reads both log files and sends new lines to two HEC / HTTP Event data connectors, one per product. Each connector has its own parser.
Example parsers
sansec-ecomscan:
parseJson()
| parseTimestamp(field=timestamp)
| sansec.product := "ecomscan"
sansec-shield:
/^\[(?<ts>[^\]]+)\] (?<channel>[\w.]+)\.(?<level>[A-Z]+): (?<message>.+?) (?<context>\{.*\}|\[\]) \[\]$/
| parseTimestamp(field=ts)
| case {
context = "{*" | parseJson(field=context, prefix="shield.");
*
}
| sansec.product := "shield"
The Shield parser expects the timestamp format of Magento 2.4.4 and later (Monolog 2 and later). Older versions write [2026-11-17 10:00:00] without a timezone, which this parser does not read.
Use the sample lines from the sections above as parser test data.
Example collector configuration
Each data connector has an API URL and an API key. In the collector's config.yaml, each file source sends to the sink of its connector:
sources:
ecomscan:
type: file
include: /var/log/ecomscan/detections.jsonl
sink: ngsiem-ecomscan
shield:
type: file
include: /var/www/magento2/var/log/sansec_shield.log
sink: ngsiem-shield
sinks:
ngsiem-ecomscan:
type: hec
url: https://<id>.ingest.<region>.crowdstrike.com
token: <eComscan connector API key>
ngsiem-shield:
type: hec
url: https://<id>.ingest.<region>.crowdstrike.com
token: <Shield connector API key>
The collector service needs read access to both files. Magento creates var/log/sansec_shield.log as the web server user. The collector adds @collect.host (the server name) and @collect.file to every event.
Test events
Put the EICAR test string in a PHP file under your Magento root and run the eComscan cron command by hand. Open a store URL with ?SANSEC-SHIELD-TEST appended. Shield returns "permission denied" and logs the request.
Example searches for these events, with the fields from the example parsers:
sansec.product = "ecomscan" class = "malware"
| groupBy([@collect.host, name, path])
sansec.product = "shield" message = "Blocked request"
| groupBy([@collect.host, shield.uri])
Because --newonly writes all open detections after each change, the eComscan search groups by host, name and path to count each detection once.
Need help?
For questions about the eComscan or Shield output, mail info@sansec.io. Let us know if you want an example for another SIEM.
In this article
Protect your store now!
Block all known Magento attacks, while you schedule the latest critical patch until a convenient moment. No more downtime and instability from rushed patching.
Get Sansec Shield