Files
Pulse/docs/AUDIT_LOGGING.md
pulse-triage[bot] 3e5a8de2fd Align Webhooks, Audit, and TrueNAS Help docs with route auth contracts
Correct org-bound API token refusal, instance-admin boundaries, license tiers,
and missing registered routes across docs/WEBHOOKS.md, docs/AUDIT_LOGGING.md,
and docs/TRUENAS.md (and their frontend-modern/public/docs/ mirrors) to match
internal/api/router_routes_monitoring.go, router_routes_licensing.go,
router_routes_registration.go, platform_connection_shared.go,
security_setup_fix.go, and pkg/licensing/features.go, and add router-anchored
doc contract assertions in scripts/tests/test_admin_docs.py and
scripts/tests/test_truenas_docs.py.

Contract-Neutral: Documentation and router-anchored doc tests only; aligns shipped Help guides with existing runtime authorization, license tier, and route contracts without changing runtime behavior.
Change-source: pulse-maintainer
2026-11-29 04:34:47 +00:00

25 KiB

Audit Logging

Pulse's audit log records security-relevant events with tamper-evident signatures. Use it for compliance, incident investigation, and tracking who did what.

Requires: Pro, legacy Pro+, Cloud, MSP, or Enterprise/custom license with the audit_logging capability to query, export, and verify events via the API. Events are recorded on all plans, but the API endpoints are license-gated.

An active licence alone does not enable the audit UI/API on the public Community runtime (audit_logging is blocked with paid_runtime_required). If the panel says Pulse Pro runtime required, open Settings → System → Plans & Billing (/settings/pulse-intelligence/billing/plan, Plan tab) to switch in place on eligible systemd or Proxmox VE LXC installs (Switch this install to Pulse Pro) or get digest-pinned image commands on Docker (Switch this container to Pulse Pro), or follow Download Pulse Pro to the private runtime for your deployment (see Switching from Community to the Pulse Pro Runtime). Do not buy a second licence or reset the data directory to clear this gate.

For plan details, see PULSE_PRO.md. For API endpoints, see API Reference.


What Gets Logged

Pulse automatically captures the following events:

