<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Audit plugin: forward audit records to syslog in real time (PR #10460)]]></title><description><![CDATA[<p dir="auto">Hi everyone,</p>
<p dir="auto">I opened a PR on the audit plugin and would love some feedback, and ideally a review from the XO team: <a href="https://github.com/vatesfr/xen-orchestra/pull/10460" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/vatesfr/xen-orchestra/pull/10460</a></p>
<p dir="auto">The need</p>
<p dir="auto">We need to send XO audit records to our central syslog server, like the rest of our infrastructure logs. Today the only way I found is to poll audit.getRecords from a cron job, which:</p>
<ul>
<li>adds a delay (up to the polling interval),</li>
<li>needs to track which records were already exported, otherwise records are duplicated or missed,</li>
<li>needs a long-lived token of a real admin user stored on the machine.</li>
</ul>
<p dir="auto">What the PR does</p>
<p dir="auto">It adds a logRecords option to the audit plugin, disabled by default. When it is enabled, each new audit record is also written to the xo-server logs as a single JSON line (namespace xo:xo-server-audit:records, level info):</p>
<p dir="auto">xo:xo-server-audit:records INFO {"data":{...},"event":"apiCall","previousId":"...","subject":{...},"time":...,"id":"..."}</p>
<p dir="auto">The records then follow the existing log pipeline in real time, either stdout → journald → rsyslog or the built-in [logs.transport.syslog], with no extra credentials.</p>
<ul>
<li>The record is logged after it has been stored, so the log line is exactly the stored record, including id and previousId.</li>
<li>Nothing changes when the option is disabled, and the hash chain is not affected.</li>
<li>I tested it on a from-sources install with rsyslog forwarding to a remote server.</li>
</ul>
<p dir="auto">Related: #10461 (already merged) fixed actions made from XO 5 (/v5) being recorded with 127.0.0.1 / ::1 as the user IP. With both changes, the forwarded records contain the real client IP.</p>
<p dir="auto">Questions</p>
<ul>
<li>Does this approach look acceptable to the XO team, or would you prefer something else (e.g. a dedicated syslog transport in the plugin)?</li>
<li>Is anyone else exporting audit logs to a SIEM/syslog, and would this fit your use case?</li>
</ul>
<p dir="auto">Thanks!</p>
]]></description><link>https://xcp-ng.org/forum/topic/12534/audit-plugin-forward-audit-records-to-syslog-in-real-time-pr-10460</link><generator>RSS for Node</generator><lastBuildDate>Thu, 15 Oct 2026 16:38:36 GMT</lastBuildDate><atom:link href="https://xcp-ng.org/forum/topic/12534.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 15 Oct 2026 14:58:05 GMT</pubDate><ttl>60</ttl></channel></rss>