Logging is crucial for monitoring and maintaining the xorlab Security Platform (XSP). This page explores the core concepts of logging, outlines the configuration process, and presents real-world examples to guide your setup.On this page you’ll find:
Based on the table below, navigate to the right directory
Container
Directory
Core
activeguard/core/
Mta
activeguard/mta/audit/
Backend
xcc/backend/
Auth
auth/auth/
Dana
/etc/xorlab/dana/default/ - Modify configurations via ssh
Open or create logback-audit.xml
Open either the existing logback-audit.xml configuration file or create a new file based on the instructions below.
Do not publish incomplete logging configuration files!Incomplete logging configurations can lead to critical issues that could disrupt the XSP platform.
Create a new file via the Expert Editor
Hover over the parent directory icon
Click on the 3 dots
Select New File
Name the file logback-audit.xml
Enter an XML declaration on the first line of logback-audit.xml
Enter the XML root element <included> and </included>
<?xml version="1.0" encoding="UTF-8"?><included> <!-- add <appender> elements on top --> <!-- add <logger> elements below --></included>
Configure the logger
Configure multiple logsYou can define various <appender> elements in logback-audit.xml to generate multiple logs in different locations. It’s best practice to group <logger> elements together, as they can be referenced by multiple appenders simultaneously.
Modify the <logger> element:
Set the event name: Use the name attribute to specify the log event.
Link to the appender: Choose any name to connect the logger to the appender.
<?xml version="1.0" encoding="UTF-8"?><included> <appender name="syslogAppender" class="com.xorlab.sgappliance.shared.logback.SyslogAppender"> <syslogHost>192.168.1.100</syslogHost> <port>514</port> <hostName>xorlabhostname</hostName> <protocol>UDP</protocol> <facility>LOCAL0</facility> <encoder> <pattern>%jsonMsg%n</pattern> </encoder> </appender> <!-- Log received and send SMTP events. Alternatively, you can name a single logger 'trace.mta'. --> <logger name="trace.mta.received"> <appender-ref ref="syslogAppender"/> </logger> <logger name="trace.mta.send"> <appender-ref ref="syslogAppender"/> </logger></included>
How to log all SMTP logsIf you want to log the complete SMTP log and not only the send and receive events, then replace the name of the first logger with trace.mta and remove the second logger completely.
If you want to correlate the SMPT queue ID from the two events above with the GGRID, you can additionally activate the following log event.
Event: trace.msg_delivered
Container: Core
File path: activeguard/core/logback-audit.xml
Appender: syslogAppender
Format: %jsonMsg%n
File Path: activeguard/core/logback-audit.xml
<?xml version="1.0" encoding="UTF-8"?><included> <appender name="syslogAppender" class="com.xorlab.sgappliance.shared.logback.SyslogAppender"> <syslogHost>192.168.1.100</syslogHost> <port>514</port> <hostName>xorlabhostname</hostName> <protocol>UDP</protocol> <facility>LOCAL0</facility> <encoder> <pattern>%coreJsonMsg%n</pattern> </encoder> </appender> <!-- Log the queue ID, which can be used to correlate with the trace.mta.send event --> <logger name="trace.msg_delivered"> <appender-ref ref="syslogAppender"/> </logger></included>
Log detailed email results per verdict
The following configuration ensures that a JSON message is sent each time a verdict is made on an email. This setup is particularly useful in scenarios where:
An email initially appears legitimate and is delivered to the user, but
A delayed or offline dynamic analysis later updates the verdict from benign to malicious.
In such cases, the configuration below would generate two separate JSON messages for the same email—one for each verdict, reflecting the change in status.
The following configuration will write one JSON message for every domain threat intelligence event into a local file and also logs the event over syslog:
Event: ti.domain
Container: Backend
File path: xcc/backend/logback-audit.xml
Appenders: syslogAppender, RollingFileAppender
Format: %jsonMsg%n
xorlab Security Platform (SaaS)Writing to local files is not supported by XSP (SaaS) and can only be used for on-premises XSP installations.
File Path: xcc/backend/logback-audit.xml
<?xml version="1.0" encoding="UTF-8"?><included> <!-- Write logs into a local file with a rollover policy --> <appender name="threatIntelFileAppender" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>${log_dir}/domain_ti_json.log</file> <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> <!-- roll over daily --> <fileNamePattern>${log_dir}/domain_ti_json_%d{yyyy-MM-dd}.%i.log.zip</fileNamePattern> <maxFileSize>100MB</maxFileSize> <!-- total (compressed) size of all parts --> <totalSizeCap>500MB</totalSizeCap> <!-- Number of roll overs to keep --> <maxHistory>60</maxHistory> </rollingPolicy> <encoder> <pattern>%jsonMsg%n</pattern> </encoder> </appender> <appender name="threatIntelSyslogAppender" class="com.xorlab.sgappliance.shared.logback.SyslogAppender"> <syslogHost>syslog.example.com</syslogHost> <port>514</port> <protocol>UDP</protocol> <facility>LOCAL0</facility> <encoder> <pattern>%jsonMsg%n</pattern> </encoder> </appender> <!-- Log all ti.domain events --> <logger additivity="false" level="debug" name="ti.domain"> <appender-ref ref="threatIntelFileAppender"/> <appender-ref ref="threatIntelSyslogAppender"/> </logger></included>
Send logs via email
The Email appender sends log events via email. This is particularly useful for critical alerts that require immediate attention. It’s configured to send emails when certain log events are triggered. In the example below, an email containing a summary of the analysis is sent to example@xorlab whenever someone reports an email.
<?xml version="1.0" encoding="UTF-8"?><included> <!-- TODO: update property.value with your xorlab url --> <property name="host.name" value="example.activeguard.ch"/> <appender name="smtpMailAppender" class="ch.qos.logback.classic.net.SMTPAppender"> <!-- TODO: update <to> attribute with the email address of the receiver--> <to>example@xorlab.com</to> <from>no-reply@${host.name}</from> <subject>Email reported via ${host.name}</subject> <layout class="ch.qos.logback.classic.PatternLayout"> <!-- feel free to fiddle around here --> <pattern>An email was reported\nDate: %d{yyyy-MM-dd HH:mm}\nLink https://${host.name}/messages/all/message/%X{gr.id} \nSoftware Version: %versionGitDescription\n%jsonMsg\n</pattern> </layout> <smtpHost>mta.activeguard.xor</smtpHost> <smtpPort>10026</smtpPort> <evaluator class="com.xorlab.sgappliance.shared.logback.evaluator.LevelEvaluator"/> </appender> <logger name="trace.msg_analysis.complete.reported"> <appender-ref ref="smtpMailAppender"/> </logger></included>
Assistant
Responses are generated using AI and may contain mistakes.