Event Type Description Example
login Successful and failed login attempts User admin logged in from 198.51.100.5
logout User logouts User admin logged out
password_change Password modifications Password changed (Docker/systemd)
csrf_failure Blocked cross-site request forgery attempts Invalid CSRF token
lockout_reset Account lockout resets Admin reset lockout for user bob
sso_oidc_login OIDC SSO login attempts (success/failure at each stage) OIDC login success
sso_oidc_login_initiated OIDC SSO sign-in redirects started OIDC login initiated
oidc_token_refresh OIDC token refresh success/failure (global, not tenant-scoped) Token refreshed successfully
sso_oidc_role_assignment Automatic role assignment from OIDC groups Auto-assigned roles: operator, viewer
saml_login SAML SSO login attempts SAML login success via provider-id
saml_login_initiated SAML SSO sign-in requests started SAML login initiated
saml_logout SAML logout and SLO initiation Initiating SAML SLO
saml_slo_callback SAML single-logout callback validation and completion SAML SLO complete
saml_role_assignment Automatic role assignment from SAML groups Auto-assigned roles: admin
sso_provider_created SSO provider configuration created Created provider: Authentik
sso_provider_updated SSO provider configuration modified Updated provider: Authentik
sso_provider_deleted SSO provider configuration removed Deleted provider: Authentik
sso_provider_test SSO provider connectivity and metadata tests Tested provider configuration
token_created API and relay token creation attempts, including scope-escalation denials Created API token id=...
token_updated API token scope updates and boundary denials Updated API token id=...
token_renamed API token renames and blank-name rejections Renamed API token id=...
token_rotated API token rotations Rotated API token old_id=... new_id=...
token_deleted API token revocations and denials Deleted API token id=...
collector_authority_reduced Collector token narrowed to its monitoring scope allowlist Reduced collector credential to its exact monitoring scope allowlist
action_runner_credential_issued Host-bound typed action-runner credential issued Issued host-bound typed action runner credential
action_runner_credential_activated Host-bound typed action-runner credential activated Activated host-bound typed action runner credential
action_runner_credential_activation_cancelled Pending host-bound typed action-runner credential cancelled Cancelled pending host-bound typed action runner credential
action_runner_credential_revoked Host-bound typed action-runner credential revoked Revoked host-bound typed action runner credential
ai_settings_updated AI configuration changes AI settings updated
ai_command_approved Manual approval of a gated AI command Approved AI command
ai_command_denied Denial of a gated AI command Denied AI command
patrol_objective_created Patrol objective created Created Patrol objective
patrol_objective_updated Patrol objective modified Updated Patrol objective
patrol_objective_deleted Patrol objective removed Deleted Patrol objective
agent_profile_assigned Agent profile assignments Profile production assigned to agent
agent_profile_unassigned Agent profile removals Profile removed from agent
role_created Custom RBAC role created Created role ops-viewer
role_create_failed Custom RBAC role creation failed Failed to create role ops-viewer
role_updated Custom RBAC role updated Updated role ops-viewer
role_update_failed Custom RBAC role update failed Failed to update role ops-viewer
role_deleted Custom RBAC role deleted Deleted role ops-viewer
role_delete_failed Custom RBAC role deletion failed Failed to delete role ops-viewer
user_roles_updated RBAC role assignments changed Updated roles for user jane: [operator]
user_roles_update_failed RBAC role assignment update failed Failed to update roles for user jane
user_roles_self_modify_denied Blocked attempt to modify own RBAC roles Attempted to modify own role assignments
user_deprovisioned User removed and active sessions revoked Removed user jane and revoked active sessions
user_deprovision_failed Sessions revoked but user removal failed Revoked sessions but failed to remove user jane
user_deprovision_self_denied Blocked attempt to deprovision own identity Attempted to deprovision own identity
config_exported Configuration backup export attempts Configuration exported
config_imported Configuration backup imports, including tenant-limit refusals and reload failures Configuration imported
config_auto_import Startup auto-import attempts from PULSE_INIT_CONFIG_* (global, not tenant-scoped) source=file
node_added Monitoring connection created Added PVE node pve1
node_updated Monitoring connection modified Updated PVE node pve1
node_deleted Monitoring connection removed Deleted PVE node pve1
websocket_multitenant_access_denied Blocked WebSocket connection for a disabled or unlicensed non-default organisation (global, not tenant-scoped) org_id=team-a reason=unlicensed
websocket_org_access_denied Blocked WebSocket connection for an unauthorised organisation (global, not tenant-scoped) org_id=team-a
audit_cleanup Retention cleanup recorded by system when expired audit rows are deleted Deleted 42 events older than 90 days
agent_config_fetch Every failed agent configuration fetch. A successful fetch is normally recorded on the agent's first delivery after Pulse starts, when its token or delivered configuration changes, and otherwise once a day; unchanged minute polls are suppressed while the agent is remembered (see below) agent_id=… token_id=… config=sha256:… reason=config_changed

Config-fetch suppression remembers up to 4,096 organisation/agent pairs per Pulse process. New agents can replace entries last recorded at least 24 hours ago; a forgotten agent's next successful fetch is recorded again. If all slots are recent, additional agents' successful fetches are recorded on every poll with reason=capacity until a slot expires. This keeps memory bounded without hiding access events or displacing recent agents' suppression. It does not limit enrolment or configuration delivery, and every failed fetch is still recorded. No existing audit rows are removed by this tracker.

Each event includes:

  • Timestamp (UTC)
  • Event type
  • User who triggered the event
  • Client IP address
  • Request path
  • Success/failure flag
  • Details (human-readable description)
  • Cryptographic signature (tamper detection)

Text fields are stored with a size limit: 64 bytes for the event type and the client IP, 512 bytes for the user and the request path, and 1,024 bytes for the details. Longer text is cut to fit and ends in ...[truncated]. The signature covers the text as stored. Events recorded before this limit existed are kept as they are.


Viewing Audit Events

UI

Settings → Security → Audit Log (/settings/security-audit)

