Skip to main content

Audit Subsystem

This document describes the audit event pipeline, SIEM export, and dashboard UI.

Source code:

  • core/audit/exporter.go — SIEM event schema and export factory
  • core/audit/buffer.go — Buffered async export with retry
  • core/audit/webhook.go — Webhook (HTTP POST) backend
  • core/audit/syslog.go — Syslog (RFC 5424) backend
  • core/audit/datadog.go — Datadog HTTP intake backend
  • core/audit/cloudwatch.go — AWS CloudWatch Logs backend
  • core/audit/nats.go — NATS-based audit event consumer
  • core/controlplane/gateway/gateway.go — HTTP request audit (AuditEvent)
  • core/controlplane/gateway/policybundles/audit.go — Policy bundle audit entries
  • dashboard/src/pages/AuditLogPage.tsx — Audit log dashboard page
  • dashboard/src/components/audit/ — Audit UI components

1. Overview

Cordum emits structured audit events for security-relevant actions: safety decisions, approvals, policy changes, violations, and authentication events. Events are written to Redis and optionally exported to external SIEM systems via one of four configurable backends.

2. Event Types

The audit subsystem defines these event types (from core/audit/exporter.go):

ConstantValueDescription
EventSafetyDecisionsafety.decisionSafety kernel allow/deny/throttle decisions
EventSafetyApprovalsafety.approvalHuman approval or rejection of gated jobs
EventPolicyChangesafety.policy_changePolicy configuration changes
EventSafetyViolationsafety.violationSafety policy violations
EventSystemAuthsystem.authAuthentication events (login, key creation, user management)

Severity levels: CRITICAL, HIGH, MEDIUM, LOW, INFO.

3. SIEM Event Schema

Each exported event uses the SIEMEvent struct:

FieldTypeDescription
timestamptime.TimeEvent timestamp
event_typestringOne of the event type constants above
severitystringSeverity level
tenant_idstringTenant that triggered the event
agent_idstringAgent involved (if applicable)
job_idstringJob involved (if applicable)
actionstringSpecific action taken
decisionstringSafety decision (allow/deny/require_approval/throttle)
matched_rulestringPolicy rule that matched
reasonstringHuman-readable reason
risk_tags[]stringRisk tags from the job request
capabilities[]stringCapabilities from the job request
policy_versionstringActive policy version
identitystringActor identity
extramap[string]stringAdditional context

4. HTTP Request Audit

The gateway logs every HTTP request as an AuditEvent (defined in gateway.go) capturing method, route, status, duration, tenant, principal, role, and auth source. This is separate from the SIEM export pipeline.

5. Action-Level Audit

The gateway records fine-grained audit entries via appendAuditEntryNamed for:

  • Job approvals and rejections (including failure reasons)
  • User creation, update, deletion, password changes
  • API key creation and revocation
  • Workflow run cancellations
  • Policy bundle operations

6. Query API

  • GET /api/v1/policy/audit — List policy audit entries

7. SIEM Export Configuration

Env VarDescription
CORDUM_AUDIT_EXPORT_TYPEExport backend: webhook, syslog, datadog, cloudwatch, or none
CORDUM_AUDIT_BUFFER_SIZEAsync buffer size for export batching
CORDUM_AUDIT_EXPORT_MAX_RETRIESMax retry attempts for failed exports

Webhook

Env VarDescription
CORDUM_AUDIT_EXPORT_WEBHOOK_URLHTTP POST endpoint for audit events
CORDUM_AUDIT_EXPORT_WEBHOOK_SECRETHMAC signing secret for webhook payloads

Syslog (RFC 5424)

Env VarDescription
CORDUM_AUDIT_EXPORT_SYSLOG_ADDRSyslog server address (e.g., tcp://host:514)

Datadog

Env VarDescription
CORDUM_AUDIT_EXPORT_DD_API_KEYDatadog API key
CORDUM_AUDIT_EXPORT_DD_SITEDatadog site (default: datadoghq.com)
CORDUM_AUDIT_EXPORT_DD_TAGSComma-separated tags (e.g., env:prod,team:platform)

AWS CloudWatch Logs

Env VarDescription
CORDUM_AUDIT_EXPORT_CW_LOG_GROUPCloudWatch log group name
CORDUM_AUDIT_EXPORT_CW_LOG_STREAMCloudWatch log stream name

8. Dashboard UI

The audit log page (/audit) provides:

  • AuditFiltersBar — Filter by event type, severity, tenant, time range
  • AuditTimeline — Chronological event visualization
  • AuditEventCard — Individual event summary cards
  • AuditDetailPanel / AuditEntryDetail — Expanded event details
  • AuditIntegrityPanel — Cryptographic integrity verification
  • AuditExport — Export filtered results
  • AuditTransportBadge — Transport type indicator
  • SavedFiltersDropdown — Reusable filter presets

See Also