Audit event schema
Schema version: 1
Every security-relevant action in Praxis emits an audit event. Events land in the built-in audit_events table and fan out to any configured external sinks (Settings → Audit Export).
This document is the wire format contract. Breaking changes bump schema_version.
Wire format
{ "schema_version": 1, "event_uuid": "c9f1…", "timestamp": "2026-04-22T00:00:00.000Z", "action": "session.open", "outcome": "success", "actor": { "user_id": 42, "username": "alice", "ip": "10.0.0.5" }, "target": { "kind": "session", "system_id": 7, "id": "123" }, "context": { ... per-action payload ... }}Fields:
| Field | Type | Notes |
|---|---|---|
schema_version | int | Bumped on breaking changes. Consumers should reject unknown versions. |
event_uuid | string | Stable ID. Dedup key for at-least-once sinks. |
timestamp | ISO 8601 UTC | Event time at the Praxis server. |
action | dotted string | See vocabulary below. |
outcome | success / failure / denied | denied = permission gate rejected; failure = ran but errored. |
actor | object | User who triggered the action. All fields nullable. |
target | object | What the action applied to. All fields nullable. |
context | object | Action-specific payload. Stable within a given action+schema_version. |
Action vocabulary
Sessions
| Action | When it fires | context keys |
|---|---|---|
session.open | Interactive terminal session established | login, fleet_role, cert_serial, ttl_s |
session.close | User clicked Disconnect or remote EOF | reason, login |
session.idle_kill | Idle timeout sweeper closed the session | reason, login |
session.max_duration | Cert TTL hit, hard close | reason, login |
Command execution
| Action | outcome | context keys |
|---|---|---|
command.exec | success / failure | command, exit_code, execution_time_ms, bypass_validation |
command.exec | denied | reason_code, reason |
Package updates
| Action | outcome | context keys |
|---|---|---|
package.update | success / failure | hostname, package_names, package_count, result, packages_updated, packages_skipped, packages_failed, packages_unrecorded, and reason on a failure |
package.update | denied | reason_code, reason, and for a bulk request system_ids, system_count |
package.direct_update.submitted | success / denied | operation_id, plan_id, hostname, disposition, reason_code, policy_id, reboot_policy, approval_required, package_names, package_count |
package.direct_update.canceled | success | operation_id, plan_ids |
package.direct_update.unresolved_host_resolution | success / denied | operation_id, plan_id, result, host_check, delivery, queued_delivery_confirmed, reason |
package.direct_update.reboot_reconciled | success | reboot row fields as for other patch_update_execution_reboot events, with operation_id, previous_state, previous_decision_code |
package.update is recorded once per host for a direct update from the package pages or the bulk update action, attributed to the operator who requested it and to the host in target. It is recorded when the host’s work ends, which can be long after the request when approval or a window held it. An event for work that ran through a generated plan also carries operation_id, plan_id, execution_id, and selected_packages. Scheduled jobs and other patch plan executions keep their own run history and do not emit this event.
Events of direct updates, including the patch_update_execution_reboot events for their reboot queue, are stored in the same transaction as the change they describe and then moved into the audit log. An interruption between the two delays an event until the next scheduled pass.
A direct update host whose command result was never received is settled later from what the host reports. It records patch_update_execution.host_succeeded or host_failed for that host with interrupted true, together with its package.update event.
package.direct_update.unresolved_host_resolution is recorded when an administrator resolves a host whose command result never arrived, attributed to that administrator, with the host’s execution row as the target. result is settled_from_host, closed_unresolved (closed as failed without evidence of what is installed), or refused_package_work_running with outcome denied. host_check is what the check of the host found (idle, busy, unknown, or versions_unreadable), and reason is the administrator’s stated reason, redacted and bounded. delivery is the transport recorded for the command (ssh, agent, or null when none was recorded), and queued_delivery_confirmed is whether the administrator confirmed that a queued command can no longer arrive, which any transport other than ssh requires.
package.direct_update.reboot_reconciled records that a reconcile changed an existing reboot row of a direct update other than by scheduling it, for example resolving unknown evidence to no reboot needed.
package.direct_update.submitted is recorded once per host when a request is accepted, and again, with joined true and the second caller as actor, when a later submission is answered by work that is already open. disposition states what policy allowed at that moment (immediate, approval_required, waiting_window, waiting_wave, blocked, no_changes, or already_in_progress); outcome is denied for a blocked host. See direct updates.
result reports what the host showed before and after the command, not the package manager exit code. The service reads the installed versions from the host itself on both sides of the command rather than from the stored inventory, which may predate the request, so a change is credited to the request only when the two readings differ:
updated: the attempted packages moved to their new version, or the two readings show other packages changed (outcomeissuccess).no_change: nothing was pending, or the command ran and the two readings show nothing moved (outcomeissuccess). A package already at its target before the command is not counted.partial: a verified change accompanies a tracked package that did not move, whether the verified change is a tracked package or one without a history row (outcomeisfailure).failed: the command exited nonzero, the host could not be reached, or no verified change accompanies the tracked packages that did not move (outcomeisfailure).unverified: the command exited cleanly but either reading was unavailable (a listing that exits nonzero is unavailable even when it printed a package list), so the effect cannot be attributed to the request (outcomeisfailure, so it is never read as a confirmed success). History rows for the request are closed as failed with a message saying the result could not be verified.
packages_updated counts packages with a history row that were verified at their new version by this request. In the API response the integer counts only moves the two readings attribute to the request, so it is 0 when the reading before is missing even though the history row records the version observed afterward. packages_unrecorded counts packages whose installed version changed between the two readings with no history row to verify them, for example a dependency that the package manager moved along with a selected package. A count that was not measured is null, not 0: after a failed command or a connection error packages_updated and packages_unrecorded are null, and packages_failed is null unless history rows were marked failed. The same holds for unverified, where packages_updated and packages_unrecorded are null and packages_failed is null unless a reading after the command was available. package_names is the list the operator named, or null when all pending updates were requested, capped at 50 entries with package_count giving the full size. reason is redacted text capped at 512 characters; an unexpected error records only its class name.
A refusal of an authenticated caller records outcome denied before the unchanged 403 or 404 response. reason_code is role_not_permitted or system_not_in_scope. A single-host refusal names the requested id in target.id and links the host only when it exists, so a probe of an unknown id leaves no host link; a bulk refusal links every existing host the caller lacked scope on. Denied events never carry a hostname. A request for a host whose packages are already covered by an open operation records no package.update event; that operation records the outcome. Unauthenticated requests record nothing.
File transfer
| Action | When it fires | context keys |
|---|---|---|
file.upload | Web UI → host SFTP upload | login, size_bytes, sha256, local_filename, error? |
file.download | Host → web UI SFTP download | login, size_bytes, sha256, error? |
file.mkdir | New remote directory | login, error? |
file.unlink | Remote file/dir deletion | login, error? |
target.kind is path and target.id is the remote path.
A download that fails, ends short, or is abandoned by the client emits outcome
failure with error set and no sha256. error is client_disconnected when
the client went away mid-transfer.
Access bindings + requests
| Action | context keys |
|---|---|
binding.create | fleet_role_id, subject_user_id, subject_app_role_id, scope_group_id, scope_smart_group_id, expires_at |
binding.delete | Snapshot of the deleted binding shape |
access_request.create | fleet_role_id, scope_group_id, scope_smart_group_id, duration_seconds, justification |
access_request.approve | requested_by, fleet_role_id, resulting_binding_id, duration_seconds, comment |
access_request.reject | requested_by, comment |
access_request.revoke | none |
Authentication
| Action | context keys |
|---|---|
totp.step_up | method = totp or recovery |
First-run initialization
An installation provisions its administrator once and records that it did. These
events describe that record. They originate from startup rather than from a
request, so actor is empty on all four: an operator identity here would be
invented, and a reader could not tell it from a real login. target.kind is
bootstrap_admin and target.id is null, because the subject is the
installation’s own state and not a user row. No context field carries or
describes credential material.
| Action | When it fires | outcome | context keys |
|---|---|---|---|
bootstrap.admin.provisioned | The first administrator is created on an installation that has none | success | username, user_id, state |
bootstrap.admin.adopted | An installation that already has users is recorded as initialized. Nothing is created, modified, reactivated, or re-roled | success | username (the configured one), matched_existing, user_id (null when nothing carries that username), user_count, state |
bootstrap.admin.suppressed | A restart supplies an administrator password while nothing carries the configured username, on an installation already recorded as initialized. This is the state that would otherwise resurrect a deleted administrator | success | username |
bootstrap.admin.reset | An operator clears the record so the installation can provision again, or is refused because a user still exists | success / denied | on success previous_state, username; on refusal reason, user_count |
bootstrap.admin.provisioned and bootstrap.admin.adopted fire at most once
per installation, and each is written in the same transaction as the record and
the account it describes, so neither can exist without the other.
bootstrap.admin.suppressed fires at most once per backend start, and only in
the narrow state above; an installation whose administrator password has been
cleared after first run never emits it.
Secrets, Vault & PKI
Sensitive secret and PKI actions emit unified audit events so secret access and
CA lifecycle changes reach external sinks. context carries only locators and
non-secret metadata, never secret values, passwords, private keys, certificate
material, tokens, or raw Vault exception text.
ssh.user_cert.sign fires when Vault signs a short-lived SSH user certificate
for host access, at mint time (independent of whether the subsequent SSH
connection succeeds), for the actor-attributed paths: interactive sessions
(purpose=session) and web file transfer (purpose=file_transfer). Backend
SSH that reuses the pooled connection helper (e.g. command execution) has no
single user actor at the mint point; that host access is audited via its parent
command.exec event instead. Note session.open separately records the same
cert_serial as part of the session lifecycle.
| Action | When it fires | context keys |
|---|---|---|
credential.secret.reveal | A credential’s secret is revealed from Vault | name, auth_method, vault_path |
credential.create | New credential created (managed or linked) | name, auth_method, vault_path, mode |
credential.update | Credential metadata and/or its Vault secret updated | name, auth_method, secret_updated (bool) |
credential.delete | Credential deleted (Vault secret + DB metadata) | name, auth_method |
vault.secret.read | Direct Vault secret read (incl. specific version) | vault_path, version? |
vault.secret.write | Direct Vault secret create/update | vault_path |
vault.secret.password_update | Password field updated within a Vault secret | vault_path, username |
vault.secret.delete | Direct Vault secret deleted | vault_path |
ssh.user_cert.sign | Short-lived SSH user cert minted for host access | login, ttl_s, cert_serial, purpose |
ssh.ca.rotate | SSH CA keypair regenerated in Vault | none |
ssh.ca.revoke_user_certs | SSH CA identifier bumped and pooled sessions dropped | none |
target.kind is credential (with target.id = credential id), vault_secret
(with target.id = vault path), system (for ssh.user_cert.sign when the
target system is known; otherwise ssh_user_cert), or ssh_ca.
Guided system onboarding
A setup holds no secret and creates nothing until it finishes, so these events
record decisions and outcomes rather than state changes. target.kind is
onboarding_draft and target.id is the setup’s opaque handle, except on a
successful finish, where the target is the host that now exists.
action | When | outcome | context |
|---|---|---|---|
onboarding.draft.create | An operator opens a guided setup | success | none |
onboarding.draft.cancel | An operator abandons a setup | success | none |
onboarding.verify | A verification run completes | success when verified, else failure | reason_code, checks (per-check check / status / reason_code) |
onboarding.host_key.decision | An operator approves or rejects an offered host key | success on approval, denied on rejection | decision, fingerprint, key_type |
onboarding.verify.skipped | An operator explicitly declines verification | success | none |
onboarding.discover | Discovery completes | success | support_mapping, package_family |
onboarding.finish | Finalization is attempted | success, failure, or denied | on success hostname, status, verification_skipped, host_key_decision; otherwise code |
Verification context carries reason codes only. The transport and library text behind a failure is never recorded, so an audit row cannot leak a path, a key, or an internal hostname.
Advisory feeds
Publisher advisory feed configuration and refresh outcomes. target.kind is patch_advisory_feed and target.id is the source kind (debian_security, ubuntu_usn, redhat_updateinfo, or the enrichment sources cisa_kev and cve_list_v5). Context never carries response bodies, tokens or local paths; error text is redacted and bounded.
| Action | outcome | When it fires | context keys |
|---|---|---|---|
patch_advisory_feed.configured | success | An administrator changes a feed’s enabled flag, interval or scope. A request that changes nothing is not recorded | source_kind, changes (map of changed field to its old and new value, or the new scope, and withdrawn_for_scope when narrowing the scope withdrew advisories) |
patch_advisory_feed.refresh_completed | success | A refresh finished with status success or unchanged | source_kind, run_id, trigger (scheduled / manual), status, imported, refreshed, unchanged, withdrawn, errors, source_timestamp, revision, error (always null), import (false) |
patch_advisory_feed.imported | success | A document loaded from a file (CISA KEV catalog or CVE records) was applied with status success or unchanged. A failed import is recorded as refresh_failed | Same keys as .refresh_completed, with import true |
patch_advisory_feed.refresh_failed | failure | A refresh failed; the previous snapshot was retained | Same keys, with status failed and a redacted error |
patch_advisory_feed.refresh_skipped | success | A scheduled or manual refresh was skipped because offline mode is on | source_kind, trigger, reason (offline) |
patch_advisory_feed.stale | failure | A feed’s last successful refresh passed its freshness deadline (twice the interval). Recorded once per transition | source_kind, last_success_at, interval_hours, stale_after_hours, offline, at |
patch_advisory_feed.recovered | success | A stale feed completed a successful refresh. Recorded once per transition | Same keys as .stale |
A manual refresh carries the requesting operator as actor; scheduled refreshes and the freshness watchdog have no actor. See advisory feeds.
Patch findings
Operator actions on a host’s patch findings. target.kind is system and target.id is the host id. Neither action changes a verdict, marks a package fixed, or starts a remediation. Context never carries the free-text review reason; that stays with the review itself.
| Action | outcome | When it fires | context keys |
|---|---|---|---|
patch_finding.reviewed | success | An administrator or maintainer recorded a reasoned review of a potentially vulnerable finding, bound to the evidence digest and review the operator was shown. A refused or stale review is not recorded | finding_key, package, arch, decision (likely_affected / likely_not_affected / needs_investigation), replaced_review (whether an earlier review for the same finding was superseded), previous_decision, supersedes_event_id, event_id (the history entry), evidence_basis (the digest the review was written against), review_id, verdict (always potentially_vulnerable) |
patch_finding.recheck_requested | success or failure | An administrator or maintainer asked for the host’s installed packages to be collected again. failure when the scan could not run, in which case the previous evidence is unchanged | scan_status |
See patch prioritization.
Patch remediation
Governed remediation of host CVEs and the rules that raise it. Item events use target.kind patch_remediation_item and target.id the item id, with target.system_id the host. Rule events use target.kind patch_remediation_rule and target.id the rule id. Every item event carries the same stable keys so one item can be followed from staging to verification: item_id, origin (manual or rule), rule_ids, status, package, installed_version, candidate_version, cves (each with cve_id, advisory_ids, expected and outcome), rationale, plan_id, execution_id, approval_id and verification. The approval, start and per-host execution events of the patch plan itself are recorded separately, as listed under package updates, and carry the same plan and execution ids.
| Action | outcome | When it fires | Extra context keys |
|---|---|---|---|
patch_remediation.staged | success | A draft patch plan was created for a package change, by an operator or by an enabled rule. The actor is the operator, or the operator who enabled the rule | plan_id, plan_name |
patch_remediation.deduplicated | success | A request or rule matched a package change that an active item already covers; the rule is recorded behind the existing item and no new work is created | requested_by_rule |
patch_remediation.status_changed | success | An item’s status changed, for example after approval, dispatch, a failed run or verification from fresh packages | previous_status, reason |
patch_remediation.dispatch_deferred | success | Unattended dispatch did not start and the reason changed: a rule was disabled or no longer dispatches, the enabling operator lost authority, the maintenance window is closed or unusable, the host is offline, or the start gate refused. Fires once per change of reason | item_id, plan_id, rule_ids, code, message |
patch_remediation.host_reconciled | success | A host left running by an interrupted execution was resolved from package evidence collected after dispatch began, or left unresolved with the reason | execution_id, execution_host_id, system_id, state (succeeded, failed or unresolved), reason |
patch_remediation_rule.created | success | An administrator or maintainer created a rule. Rules are created disabled | rule_id, name, mode, scope_kind, scope_id, criteria, enabled |
patch_remediation_rule.updated | success | A rule was changed. A change to what it selects or does disables it | Same keys, plus definition_changed |
patch_remediation_rule.enabled | success | A rule was enabled with the confirmation issued by this operator’s preview of its current definition. The actor is the operator whose authority the rule uses | Same keys |
patch_remediation_rule.disabled | success | A rule was disabled | Same keys |
patch_remediation_rule.deleted | success | A rule was deleted. Items it staged remain | Same keys |
patch_remediation_rule.evaluated | success | A rule was evaluated, on a change in evidence, on the periodic sweep, or on request | rule_id, rule, trigger, evaluated_at, staged, deduplicated, waiting, error (set when the enabling operator no longer has authority) |
See patch remediation.
Third-party update discovery
Administrator changes to the repositories trusted as sources of package updates. target.kind is update_origin_trust and target.id is the entry id. The stored origin never carries credentials, queries or fragments.
| Action | outcome | context keys |
|---|---|---|
update_origin_trust.created | success | package_manager, origin, label, enabled, allow_installed_origin_change, channels |
update_origin_trust.updated | success | The same keys plus changes, a map of each changed field to its old and new value (notes is recorded as true). A request that changes nothing is not recorded |
update_origin_trust.deleted | success | package_manager, origin, label, enabled, allow_installed_origin_change, channels |
Application host checks, verification and the loading of vendor release notices are recorded beside them. Host checks and verification are read-only; an operator’s run writes the event whatever the result, and no event carries raw command output. Later reads of both states come from the newest event of that application on the host, except that a passing host check does not replace a failed one recorded after it began.
| Action | outcome | target | When it fires | context keys |
|---|---|---|---|---|
third_party_application.host_check_recorded | success when every check passed, otherwise failure | kind application, id the mapping id, system_id the host | An administrator or maintainer ran the read-only host check of an offered application update (Grafana), or the checks repeated immediately before an install refused it. A refusal is written in a transaction of its own, so it remains if the dispatch is rolled back; the actor is who dispatched | mapping_id, binding (exactly what was checked: package_id, package, edition, manager, architecture, installed_version, installed_epoch, installed_origin, installed_origin_evidence, offered_version, offered_epoch, offered_architecture, offered_sources as repository and channel pairs, offered_sources_complete), state (passed, failed or unknown; a refusal is never passed), source (operator or dispatch), started_at (when the host began to be asked, or when a refusal was recorded), checks (a list of id, status and detail; status is pass, fail or unknown. Ids are artifact_identity, package_manager_offer, service_health, database, plugin_compatibility, recovery_readiness, free_space and, for RPM, installed_location and offered_location; prerequisites stands alone when none could be judged), artifact (what the installed files were compared with, when the application compares them: package, version, epoch, architecture, state (pass, fail or unknown) and, as far as reached, error (unavailable, unauthenticated, missing, ambiguous or invalid), the artifact url, sha256 and size, the signed metadata address, signed_by (key fingerprint), signed_at, files_compared, configuration_differences, difference_count and differences (at most 10 of each, as a file path and what differs)). Details can name plugin directories, database file paths and files of the application |
third_party_application.verification_recorded | success when the result is verified, otherwise failure | kind application, id the mapping id, system_id the host | An administrator or maintainer ran Check running version and health for a mapped application | mapping_id, package (the server package checked), package_id (its inventory record), installed_version (the package version checked), epoch (the approved or installed epoch, or null), architecture, state (verified, failed or pending), running_version (what the running service reported, or null), revision_source (live when the package manager answered, audited when the inventory stood in, or null), acquisition (for an APT package, recorded, not_recorded or not_applicable: whether the installed origin was bound to a governed installation), checks (a list of id, status and detail; status is pass, fail or unknown. GitLab ids are installed_code_version, package_revision, running_identity, services_running, restarted_after_install and readiness; Grafana ids are installed_code_version, package_revision, service_running, listener, restarted_after_install, running_version and health) |
vendor_release_notices.imported | success | kind vendor_release_notices, id the vendor (gitlab) | An administrator or maintainer loaded the vendor’s patch release feed, from a file (origin import, unsigned and never used as evidence) or from the official address (origin fetch). A document that is refused is not recorded | vendor, origin (import or fetch), imported, refreshed, unchanged, stale (an older revision that did not replace a newer one), protected (an unsigned import that was not allowed to touch a retrieved notice) and skipped (entries that did not validate, including a missing or invalid date) |
The package_revision check compares the exact epoch-qualified revision, so its detail reads like 0:17.5.4-ce.0 installed, not the expected 0:17.5.4-ce.1. Context never carries notice text, CVE content or host command output. See third-party repository updates.
A patch plan host whose selected candidates no longer qualify when it is dispatched records patch_update_execution.host_failed with error_code candidate_revalidation_failed and a failures list. Each failure names the package, the version and its blockers, each with a stable code (held, untrusted_origin, unknown_origin, stale_metadata, unverified_metadata, missing_metadata, capability_unsupported, not_qualified, candidate_changed, candidate_not_offered, origin_changed, installed_changed, installed_origin_unknown, installed_origin_differs, installed_origin_changed, installed_artifact_unverified, downgrade, same_version, version_unreadable, epoch_unknown, pin_changed, ambiguous_origin, incomplete_origin_evidence, ambiguous_architecture, identity_incomplete, probe_failed) and a message.
Airgap signing keys and import trust
Airgap bundle signing-key and import trust-pin lifecycle events carry only public identifiers and status metadata. Context must never include armored key bodies, private key material, Vault paths, bundle tar contents, or raw GPG/Vault exception text.
| Action | When it fires | target.kind | context keys |
|---|---|---|---|
airgap.signing_key.created | Initial instance bundle signing key is bootstrapped | airgap_signing_key | key_id, fingerprint, key_uid, status |
airgap.signing_key.rotated | Active bundle signing key is rotated: old active becomes rotating_out, new key becomes active | airgap_signing_key | old_key_id, old_fingerprint, old_status, new_key_id, new_fingerprint, new_status |
airgap.signing_key.retired | A rotating_out bundle signing key is retired | airgap_signing_key | key_id, fingerprint, status |
airgap.import_trust.added | Import-side public key trust pin is added | airgap_import_trust | key_id, fingerprint, key_uid |
airgap.import_trust.removed | Import-side public key trust pin is soft-deleted | airgap_import_trust | key_id, fingerprint, key_uid |
Compliance remediation requests
Non-executing workflow that captures operator intent to remediate a failing compliance evidence row plus the approval-gate state. Approval flips the request state only: no host mutation, no command execution, no dispatch.
target.kind is compliance_remediation_request and target.id is the request id. target.system_id is the host the request applies to.
All four actions emit outcome=success (no denied or failure paths in the current release; validation errors raise before any audit row is written).
Stable context keys present on every action: policy_id, policy_slug, policy_version, check_id, check_slug, check_kind, system_id, evidence_id, evaluation_run_id, verdict_snapshot, severity_snapshot, state, requested_by, decided_by.
| Action | When it fires | Additional context keys |
|---|---|---|
compliance_remediation.requested | Operator opens a remediation request for a failing evidence row | has_guidance_snapshot (bool), justification_length (int, 0 when omitted) |
compliance_remediation.approved | Admin approves the request; state flips to approved. Does NOT execute anything | separation_of_duties_enforced (bool, always true in the current release), decided_reason_length (int) |
compliance_remediation.rejected | Admin rejects the request; terminal state | decided_reason_length (int) |
compliance_remediation.cancelled | Admin or original requester withdraws the request; terminal state | self_cancel (bool, true when the requester withdrew their own request), decided_reason_length (int) |
Compliance remediation plan previews
Non-executing execution-plan previews derived from approved remediation requests. Building a plan never runs anything on a host, dispatches a job, or mutates the source request. plan_steps is a JSON list of structured operator-readable intent objects (action, target, expected value, safety notes), NOT executable shell.
target.kind is compliance_remediation_plan and target.id is the plan id. target.system_id is the host the plan applies to.
All three actions emit outcome=success. Validation failures (e.g. building against a non-approved request) raise before any audit row is written.
Stable context keys present on every action: request_id, policy_id, check_id, system_id, policy_slug, policy_version, check_slug, check_kind, severity_snapshot.
| Action | When it fires | Additional context keys |
|---|---|---|
compliance_remediation_plan.built | First plan preview is generated for an approved remediation request | plan_state (planned / unsupported / failed), plan_kind, step_count (int), refreshed (bool, always false), superseded_plan_id (int or null) |
compliance_remediation_plan.refreshed | A non-acknowledged current draft plan is rebuilt in place (idempotent recompute; row id stable) | plan_state, plan_kind, step_count, refreshed (bool, always true), superseded_plan_id (always null) |
compliance_remediation_plan.unsupported | The resolved plan kind is unsupported (paired with the matching built/refreshed event) | unsupported_reason (string) |
compliance_remediation_plan.acknowledged | Operator explicitly acknowledges the current plan (“this is what I intend to run”); metadata only, no execution | plan_kind, ready_for_execution (bool) |
compliance_remediation_plan.superseded | An acknowledged current plan is replaced by a fresh build (the new plan becomes current; the old one is locked as history) | superseded_by_plan_id (int, the new current plan id) |
The plan read envelope also exposes lifecycle metadata fields: check_definition_fingerprint, is_current, superseded_by_plan_id, acknowledged_at, acknowledged_by, is_stale, and ready_for_execution. These are derived/snapshot fields and are not separate audit events. ready_for_execution is the gate an execution flow consults; it is true only when the source request is still approved, the plan is current, state='planned', acknowledged, not stale, and of an executable plan_kind (i.e. one of package_install_preview / package_remove_preview / package_upgrade_preview; review-required kinds always read false).
Compliance remediation execution attempts
Durable, pre-dispatch record of an operator’s intent to execute a current acknowledged ready-for-execution package remediation plan. The .created action persists the snapshot + actor + approval lineage and emits one audit event; it does not run commands, dispatch jobs, queue work, mutate hosts, refresh facts, scan packages, reboot, or roll back. The dispatch actions below add transport selection, dispatch, and outcome recording on top of the same row via .dispatched / .succeeded / .failed / .cancelled events.
target.kind is compliance_remediation_execution_attempt and target.id is the attempt id. target.system_id is the host the attempt applies to.
The readiness gate is re-checked at write time so a stale UI cannot bypass it by replaying a previously-true ready_for_execution flag. Validation failures (missing plan, superseded plan, non-planned state, unacknowledged, stale, non-package plan_kind, source request no longer approved) raise before any audit row is written.
| Action | When it fires | context keys |
|---|---|---|
compliance_remediation_execution.created | Operator creates a durable execution-attempt row for an acknowledged, ready, package remediation plan. State persists as pending; nothing dispatches yet. | attempt_id (the attempt id; also surfaced as the target.id), request_id, plan_id, policy_id, check_id, system_id, policy_slug, policy_version, check_slug, check_kind, severity_snapshot, plan_kind_snapshot (one of the three executable package plan kinds), package_name (nullable when the plan was built against a deleted check), package_version_target (set for upgrade plans), state (always pending for this action), approval_decided_by (snapshot of the request’s approver, nullable if the user row is later deleted), dispatched (bool, always false for this action) |
compliance_remediation_execution.dispatched | Operator dispatches a pending attempt through the governed patch transport. State flips from pending → dispatched; dispatched_at is set. The audit row commits BEFORE the transport call so a transport hang still leaves a durable record. | Same stable keys as .created (without dispatched), plus package_family (apt / dnf) and command_program (the argv[0], i.e. apt-get or dnf) |
compliance_remediation_execution.succeeded | Dispatch returned exit 0 with no transport error. State flips from dispatched → succeeded; completed_at set; exit_code, duration_ms, transport, bounded stdout_summary / stderr_summary written to the attempt row. | Same stable keys as .created (without dispatched), plus package_family, exit_code (always 0), duration_ms, transport, failure_reason (always null) |
compliance_remediation_execution.failed | Dispatch returned a non-zero exit code, the transport raised, or the adapter raised. State flips dispatched → failed; failure_reason carries the short stable code (transport_unavailable, transport_error, package_manager_failed, etc.); error_message carries a bounded operator-readable summary. | Same stable keys as .created (without dispatched), plus package_family, exit_code (may be -1 for transport errors), duration_ms, transport, failure_reason |
compliance_remediation_execution.batch_dispatched | Operator triggers a bounded request-scoped batch dispatch. The batch loops dispatch_attempt(...) over every pending attempt for the named request (capped by limit, default = MAX_BATCH_SIZE = 500); per-attempt .dispatched / .succeeded / .failed events still fire from the inner path. This event records the aggregate once per batch call, after the loop finishes. target.kind is compliance_remediation_request (not the attempt) because the batch is request-scoped; target.id is the request id. | request_id, policy_id, policy_slug, check_slug, check_kind, system_id, limit, total_eligible (≤ limit), dispatched_count (succeeded + failed; excludes refused), succeeded_count, failed_count, refused_count (count of attempts whose pre-flight ComplianceError left the row in pending), failure_breakdown_by_reason (dict keyed on failure_reason for the failed subset) |
The attempt read envelope additionally exposes approval_decided_at, transport, failure_reason, error_message, exit_code, duration_ms, stdout_summary, stderr_summary, dispatched_at, and completed_at. These are reserved on pending attempts and populated on the same row as the attempt moves through dispatched → succeeded | failed. Bounded fields: stdout_summary / stderr_summary are truncated to 64 KiB each at the service layer; error_message is truncated to 2048 chars; transport and failure_reason are bounded by the column type.
The readiness gate is re-checked at dispatch time so a stale UI cannot bypass it by replaying a previously-true ready_for_execution flag. Lineage drift (mismatched request_id, plan_kind drift, missing package_name, unsafe package_name, missing/unparsable upgrade version target, unknown host package-manager family, source request no longer approved, plan superseded/stale/unacknowledged/non-planned) raises before any audit row is written and before any host mutation. The dispatch path uses only the governed transport seam (patch_execution_dispatch_service.default_dispatch); there is no raw SSH/agent/subprocess/local-fallback path.
Patch reboot actions
target.kind is patch_update_execution_reboot and target.id is the reboot row id, with the host in target, unless noted.
Automatic sends and verifications are recorded with the actor username reboot-worker and trigger automatic in the context. An automatic send also carries authorized_by, the id of the operator who started the run.
| Action | When it fires | context keys |
|---|---|---|
patch_update_execution_reboot.queued, .scheduled, .skipped | A reconcile queues, schedules or skips a reboot | reboot row fields |
patch_update_execution_reboot.started / .dispatch_failed | A reboot command was sent, or sending it failed | reboot row fields, the send result, reason for a send an operator requested |
patch_update_execution_reboot.verification_passed / .verification_failed | A reboot is proven, or fails verification | reboot row fields and the verification reason. When Praxis stopped while sending and no .started or .dispatch_failed was recorded, also dispatch_result (not_recorded) and send, with the send’s trigger and its authorized_by or reason |
patch_update_execution_reboot.send_requested | An operator used Send now, before anything is sent | operator fields |
patch_update_execution_reboot.skipped_by_operator | Skip | operator fields, decision_before |
patch_update_execution_reboot.rescheduled | Reschedule | operator fields, previous_scheduled_for_at |
patch_update_execution_reboot.verification_requested | Verify now, before the host is asked | operator fields |
patch_update_execution_reboot.verification_retried | Retry verification | operator fields, previous_reason |
patch_update_execution_reboot.reset | Reset | operator fields, previous_attempt with the earlier send, its result and the facts that proved no restart |
patch_update_execution_reboot.evidence_rechecked | Re-check evidence | operator fields, evidence_outcome, reboot_required, decision_code |
patch_update_execution_reboot.acknowledged | Acknowledge | operator fields |
patch_update_execution_reboot.batch_paused (target.kind patch_update_execution) | Pause reboots, or the failure threshold, which has no actor | execution_id, plan_id, old_state, new_state, source (operator or threshold), reason, changed_at, threshold |
patch_update_execution_reboot.batch_resumed (target.kind patch_update_execution) | Resume reboots | old_state, new_state, reason, accepted_reboot_ids, changed_at |
patch_update_execution_reboot.batch_canceled (target.kind patch_update_execution) | Cancel reboots | old_state, new_state, reason, changed_at, dropped with each reboot’s host and old and new state |
Operator fields are execution_id, execution_host_id, plan_id, system_id, system_hostname, reason, old_state, new_state, scheduled_for_at and at. A control that is refused records nothing, except that send_requested and verification_requested record the request before its outcome.
Patch reboot reconciliation
The reboot queue for an execution is rebuilt by a reconcile pass. When that pass raises, the failure is recorded rather than left to a log line, because the queue counts are what an operator reads as “what still has to reboot”.
target.kind is patch_update_execution and target.id is the execution id.
| Action | When it fires | outcome | context keys |
|---|---|---|---|
patch_update_execution_reboot.reconcile_failed | A reboot reconcile pass for an execution raises, and the failure is surfaced. A queue that merely reads as incomplete does not emit this action | failure | execution_id, plan_id, phase, wave_index, reason (redacted and bounded), recorded (bool, whether the marker was persisted on the execution) |
The same failure raises a patch.reboot_required notification at error severity and blocks dependent waves. See when the reboot queue is incomplete for the operator path.
Patch and compliance notifications
This release expands the notification vocabulary alongside the existing audit-event vocabulary. Notifications flow through the existing notification_service.create_notification → alert_service.send_alert path: per-user disable (notification_preferences), per-fleet smart-group scope, and the existing retry/dead-letter behavior all apply unchanged. There are no new audit-event actions here; emission lives beside the existing service-level audit emits at the same stable state transitions, and the helper functions in app.services.notification_events are best-effort (failures log + swallow so an audit event always wins precedence).
Event vocabulary (each is also a valid disabled_types entry on the /notification-preferences route and a valid events[] entry on an AlertConfig):
| Event | Severity | Fires from |
|---|---|---|
patch.executed | info on succeeded, warning on canceled, error on failed | patch_execution_dispatch_service._maybe_finalize_execution when an execution reaches its terminal state |
patch.reboot_required | warning on a queued reboot, error on a failed reconcile | patch_reboot_service.auto_reconcile_on_terminal when a queued reboot row is added for a host that needs a reboot, and patch_reboot_service.surface_reconciliation_failure when a reconcile pass raises. A queue that merely reads as incomplete raises no notification |
patch.reboot_completed | info on healthy, error on failed | patch_reboot_verify_service once per row’s terminal verify transition, automatic or requested |
patch.rollback_started | warning | patch_rollback_dispatch_service.start_rollback_execution |
patch.rollback_completed | info on succeeded, warning on canceled, error on failed | patch_rollback_dispatch_service._maybe_finalize_run when the run reaches its terminal state |
compliance.evaluated | tracks the dominant per-host verdict (pass → info, fail → warning, error → error) | compliance_evaluation_service.evaluate_policy_for_host after the evidence rows commit |
remediation.requested | warning | compliance_remediation_service.create_request after commit |
remediation.ready | info | compliance_remediation_plan_service.acknowledge_plan only when the acknowledgement flipped ready_for_execution to true |
remediation.executed | info | compliance_remediation_execution_service.dispatch_attempt on succeeded |
remediation.failed | error | compliance_remediation_execution_service.dispatch_attempt on failed (carries failure_reason in the message body) |
Titles and message bodies are bounded at 160 / 1024 chars respectively. Notifications are broadcast (no user_id target) so they appear in the unread feed for every operator who has the event enabled.
Patch and compliance reporting / exports
Manual operator-driven export endpoints for review-period reporting. Each event emits after the response body is built so the recorded row_count matches the bytes the operator received. target.id is null because the export is a bounded multi-row query, not a single-resource read. outcome is always success: bad windows, bad filter values, and row-cap violations raise HTTP 422 before any audit row is written.
| Action | When it fires | target.kind | context keys |
|---|---|---|---|
compliance_export.requested | Operator downloads compliance evidence over a bounded review window via GET /compliance/exports/evidence.{jsonl,csv} | compliance_evidence_export | format (jsonl / csv), filters (evaluated_after, evaluated_before, policy_id, system_id, verdict), row_count |
compliance_remediation_export.requested | Operator downloads compliance remediation requests over a bounded review window via GET /compliance/exports/remediation-requests | compliance_remediation_request_export | format (csv / json), filters (created_after, created_before, policy_id, system_id, state), row_count |
patch_execution_export.requested | Operator downloads patch update executions over a bounded review window via GET /patch/update-executions/export | patch_execution_export | format (csv / json), filters (started_after, started_before, plan_id, state), row_count |
patch_plan_export.requested | Operator downloads patch update plans over a bounded review window via GET /patch/update-plans/export | patch_update_plan_export | format (csv / json), filters (created_after, created_before, policy_id, state), row_count |
patch_reboot_export.requested | Operator downloads the per-execution reboot queue via GET /patch/update-executions/{id}/reboots/export | patch_reboot_queue_export | format (csv / json), filters (execution_id), row_count |
patch_rollback_export.requested | Operator downloads the per-execution rollback dispatch run + per-host rows via GET /patch/update-executions/{id}/rollback/export | patch_rollback_run_export | format (csv / json), filters (execution_id), row_count |
compliance_remediation_plan_export.requested | Operator downloads compliance remediation plans (current + superseded) over a bounded review window via GET /compliance/exports/remediation-plans | compliance_remediation_plan_export | format (csv / json), filters (created_after, created_before, policy_id, system_id, state, current_only), row_count |
compliance_remediation_execution_export.requested | Operator downloads compliance remediation execution attempts over a bounded review window via GET /compliance/exports/remediation-executions | compliance_remediation_execution_export | format (csv / json), filters (created_after, created_before, policy_id, system_id, state), row_count |
Scheduled report runs do NOT add a new audit-event action: the scheduler tick (apscheduler report_schedules_due job, every 5 minutes) invokes the same per-kind dispatcher used by the manual export routes, so the same *_export.requested audit events fire from the scheduled-firing path. The only persisted difference is the matching report_runs row, which is written with triggered_by='system_scheduled' (vs 'user' for manual exports). Operators distinguish manual vs scheduled runs by reading the triggered_by column on GET /reports/runs. Schedule definitions live in the report_schedules table (admin/maintainer write, auditor read via GET /reports/schedules) with plain-language cadence (daily, weekly, or monthly). No cron expression ever reaches the wire.
Bounded review-window guard: created_after/created_before (and started_after/started_before) default to the last 30 days when both bounds are omitted and a single request cannot span more than EXPORT_WINDOW_MAX_DAYS = 366 days. The remediation-request and patch-execution exports additionally cap a single response at EXPORT_MAX_ROWS = 50_000; oversized filters raise HTTP 422 with operator-readable text rather than truncate. The compliance evidence export is streamed (yield_per) and therefore not row-capped.
RBAC: all three export endpoints require admin or maintainer. Auditors can read individual records through the per-resource detail routes but cannot trigger a bulk export.
Delivery guarantees
Events persist to the database synchronously with the action that emitted them (same DB transaction where reasonable). External sinks receive events at least once via the delivery queue:
- Pending delivery rows are drained every 30 seconds.
- Transport failures retry with exponential backoff: 5s → 15s → 1m → 5m → 15m → 1h.
- After 6 attempts, deliveries move to
dead_letterand stop retrying automatically. Admin can re-queue viaPOST /audit/deliveries/{id}/retry. - Sink receivers should deduplicate on
event_uuid.
Transport formats
HTTP
POST {target}Content-Type: application/jsonX-Praxis-Signature: sha256={hex} # when hmac_secret is configuredUser-Agent: Praxis-Audit/1.0
{ event JSON }Signature = HMAC-SHA256 of the request body bytes keyed with the sink’s secret.
Syslog (RFC 5424)
TCP (TLS by default, disable via config.tls=false). Octet-counting framing per RFC 6587. MSG part is the event JSON. Facility/severity configurable (defaults: user / informational).
File
JSONL append at the configured path. One event per line. Receiver is expected to rotate.
Versioning policy
We bump schema_version only for breaking changes (field rename, field removal, semantic change to an existing field). Additive changes (new actions, new context keys) do NOT bump version, so consumers must tolerate unknown fields.