The audit log panel shows paginated events in reverse chronological order with filtering by User (Filter by user...), Event (All events, Login, Logout, Config change, Startup), Outcome (All, Success only, Failed only), and Verification (All verification, Needs verification, Verified, Check failed or error, which filters the currently loaded page only). For date-range filters (startTime/endTime) or other event types such as sso_oidc_login or agent_config_fetch, use the API below. Configure SIEM forwarding separately under Settings → Security → Audit Webhooks (/settings/security-webhooks).

API

Use an instance-wide (non-org-bound) API token with audit:read, or a signed-in instance administrator browser session with permission to read audit_logs, together with the licensed audit_logging capability. Every /api/audit* endpoint enforces instance-administrator authority and refuses API tokens bound to a non-default organization with HTTP 403 (Admin privileges required), even when they carry audit:read. Prepare the private header file in API authentication and never paste the token or a session cookie into a command. For a one-off read, you can instead open the API path in your signed-in Pulse administrator browser.

Define the pulse_api helper from API authentication in the same Bash session, using your audit:read header file. It is local example code, not an installed Pulse command. The helper requires curl 7.76 or later and makes one request with five-second connection and twenty-second whole request limits. On the Pulse host it uses loopback; for remote access, follow that guide's HTTPS-origin and certificate verification instructions.

Each call prints only the HTTP status and a new private response file's location, including on HTTP failure. Open the file locally, not in a shared terminal or recording: events, summaries and errors can contain usernames, client addresses, paths and other identifying details. Keep whole responses and the header file private; share only a relevant manually redacted excerpt.

Run only the read relevant to your investigation:

# List a small page of recent events
pulse_api GET '/api/audit?limit=50'

# Filter by event type and date range
pulse_api GET '/api/audit?limit=50&event=login&startTime=2026-01-01T00:00:00Z&endTime=2026-01-31T23:59:59Z&success=false'

# Get audit summary
pulse_api GET /api/audit/summary

Unified action and export audit trails use the same audit:read instance-admin and audit_logging gates:

  • GET /api/audit/actions: lists unified governed-action audit records (optional resourceId, since, and limit query filters).
  • GET /api/audit/actions/{id}/events: lists lifecycle events for one governed action ID ([a-zA-Z0-9_-], up to 64 characters).
  • GET /api/audit/exports: lists unified export audit records (optional since and limit query filters).

HTTP 401, 402, 403, other errors and redirects are not an empty audit history. The helper does not follow redirects or retry. A transport failure can leave a partial file, not a complete result; preserve the status and original evidence rather than looping, resetting the store or changing a licence to make it pass.

Query Parameters

Parameter Type Description
limit positive integer List page size (default: 100, capped at 1,000)
offset non-negative integer List page offset (default: 0)
event string Filter by event type (e.g., login, password_change)
user string Filter by username
success boolean Filter by success (true) or failure (false)
startTime RFC3339 Start of date range, with timezone
endTime RFC3339 End of date range, strictly after startTime

These parameters describe the event list, not every audit endpoint. Its response contains an events page and total matching events. Fewer rows than total do not establish missing history. Keep the same filters when reading another page. New events can shift offsets, so a sequence of pages is not a consistent archival snapshot. Malformed query encoding returns HTTP 400 (invalid_query), duplicate query parameters (event, user, startTime, endTime, success, limit, offset, format, verify) return HTTP 400 (ambiguous_query), and malformed list filters return HTTP 400 rather than an empty result. When SQLite storage stays locked after internal retries (25 ms and 75 ms), GET /api/audit returns HTTP 503 (audit_store_busy) with Retry-After: 2. When persistent audit storage is unavailable or unreadable, GET /api/audit returns HTTP 503 (audit_store_unavailable). URL-encode query values and do not put private usernames or other identifiers into a shared command or report.


Exporting Audit Data

Use the same helper to save an export privately. For an investigation, prefer the relevant event type and known time range over an unfiltered whole-history export; replace the example dates with your incident's UTC bounds:

pulse_api GET '/api/audit/export?event=login&startTime=2026-01-01T00:00:00Z&endTime=2026-01-31T23:59:59Z'

