Home / Trust / Audit Logging
Security policy

Audit Logging

What HealthOS logs, the properties every audit log has, and where each component of an audit record is found.

The NDIA asks for two things: a sample access and event audit log, and a data dictionary that maps the log's attributes to the key components of an audit record. This document is the dictionary. The sample is produced from a non-production stack holding invented data, never from a customer's.

What is logged

LogRecordsWritten by
platform.audit_logEvery change to a record: who, what, the old and new valuesRoute handlers and services, on create, update and delete
audit_access_logEvery read of a clinical record, including refused onesmiddleware/audit-access.ts, for every route that serves clinical data
platform.security_eventsRefused cross-tenant and token-misuse attemptsservices/security/security-events.ts — see security-events.md
platform.credential_access_logEach use of a stored government credential (load, sign, decrypt, refresh)The integration clients
platform.integration_auth_failure_logEach failed authentication to a government serviceThe integration clients
Per-integration logs (integrations.acws_audit_log, eclipse_audit_log, hi_service_audit_log, mhr_audit_log)Each call to that government service: operation, outcome, correlation idThe integration clients
Application logs (Log Analytics)Each HTTP request with its request id, and application eventsPino through Fastify

Properties that hold for all of them

  • Append-only. Each audit table has a BEFORE UPDATE OR DELETE trigger that raises an exception. A row cannot be changed or removed through the application's database role.
  • Retention. Seven years for the audit tables. Log Analytics retention is 90 days (infra/modules/container-apps-env.bicep).
  • Writing never blocks the work. An audit write that fails is logged (audit.write.failed) and the originating request continues.
  • Secrets and identifiers are kept out. Pino redacts tokens, keys, passwords, Medicare, IHI and DVA numbers, names, dates of birth and addresses before a line is written (utils/logging/redaction.ts). The integration logs store a hash of sensitive request parameters, not the parameters.
  • Time. Every timestamp is TIMESTAMPTZ, stored in UTC, set by the database server.
  • Correlation. request_id ties a row to the application log lines of the same HTTP request; correlation_id ties an integration row to the government service's own trace.

The key components, and where each is found

Audit componentaudit_logaudit_access_logsecurity_events
Whoperformed_by, performed_by_nameuser_id, user_nameuser_id, client_id
Whenperformed_ataccessed_atoccurred_at
What actionactionaction, methodevent_type, http_method
On whatentity_type, entity_id, person_identity_type, entity_id, person_id, pathroute
What changedold_values, new_values, changed_fieldsnot applicable (a read)not applicable
Outcomethe row exists only for a completed changeresponse_statusstatus_code, reason
From whereip_address, user_agentip_address, user_agentip_address, user_agent
Which tenantorganization_idthrough the user and the personorganization_id, claimed_org_id
Tracerequest_id—request_id

Questions about security? Email security@healthos.net.au