A Proof of Concept for RESTful ATNA Audit Event Ingestion on AWS
Healthcare systems need audit records that can support security, privacy, operational, and compliance investigations. An audit record must identify the relevant event, the participating actors, the source system, and the
Healthcare systems need audit records that can support security, privacy, operational, and compliance investigations. An audit record must identify the relevant event, the participating actors, the source system, and the record's time and outcome. The repository must also preserve the record and allow authorized users to retrieve it later.
The IHE Audit Trail and Node Authentication (ATNA) profile provides the relevant foundation. ATNA addresses node authentication, user authentication, audit logging, and secure communications. The RESTful ATNA supplement defines RESTful operations for submitting and retrieving audit records using FHIR R4 AuditEvent resources, alongside established syslog transports. The profile remains a Trial Implementation, so an implementation should state the exact profile, FHIR version, and transactions it supports.
This article describes an AWS proof of concept for a future RESTful ATNA Audit Event Ingestion service. The intended delivery model is an independently hosted service that can be offered through AWS Marketplace. The proof of concept accepts FHIR AuditEvent records, stores the submitted JSON, emits a CloudWatch metric for each authentication action, and makes the data available to Athena. It defines an ingestion path. It does not claim full ATNA conformance or provide every capability of an Audit Record Repository.
Scope
An audit service sits on a security boundary. It must accept events from clinical or supporting systems, preserve enough context to investigate them later, and avoid becoming the weak link in the security story.
An Audit Record Repository can receive audit records through syslog over TLS or UDP, and through an HTTP POST carrying a FHIR AuditEvent. Consumers can retrieve ATNA audit events with FHIR search or retrieve syslog records through RESTful operations based on syslog metadata.
The essential record is more than a timestamp and a message. A FHIR AuditEvent can describe the event type, subtype, outcome, participating agents, network context, and source system. In the prototype, a login event contains a DICOM-coded authentication event and a Login or Logout subtype, the requesting user, a source role, a network address, and a cloud-hosted web-server source.
The record structure supports queries by participant, outcome, event subtype, date, and source. It also permits a receiving service to retain the submitted audit evidence without first reducing it to a set of flat log fields.
RESTful ATNA ingestion transaction
The proof of concept exposes one public endpoint:
POST /AuditEvent
Content-Type: application/json+fhir
x-api-key: <key>
API Gateway accepts the request and applies a request validator. It passes the FHIR JSON body, request parameters, stage variables, and request context to a Node.js Lambda function. The function then:
- Copies the incoming AuditEvent and assigns a UUID.
- Extracts the first event subtype display value, such as Login.
- Sends a count metric named Auth to the ATNA CloudWatch namespace, with the action as a dimension.
- Serializes the full event and calculates a SHA-256 digest.
- Writes the JSON document to S3 using a key that includes the API key context, deployment intention, stage, and UTC date.
- Writes a companion .sha256 object alongside the event.
The S3 layout turns object storage into a simple event lake. Athena can define an external table over the JSON objects and project fields such as recorded, the first subtype display value, and the first agent name. A view can then provide an operational report without introducing a separate database for the proof of concept.
API Gateway provides the HTTP boundary. Lambda contains the event-specific processing. S3 retains the event documents. CloudWatch provides operational telemetry. Athena supports analysis of selected fields. This separation allows the service to retain the submitted event while maintaining a separate query path.
Figure 1. Implemented proof-of-concept request path
Implementation characteristics
The request path uses API Gateway, Lambda, S3, and Athena rather than a permanently running application server and database. This reduces infrastructure that an implementation team must operate and supports variable audit volume.
The implementation retains the submitted event as JSON. This avoids prematurely flattening nested agents, sources, subtypes, and other event content. Athena can project selected fields while the full submitted resource remains available.
The CloudWatch Auth metric is separate from the audit evidence. The stored event remains the detailed record. The metric can support dashboards or alarms and can later include dimensions such as outcome, provided the design avoids exposing sensitive information through metric labels.
The basic infrastructure template creates a private S3 artifact bucket, blocks public access, uses SSE-S3 encryption, and denies non-TLS S3 requests. The application stack uses an API key, a usage plan with throttling and quota settings, and a five-second Lambda timeout.
Conformance and production considerations
The repository and decks describe this work as a proof of concept. The implementation proves that a RESTful endpoint can receive an AuditEvent, preserve it in object storage, attach an integrity digest, produce a simple metric, and expose stored JSON to Athena. It also demonstrates a deployable split between basic infrastructure, environment resources, and application packaging.
The implementation does not yet provide a complete production ATNA repository. The source deck identifies rate limiting, microservice architecture, and metrics as gaps. The proposed next steps include private networking, PrivateLink, an image registry, CI/CD, branching and versioning, automated builds, quality and security gates, end-to-end testing, reporting, and reactive patterns.
The code adds other concrete review points:
- The endpoint validates the request envelope, but the AuditEvent schema in the template is intentionally minimal. A production service needs version-aware FHIR validation and clear handling for invalid or incomplete resources.
- The Lambda role uses broad managed permissions for S3 and CloudWatch. A production role should grant only the bucket, object prefix, and metric actions the function requires.
- The storage template marks the audit bucket private, but durable audit evidence also needs an explicit retention strategy, access logging, encryption policy, recovery plan, and protection against accidental deletion or alteration.
- A SHA-256 sidecar helps identify the exact bytes written, but it does not by itself establish an immutable chain of custody.
- The public API key suits a demonstration. A production authentication and authorization model needs stronger identity controls, rotation, tenant isolation, and an audit trail for access to the audit trail.
- The proof of concept uses a public API Gateway endpoint. The intended private API Gateway configuration did not support this deployment approach at the time of the proof of concept. A production offering can place its API Gateway endpoints behind private AWS connectivity and expose access through approved network paths.
- The current sample focuses on ingestion. An ATNA-aligned service also needs deliberate retrieval behaviour, search semantics, pagination, authorization, and performance controls.
These considerations define the boundary of the proof of concept. They should become explicit implementation requirements before the service receives production health information.
Production implementation path
The next implementation phase can retain the AuditEvent ingestion contract while strengthening each layer around it.
At the API boundary, validate FHIR resources against the intended version and profile, apply authentication that identifies the calling system, set request-size limits, and return meaningful FHIR OperationOutcome responses. Use throttling as a protection mechanism, not merely a billing control.
In the processing layer, make the write path idempotent and define how the service handles duplicate events, partial failures, and downstream outages. Add structured application logs and metrics for accepted, rejected, delayed, and failed events. Include outcome and source dimensions where they help operations without exposing sensitive details in metrics.
In storage, separate immutable raw evidence from derived query data. Apply encryption, narrow bucket policies, retention and legal-hold decisions, lifecycle rules, and access monitoring. Partition queryable data by a time dimension chosen for the reporting workload. If records require transformation, keep the original resource and record the transformation lineage.
For network and deployment design, move private producers to private connectivity where appropriate, package the service consistently, and use CI/CD to run tests and security checks before release. The source material already points toward VPC endpoints, PrivateLink, container image handling, automated builds, static analysis, vulnerability scanning, and end-to-end tests. Those are concrete engineering tasks, not generic aspirations.
Finally, treat retrieval as a first-class feature. An audit log offers value when authorized investigators can find the correct evidence quickly and reproduce a result. Define the FHIR search parameters and any syslog metadata queries that the service supports, then test them with realistic volumes and access policies.
Private and public API deployment models
The proof of concept uses a public API Gateway endpoint for RESTful ingestion. A future deployment can use AWS private API Gateway endpoints for all service APIs, with VPC interface endpoints and PrivateLink where customer connectivity requires it. This allows a customer to keep traffic on approved private network paths while the service remains independently operated and suitable for AWS Marketplace delivery.
Figure 2. Proposed marketplace-ready deployment model
The source slides describe a layered future-state architecture. The diagram distinguishes the public endpoint used in the proof of concept from the private API model proposed for the hosted service.
flowchart LR
app[Secure Application]
subgraph customer[Customer AWS account]
app
endpoint[VPC interface endpoint]
end
subgraph poc[Proof-of-concept interface]
publicapi[Public API Gateway]
end
subgraph private[Future private AWS interface]
privateapi[Private API Gateway]
privateLink[PrivateLink]
nlb[Network Load Balancer]
legacy[Legacy ATNA extension]
endpoint --> privateapi --> rest
endpoint --> privateLink --> nlb --> legacy
end
subgraph core[ATNA core services]
rest[RESTful ATNA service]
store[(Secure storage)]
observe[CloudWatch]
analytics[Athena]
dashboard[Visualization and reporting]
rest --> store
rest --> observe
store --> analytics --> dashboard
end
app -->|HTTPS FHIR AuditEvent<br/>Proof of concept| publicapi --> rest
app -->|Private connectivity| endpoint
legacy -.->|Audit records| store
Summary
ATNA can use a compact managed-service implementation for RESTful ingestion. This proof of concept receives FHIR AuditEvent resources, retains submitted evidence, produces operational telemetry, and supports exploratory analysis with a small set of AWS services.
The audit repository must define controls around that path: profile validation, narrow permissions, durable retention, private connectivity where required, observable failures, and controlled retrieval. The proof of concept identifies the core request path and the work required to make that path suitable for production use.
This article describes a 2022 proof of concept. RESTful ATNA and IHE Basic Audit Log Patterns are based on FHIR R4. Review all AWS, IHE, FHIR, and HIPAA-related statements against current guidance before production use.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.