The new owner-only response file is created in the helper's private directory. It does not reuse filters selected in the UI. Export accepts event, user, success, startTime, endTime, format (json by default, or csv), and verify=true, but not list pagination: adding limit or offset does not bound an export. The response includes the X-Event-Count header and downloads as audit-log-<timestamp>.json or audit-log-<timestamp>.csv. JSON is the lossless evidence export. CSV is a spreadsheet projection that prefixes text fields starting with leading formula or control characters (=, +, -, @, their full-width equivalents, tab, carriage return, or newline) with a single leading ' so spreadsheet applications treat them as literal text. When verify=true is supplied, Pulse verifies each signed event against its original stored bytes before rendering and includes signature_valid in JSON or the Signature Valid column in CSV. With no filters it requests the full available history, subject to the selection limit below. List, export and summary reject malformed or empty supplied startTime/endTime values, ranges whose end is not after their start, malformed query encoding (invalid_query), and repeated query parameters (ambiguous_query) with HTTP 400, before reading events. List and export also reject a supplied success other than exactly true or false, including an empty value. Omit a filter to leave it unset. HTTP 200 alone does not establish complete archival coverage.

Summary accepts event, user, startTime, endTime, and verify=true, not success or list pagination. Passing verify=true counts signed events whose verification fails in invalid_signature_count (unsigned events are not counted as invalid signatures). Unsupported parameters do not narrow a summary, so omit them rather than relying on them to bound the read. When no persistent audit store is active, GET /api/audit/export returns HTTP 501 (export_unavailable) and GET /api/audit/summary returns HTTP 501 (summary_unavailable).

Exports and summaries accept at most 10,000 matching events. A larger selection returns HTTP 400 with code export_too_large, not a partial download or a truncated summary. Narrow startTime/endTime, event or user to the relevant incident and request that selection; changing list pagination cannot bypass this limit. Valid selections keep every matching event and the requested signature verification. This is an event-count limit, not a byte-size or query-duration guarantee.

Keep the export outside shared repositories and issue attachments. A failed or incomplete download is not a valid archive. Do not widen or repeat a failed export just to fill a report; existing evidence is valid. Dispose of private response files under your normal data-retention policy.


Tamper Detection

When signing is available, Pulse signs audit events at creation time. Events captured without a signer remain unsigned. Use Verify in the signed-in Audit Log panel, or the authenticated read below, to check a stored signature:

pulse_api GET /api/audit/6b3c9c3c-9a2f-4b3c-9a3b-3d0e8c5c5d45/verify

Open the saved response privately; a successful verification result has this shape (HTTP 200 alone is not signature verification):

{
  "available": true,
  "verified": true,
  "message": "Event signature verified"
}

verified: true means the signature matches the verifier's key and supported signature format. It does not prove that the history is complete or that no events were deleted. verified: false means the check failed, not that Pulse has established why it failed. Keep that result as evidence. The verification endpoint rejects IDs longer than 64 characters or outside [a-zA-Z0-9_-] with HTTP 400 (invalid_id), returns HTTP 404 (not_found) when no stored event matches that ID, and returns HTTP 503 (audit_store_busy with Retry-After: 2 or audit_store_unavailable) if the SQLite store is locked or unavailable.

Verification failures and safe recovery

Result What it establishes Safe next step
Not checked No verification result has been obtained. Use Verify for the relevant event.
Unsigned No signature was stored. Check whether signing was available when the event was captured. Later enabling signing cannot authenticate it retroactively.
Check failed / verified: false The stored event and signature do not verify with the current key and supported format. Preserve the evidence. A different key, missing or damaged signature, unsupported format or modified signed fields can cause this.
Unavailable / available: false The current logger cannot offer verification. Check the audit capability/runtime gate and bounded startup logs for persistent-store initialisation failures.
Check error / non-successful HTTP response The verification request did not return a usable result. Keep the HTTP status and redacted error. It is not proof that the event failed verification.

Start with the event's time, the last known working version and whether the data mount, service account, runtime or backup changed. Inspect a bounded startup log excerpt locally; distinguish encryption/signing initialisation errors from an audit database/query error. Do not print the key files or post whole audit exports, service environments or backups. For an empty panel, clear filters and check the selected organisation before assuming events were lost. See Getting Help for safe evidence.

