Casvisor
Audit

Export and syslog

The audit trail lives in Casvisor's database. Two ways get it out: CSV files downloaded from the lists, and a live feed to a syslog server, from which a SIEM such as Splunk, Elastic, QRadar or ArcSight can take it.

CSV export

Sessions, Commands and Records (the operation log) each have an Export CSV button. It downloads every row that matches what the list shows, across all its pages: the current search and sort, and on Sessions the tab, Online or History. A file holds at most 100,000 rows.

ListColumns
SessionsID, Asset, Protocol, Mode, User, Client IP, Client IP location, User agent, Status, Start time, End time, Duration (s), Commands, Code, Message
CommandsTime, Command, Action, Rule, User, Asset, Client IP, Session
RecordsID, Name, Time, Organization, User, Client IP, User agent, Method, Request URI, Action, Language, Object, Response

The file is UTF-8 with a byte order mark, so Excel shows Chinese and other text correctly, and is named after the list and the time, such as commands-20261120-153000.csv. A cell that starts with =, +, - or @ gets a ' in front, so a spreadsheet does not run it as a formula.

Exporting is for administrators, and covers their own organization. Each export is itself written to the operation log, as export-sessions, export-commands or export-records, with the number of rows and the filter used.

The results of a database session are exported from the SQL console instead.

Syslog forwarding

Set syslogAddress and Casvisor sends three kinds of events to that syslog server as they happen:

EventSent whenType
Operation log entryAn entry is written to the operation log, including the session events such as SFTP transfersrecord
CommandA command or SQL statement is recorded, including blocked ones and those run by jobscommand
SessionA session connects, and when it endssession-start, session-end
syslogAddress = udp://10.0.0.5:514
syslogFormat = rfc5424

syslogAddress is udp://host:port or tcp://host:port; without a scheme it is UDP. Empty, the default, turns forwarding off. Over TCP each message ends with a newline. TLS is not supported; to send over an untrusted network, forward to a local relay such as rsyslog and let it encrypt. See Configuration.

RFC 5424 with a JSON body

syslogFormat = rfc5424, the default, sends RFC 5424 messages with the app name casvisor, the event type as the message ID and the event as JSON:

<110>1 2026-11-20T15:30:00.000+08:00 bastion casvisor 1234 command - {"type":"command","time":"2026-11-20T15:30:00+08:00","organization":"casvisor","user":"casvisor/alice","clientIp":"203.0.113.7","asset":"casvisor/web-01","session":"casvisor/2f1c...","command":"systemctl restart nginx","action":"","rule":""}
TypeFields
recordid, organization, user, clientIp, userAgent, method, requestUri, action, object, status, message
commandorganization, user, clientIp, asset, session, command, action, rule
session-startorganization, session, user, clientIp, userAgent, asset, protocol, mode, startTime
session-endthe same, and endTime, duration (seconds), commandCount, code, message

CEF

syslogFormat = cef sends ArcSight's Common Event Format behind a BSD-style syslog header, with the vendor Casbin and the product Casvisor:

<110>Nov 20 15:30:00 bastion CEF:0|Casbin|Casvisor|1.0|command|Command|3|rt=1795159800000 cs1=casvisor cs1Label=organization suser=casvisor/alice src=203.0.113.7 dhost=casvisor/web-01 cs2=casvisor/2f1c... cs2Label=session msg=systemctl restart nginx

The fields use the standard CEF keys where there is one (suser, src, dhost, act, msg, request, requestMethod, requestClientApplication, app, start, end, outcome, externalId), and cs1 to cs3 and cn1 to cn3 with a label for the rest, such as cs1Label=organization. Times in rt, start and end are in milliseconds.

Severity

All events use the facility log audit (13).

EventSyslog severityCEF severity
Most eventsInformational (6)3
A failed API call, a command that matched an Alert ruleNotice (5)5
A command stopped by a Block ruleWarning (4)8

When the server is down

Events wait in a queue of 10,000 in memory and are sent one by one. When the server cannot be reached, Casvisor reconnects, waiting up to 30 seconds between tries, and logs a warning at most once a minute. When the queue is full, new events are dropped, and the number dropped is logged every minute. A UDP message is tried at most twice. The events stay in Casvisor's database either way; the feed is a copy. A value longer than 2,000 bytes is cut.

Edit on GitHub

On this page