Sophos Firewall (XG)
UTMStack v12 collects Sophos Firewall (SFOS, formerly XG) logs through the UTMStack Forwarder, which the web interface calls the Collector. You enable the integration on a Collector, then add the Collector as a syslog server in the Sophos Firewall console. Nothing is installed on the firewall. For Sophos Central, see Sophos Central instead.
Connection details
| Setting | Value |
|---|---|
| Card on the Integrations page | Sophos Xg (category Firewall) |
| Data type | firewall-sophos-xg |
| Default ports on the Collector | 7008/UDP; 7008/TCP (also used for TLS) |
| Log format UTMStack reads | Sophos Firewall syslog records made of key=value pairs (device_name=… log_type=… log_component=…), in the legacy device format and the newer format |
| Parsing pipeline | sophos/sophos_xg_firewall.yaml. Filters in the card's drawer opens it. |
| Detection rules | 9. Rules in the card's drawer opens them. |
Before you begin
A Collector must be installed and online. If you do not have one, see UTMStack Forwarder. One Collector can serve all your integrations.
The firewall must reach the Collector host on the port you use. Open it on the Collector host and on any firewall in between.
You need the
integrations.writepermission to enable the integration from the web interface.
Step 1: Enable the integration on a Collector
- 1
- 2
Choose the Collector and protocol
Under Enable this integration remotely, select the Collector and the Protocol: UDP for normal syslog, or TLS if you will turn on secure log transmission in Sophos Firewall. Leave Port at the default it fills in.
- 3
Enable it
Click Enable integration. The panel then shows, for example,
Currently: enabled · udp · port 7008.
To do the same on the Collector host instead, run:
sudo /opt/utmstack-forwarder/utmstack_forwarder enable-integration firewall-sophos-xg udpThe command prints the port the Collector really listens on, for example Integration "firewall-sophos-xg" enabled on udp port 7008.
To use TLS, load a certificate on the Collector first. See UTMStack Forwarder.
Use a different port
For built-in integrations, the Collector always listens on the port saved on the Collector host. That is the default port unless you change it there. A different number typed in Port, or on the enable-integration command line, is not used. To use another port:
On the Collector host, change the saved port, for example:
sudo /opt/utmstack-forwarder/utmstack_forwarder change-port firewall-sophos-xg udp 7108Use
tcpinstead ofudpfor TLS.In the Sophos Xg card, type the same port in Port when you enable the integration. If it is already enabled, click Disable integration first, then enable it again with the new port. The panel shows the port you type there, not a value read from the Collector, so typing the same port keeps the two in step.
Use the new port in the syslog server entry in step 2.
Step 2: Add a syslog server in Sophos Firewall
- 1
Open the log settings
In the Sophos Firewall (SFOS) console, go to System > System services > Log settings.
- 2
Add the Collector
Add a Syslog Server with the address of the Collector host and port 7008. Turn on Secure log transmission only if you enabled the integration with TLS.
- 3
Choose the log types
Save the server, then, in the log settings table, select the log types you want to send to it (firewall, IPS, ATP, web and others) and click Apply.
The setup guide in UTMStack fills in your UTMStack server's address in this step. Keep it only if the Collector runs on the UTMStack server; otherwise use the address of the Collector host.
Recent Sophos Firewall versions also ask for a Format when you add a syslog server. The UTMStack pipeline reads the key=value records of both the legacy device format and the newer format, so you can keep the default. For the field labels of your version, see Sophos Firewall's help on adding a syslog server.
With Secure log transmission, the firewall must be able to trust the certificate loaded on the Collector.
Step 3: Check that logs arrive
- 1
Open the logs
In the Sophos Xg drawer, click View logs. Log Explorer opens with the
firewall-sophos-xgdata type for the last 24 hours. You can also open Log Explorer, keep the data setlogsand choosefirewall-sophos-xgas the data type. - 2
Check the parsed fields
Expand an event. Parsed events have standard fields such as
origin.ip,target.ip,target.portandaction, and Sophos fields underlog., such aslog.logtypeandlog.logcomponent. The event should have noerrors. - 3
Check the data source
Within about 20 minutes, the firewall appears on the Data Sources page under Direct, named after the address its logs come from.
To list the latest events and any processing errors, switch Log Explorer to SQL mode and run:
SELECT `@timestamp`, dataSource, errors, raw
FROM logs
WHERE dataType = 'firewall-sophos-xg'
AND `@timestamp` > now() - INTERVAL 1 HOUR
ORDER BY `@timestamp` DESC
LIMIT 20Troubleshooting
| Symptom | Likely cause | What to do |
|---|---|---|
| Nothing arrives | The Collector is offline, no log type is selected for the syslog server, or the firewall sends to the wrong address or port, or a firewall blocks the port. | Check that the Collector shows as online in the Collector list, that log types are selected for the server, and that the Collector host allows the port in. See Forwarder Troubleshooting. |
| Nothing arrives, and the Forwarder guide filled in the UTMStack server's address | The firewall sends to the UTMStack server, but the Collector runs on another host. | Use the Collector host's address in the syslog server entry. |
| Nothing arrives with secure log transmission | The integration is enabled with UDP, or the firewall does not trust the Collector's certificate. | Enable the integration with TLS, and use a certificate the firewall trusts. The Forwarder log /opt/utmstack-forwarder/logs/utmstack_forwarder.log shows TLS handshake failed when the handshake fails. |
| Long web or WAF messages are cut off | Over UDP, the Collector reads at most 2,048 bytes of each message. | Use secure log transmission with the integration enabled as TLS. |
| Sophos Firewall logs appear under another data type | The firewall sends to the port of a different integration. | Send to the port that the Sophos Firewall integration listens on. |
Stop collecting
In the Sophos Xg card, select the same Collector and click Disable integration, or run on the Collector host, with the protocol you enabled (udp or tls):
sudo /opt/utmstack-forwarder/utmstack_forwarder disable-integration firewall-sophos-xg udpThen remove the syslog server in the Sophos Firewall log settings.