Preserve before changing anything. Keep a consistent private backup of the current data directory, including the audit store and its signing and encryption keys. Use your established snapshot/backup procedure for a running instance; copying a live .db file alone is not a consistent backup. For an offline filesystem backup, stop Pulse first and retain the complete store, including any SQLite sidecar files, with its original ownership and access.

Do not delete or regenerate a key, replace a live signing key with an older one, edit audit rows or re-sign old events to make verification pass. A newly generated signing key does not verify events signed with the previous key. The encrypted signing key also needs its matching .encryption.key; restoring only one member is not a recovery. Swapping keys can break verification of newer events while concealing the original problem.

If a matching historical backup exists, restore and compare it in an isolated test instance using the corresponding Pulse runtime/version, without replacing the live data or contacting monitored systems and notification destinations. Keep the current instance and both backups intact. If the original key is lost or an event was unsigned, do not claim that a restart, new key or successful check on a different event authenticated that history.


Multi-Tenant Audit Isolation

In multi-tenant deployments, most events are scoped to the active organization:

  • Tenant-aware events (logins, role changes, config updates) are stored per-organization.
  • Global events (oidc_token_refresh, config_auto_import, websocket_multitenant_access_denied, and websocket_org_access_denied) are written to the global audit logger rather than a tenant-specific database.
  • Switching organizations shows only that organization's tenant-scoped events.
  • The tenant context is determined by the X-Pulse-Org-ID header, the pulse_org_id browser cookie, a single-organization-bound API token (when neither header nor cookie is sent), or a signed-in user's landing organization before falling back to default. Selection never overrides membership or a token's organization binding.
  • Because /api/audit* and /api/admin/webhooks/audit require instance-administrator authority, non-default organization-bound API tokens and non-instance organization owners or admins receive HTTP 403 (Admin privileges required). To query or forward audit logs for a non-default organization programmatically, send X-Pulse-Org-ID with an instance-wide token carrying the required scope (audit:read for audit reads, or settings:read/settings:write for audit webhooks).

See Multi-Tenant Organizations for details.


Community vs Pro Behavior

Capability Community Pro / legacy Pro+ / Cloud / MSP / Enterprise
Events captured Yes Yes
Persistent storage (SQLite) Yes Yes
Query/filter API License-gated (402) Full access
Signature verification License-gated (402) Available
Export License-gated (402) Available
persistentLogging in GET /api/audit License-gated (402) true when persistent storage is active (otherwise HTTP 503 audit_store_unavailable)

Pulse attempts SQLite-backed capture on all plans. Failure to initialise the store can leave console-only logging. The query, verify and export endpoints also require the audit_logging capability and a compatible runtime. A licence/runtime gate is not proof that events were never captured. For an authorised GET /api/audit query, persistentLogging is true when the persistent SQLite logger is active, and the endpoint returns HTTP 503 (audit_store_unavailable) rather than an empty list when persistent storage is unavailable. That flag does not establish a count of historical events or proof that their signatures are valid.


Storage

The default audit store lives in the Pulse data directory:

  • Single-tenant, and the default organisation in multi-tenant installs: {data-dir}/audit/audit.db
  • Non-default organisations (multi-tenant): {data-dir}/orgs/{org-id}/audit/audit.db

The default encrypted signing key is .audit-signing.key inside the audit store directory, alongside audit.db, not at the data-directory root. Its matching .encryption.key is in the data directory (or the organisation's data directory for a non-default organisation). Keep both with the corresponding history. A runtime may supply a different audit directory or managed signing key; use that deployment's actual configuration rather than guessing a path.

Retention and cleanup

Persistent SQLite audit stores retain events for 90 days by default (or indefinitely when retention is explicitly configured to 0 days). When retention is enabled, cleanup runs 5 minutes after startup and every 24 hours thereafter. Whenever expired rows are deleted, Pulse records a signed audit_cleanup event as system in the same transaction and reclaims free SQLite pages incrementally with a WAL checkpoint.

Data directory locations:

  • systemd: /etc/pulse/
  • Docker/Kubernetes: /data/
  • Development: tmp/dev-config/