This guide documents the audit command in the Kubiya CLI, which allows you to view, monitor, and export audit logs for your Kubiya environment.
Overview
The audit command provides visibility into activities performed within your Kubiya environment. It allows you to track and monitor events for security, troubleshooting, and compliance purposes.
Available Commands
List Audit Logs
View recent audit logs with filtering options:
# View recent audit logs
kubiya audit list
# Limit the number of logs shown
kubiya audit list --limit 20
# Filter by category
kubiya audit list --category-type teammate --category-name "DevOps-Assistant"
# Filter by resource type
kubiya audit list --resource-type tool
# Filter by action type
kubiya audit list --action-type execution
# Filter by session ID
kubiya audit list --session-id "sess_1234567890"
# Format output as JSON
kubiya audit list --output json
Stream Audit Logs in Real-time
Monitor audit logs as they occur:
# Stream audit logs in real-time
kubiya audit stream
# Filter stream by category
kubiya audit stream --category-type teammate --category-name "DevOps-Assistant"
# Filter stream by resource type
kubiya audit stream --resource-type tool
Export Audit Logs
Export audit logs for compliance reporting or analysis:
# Export logs to a file
kubiya audit export --output audit-logs.json
# Export logs in CSV format
kubiya audit export --format csv --output audit-logs.csv
# Export with filters
kubiya audit export --category-type teammate --output teammate-logs.json
Describe an Audit Event
View detailed information about a specific audit event:
# Describe a specific audit event by ID
kubiya audit describe EVENT_ID
The audit command provides essential visibility into your Kubiya environment, helping you monitor activity, troubleshoot issues, and maintain compliance records.