HAPI FHIR in NIS2 healthcare environments

A self-hosted HAPI FHIR server can support several NIS2 risk-management measures, but the operator must build the access, logging, backup, vulnerability and supplier controls around it and keep the evidence.

On this page

What HAPI FHIR in NIS2 healthcare environments needs to show

A healthcare entity classified as essential under NIS2 that runs HAPI FHIR can use the platform for some of the measures Article 21 requires, but the operator still owns the overall risk management, the evidence and the response to supervision. HAPI FHIR supplies building blocks, not compliance. NIS2 is Directive (EU) 2022/2555, so obligations reach the entity through the national transposition law of its Member State, and that law may add requirements. The directive creates no certificate of compliance. Instead, the national competent authority oversees the entity through inspections, security audits, security scans, information requests and administrative fines. Because the entity is essential, that oversight is ex ante, meaning the authority can check the entity's posture before an incident occurs, so evidence needs to exist and be current on day one.

On the server side, the platform helps most with access control and audit logging. The AuthorizationInterceptor, consent and search narrowing interceptors, authentication interceptors and BALP audit logging give the operator mechanisms to enforce and record who reads and writes FHIR resources. Backups, however, cover only the data stores: the operator must still schedule, encrypt, test and restore them, and must document the database and object storage behind the server. Vulnerability handling, patching of the JDK and application server, network segmentation, incident response, business continuity and supplier management are outside what the server provides. The operator must design and evidence these around the deployment, including its identity provider, reverse proxy, container platform and hosting provider.

Commission Implementing Regulation (EU) 2024/2690 sets technical and methodological requirements for the Article 21(2) measures, but it names specific sectors such as DNS, cloud, data center, CDN and managed service providers, and it does not list hospitals or general healthcare providers as its subject. Healthcare entities should therefore confirm with their national competent authority which references, standards and guidance apply to them, and whether the ENISA technical implementation guidance published in June 2025 is treated as the reference for their sector. Ask the authority which evidence it expects for access control and logging, and map each HAPI FHIR control to a named owner before an inspection begins.

How HAPI FHIR maps to NIS2 risk-management measures

This table compares each NIS2 Article 21 measure area with the HAPI FHIR building block that supports it and the configuration the operator must still set. Read each row as a starting point: the platform supplies components, while the entity remains responsible for the complete control, its policy and its evidence.

NIS2 requirementHAPI FHIR capabilityConfiguration the operator must set
Access control and authorization (Article 21)AuthorizationInterceptor and authentication interceptors provide building blocks for restricting FHIR operations. HAPI FHIR states it has no single security layer. See the HAPI FHIR security documentation.Define roles per resource type and operation, connect an external identity provider, and test that each role is denied what it should not reach.
Consent and minimum necessary dataConsent and search narrowing interceptors can limit what callers see in searches and reads. See the HAPI FHIR security documentation.Decide which consent states apply, map them to rules, and verify narrowing across search, read, history and chained queries.
Logging and audit trailBALP audit logging provides audit records of access. See the HAPI FHIR security documentation.Route audit records to a central, tamper-resistant store, set retention, and confirm that log integrity and access to logs are controlled.
Network and browser accessCORS support lets the server control cross-origin browser requests. See the HAPI FHIR security documentation.Restrict allowed origins, place the server behind a reverse proxy with TLS, and limit exposed endpoints.
Data separation and multi-entity hostingJPA partitioning places each resource in a partition for multitenancy, separate data sources or regional grouping. See the HAPI FHIR JPA partitioning documentation.Design partition boundaries with access rules, and confirm that partitioning is not treated as a substitute for authorization.
Backups and recovery (Article 21)Supported PostgreSQL and Microsoft SQL Server databases hold FHIR data for production. The platform does not provide backups.Set backup schedules, encryption, off-site copies and restore tests on the chosen database, and document recovery objectives you set internally.
Vulnerability handling and patchingVersion releases are published on GitHub, and the server runs on JDK 17 for version 8.2.0. Patching is the operator's responsibility.Track upgrades and JDK support, test changes in a non-production environment, and record patch decisions for assessors.
Supplier management and supportThe README points to Smile CDR for commercial support. Open-source use does not transfer supplier duties to the project.Document each third-party component, its licence (Apache Software License 2.0 for HAPI FHIR), and the support route you rely on.

How HAPI FHIR access control and audit logging support NIS2 duties

Access control on a self-hosted HAPI FHIR server is something you build, not something you switch on. HAPI FHIR provides building blocks rather than a single security layer, so the operator decides who can read or write which resources. The AuthorizationInterceptor is the main place to express those rules: it can allow or deny operations by resource type, compartment and user role. Authentication interceptors connect requests to an external identity provider, so that accounts, group membership and session lifetimes are managed where your identity team already manages them. Consent and search narrowing interceptors add a second layer by limiting which records a permitted user can see, for example by filtering search results to the patients or organizations they are allowed to view. Each of these needs a written role model first, because an interceptor can only enforce the roles you have defined.

Audit logging is the second half of the picture. BALP, the Basic Audit Log Pattern, records access events against FHIR resources so you can reconstruct who read or changed what and when. Confirm with your own team which events are captured, where the records are stored, who can read them, and how long they are kept. Logs written to the same server they describe are weak evidence, so plan a separate retention location with restricted administrative access. Network placement also matters: keep the database and administrative endpoints off public networks, and make sure the reverse proxy and identity provider log to the same central store so that a request can be traced end to end.

Partitioning is a further tool for separating data. HAPI FHIR JPA partitioning places each resource in a partition, which can separate data by region, by organization or by data source. This can limit the blast radius of a misconfigured permission, but it is a design decision, not a default. Confirm that the partition design matches your own risk assessment before you rely on it for separation. Finally, be clear with stakeholders that access control and logs support the risk-management measures in Article 21 of NIS2, but they do not, on their own, satisfy any NIS2 obligation. Incident reporting, vulnerability handling, backups and supplier management need their own evidence and owners.

Configuring NIS2 controls around a HAPI FHIR server

This sequence moves an essential healthcare entity from a classification question to a documented set of controls around a self-hosted HAPI FHIR server, with each step producing evidence a competent authority can review. The order matters because deployment, identity and logging choices depend on the risk assessment that comes before them.

  1. Confirm classification and national transposition law

    Start by confirming with your national competent authority whether your organization is an essential entity under Directive (EU) 2022/2555 and which national transposition law applies to you. Member States must apply their own transposition measures, so the Directive alone does not settle which obligations and supervision regime you face. Record the answer, the authority's contact point and the sector annex your activity falls under. The evidence is a signed classification note or written confirmation that defines the scope of every later step.

  2. Run a risk assessment of FHIR data and services

    Map which FHIR resource types, patient data flows, integrations and administrative functions the HAPI FHIR server handles, and rate the impact of loss, alteration or unavailability for each. Include the FHIR endpoints, the database, the identity provider, the reverse proxy and any consuming applications. The operator decides which assets are in scope for the Article 21 measures and which risk treatments are accepted. The output is a dated risk register that every later control references.

  3. Choose the deployment method and runtime

    Select how the JPA server starter will run: the hapiproject/hapi Docker image, a Helm chart on Kubernetes, or a WAR on Tomcat, Jetty or Wildfly. Confirm the JDK version that the chosen HAPI FHIR release requires, since 8.2.0 requires JDK 17 and newer releases may differ, so check the versions documentation before pinning. Decide who operates the cluster or host, who patches the base images and where the environment sits. The evidence is an architecture record that names each component, its version and its owner.

  4. Select PostgreSQL or SQL Server for storage

    Choose PostgreSQL or Microsoft SQL Server for production, because the starter defaults to an embedded H2 database and does not support MySQL. Decide how the database is hosted, how encryption at rest and in transit is configured, and who holds administrative credentials. Confirm that your backup tooling supports the chosen engine before any data is loaded. The output is a database specification and a signed decision that records why the engine was chosen and who is accountable for it.

  5. Wire authorization to an external identity provider

    Configure authentication so that users and applications sign in through your organization's identity provider, then use the AuthorizationInterceptor and related consent or search narrowing interceptors to limit what each role can read and write. HAPI FHIR does not provide a single security layer, so the operator must design the access model and test it against the risk register. Document which roles exist, who approves them and how accounts are removed when people leave. The evidence is an access matrix and test results showing that unauthorized requests are refused.

  6. Enable BALP audit logging and central collection

    Turn on BALP audit logging so that access to FHIR resources is recorded, then forward server, proxy and database logs to a central store that your security team can search. Set retention and access rules for the log store, and confirm that log timestamps are synchronized across components. Test that a sample access is recorded end to end, from the FHIR request to the central store. The evidence is a log source inventory, a retention statement and a test record showing one traced access.

  7. Define backup and restore testing

    Set backup schedules for the database and any configuration, secrets and container definitions the service needs to rebuild. Restore to a separate environment on a planned cadence, verify that FHIR data is complete and that the server starts, and record recovery times the team actually achieved. Decide who approves restore tests and where backup copies are kept. The evidence is a backup policy, dated restore test reports and a list of any gaps found and how they were closed.

  8. Set vulnerability handling and upgrade process

    Establish how the team tracks HAPI FHIR releases, JDK updates, base images and dependencies, assesses which vulnerabilities apply, and schedules upgrades in a test environment before production. Check each release's Java requirements and breaking changes before applying it. Decide who has authority to accept a risk when a fix is not yet available. The evidence is a documented patch procedure, a change record for each upgrade and a running list of assessed vulnerabilities with their dispositions.

  9. Record supplier responsibilities

    Write down who is responsible for each part of the stack: the open-source project, any commercial support contract, your hosting provider, the database vendor, the identity provider and any implementation partner. Confirm what each supplier commits to for security updates and incident notification, and what evidence they can provide. Review this record when a supplier changes or a contract renews. The output is a supplier responsibility matrix that shows every control from this sequence has a named owner.

Where the trust boundaries sit in a NIS2 HAPI FHIR deployment

The diagram starts with clients and the identity provider, which sit outside the operator's network zone. Requests pass through the reverse proxy, which terminates TLS, and then reach the HAPI FHIR JPA server, where the authorization and audit interceptors decide what is allowed and what gets logged. The server talks to the relational database inside the zone, sends BALP audit events to a central log store, and writes encrypted copies to a backup target. Check that every arrow crossing the zone edge is encrypted, that tokens are validated at the server rather than trusted from the proxy, and that the log store and backup target are under the operator's own control.

Trust boundary around the operator's network zone, with data crossing each edge.

Evidence a NIS2 supervisor may ask a HAPI FHIR operator to produce

NIS2 creates no certificate of compliance. National authorities check compliance through inspections, security audits, security scans and information requests, so the operator needs evidence that is current and easy to retrieve. The cards below cover the records that tie the HAPI FHIR server, its database and its supporting services to the measures the entity has adopted.

Risk assessment and policy set

The written risk assessment is the starting point for every other record a supervisor will ask for. For a HAPI FHIR server, it should name the FHIR endpoints, the patient data they hold, the database behind the JPA server, and the admin paths used to deploy and configure it. Keep the policies for access, logging, patching, backup and supplier management under version control with a dated owner. Review them after any material change to the deployment, such as a new partition, a new identity provider or a version upgrade. Owned by the security lead, with the platform team supplying the system description.

NIS2 text

Access control configuration and role reviews

Supervisors will want to see how the server decides who can read, write or export resources. Export the AuthorizationInterceptor rules, the authentication configuration tied to your identity provider, and the list of roles that map to clinical, support and administrative users. Store review records showing who approved each role, when it was last checked, and which accounts were removed. Confirm that administrative access to the database and the server host follows the same review cycle. Owned by the identity or platform team, with sign-off from the data owner for each role.

Audit log samples and retention settings

A supervisor may ask to see audit records for a specific user or resource and the retention period applied to them. Keep a documented setting for how long BALP audit entries and server logs are stored, where they are sent, and who can read them. Pull and file sample records from a recent period to show that access events are captured with the user, the resource and the action. Test that logs cannot be altered by the users whose activity they record. Owned by the operations team, with the security team reviewing samples each quarter.

Backup schedules and restore test records

A backup schedule shows what exists, but only a restore test shows that it works. Record the schedule for the PostgreSQL or SQL Server database, the retention period, the storage location and the encryption applied to backups. For each restore test, keep the date, the backup used, the restored environment, the time taken and the result. Include the search index and any file storage in the scope if the server depends on them. Owned by the database administrator, with the service owner accepting each test result.

Upgrade and change records

Every change to a HAPI FHIR deployment should leave a record. Log the HAPI FHIR version in production, the JDK version (version 8.2.0 requires JDK 17), the database schema version and the container image tag. Keep the change request, the test evidence from a non-production environment, the approval and the rollback plan. Supervisors often ask whether vulnerable components are updated on a known schedule, so note the release used for each update. Owned by the change manager, with the platform engineer recording the versions in the change log.

Vulnerability handling and supplier contracts

Two records cover third-party exposure: how vulnerabilities in HAPI FHIR, its Java dependencies and the base images are found and fixed, and the contracts that govern external support. Keep a scan history, the triage decisions and the dates on which fixes were applied. For suppliers, file the support agreement, the service levels, the security incident notification terms and the contact path for urgent patches. Commercial support for HAPI FHIR is provided through Smile CDR, so confirm the terms directly with that supplier and with any implementation partner. Owned by the procurement lead for contracts and the security team for scan records.

HAPI FHIR project

Vulnerability handling and supplier management for HAPI FHIR

Vulnerability handling for a self-hosted HAPI FHIR server starts with knowing when a new release exists. Subscribe the platform team to release notifications on the hapifhir/hapi-fhir releases page, and watch the hapiproject/hapi image tags and the Helm chart in use separately, because the application, the container image and the chart can move on different schedules. Record each release in a register with its date, its security relevance and a decision: adopt, defer with a reason, or reject. Under NIS2 the register is the evidence that the entity handles vulnerabilities in a planned way rather than reacting to incidents. Confirm with your own team how quickly a security-relevant release must be assessed under your internal policy and your national transposition law, since the directive sets the obligation without fixing an internal timeline.

Every upgrade should pass through a non-production environment that mirrors the production database engine, the application server and the reverse proxy. Test the schema migration against a restored copy of production data, not an empty database, and keep the JDK aligned with the release notes. The HAPI FHIR versions page states that release 8.2.0 requires JDK 17, so confirm the JDK your chosen release needs before scheduling the change. Check that the PostgreSQL or Microsoft SQL Server version is still supported by its vendor, and record the support end dates in the same register. Treat a failed test as a finding in the change record, not as a reason to skip the update.

On the supplier side, HAPI FHIR is licensed under the Apache Software License 2.0, so the entity has no license fee to pay, but it still needs a supplier decision. The README points to Smile CDR for commercial support. Document one of three positions for each HAPI FHIR component: rely on community releases with internal patching, buy a commercial support contract, or engage an implementation partner for build, testing and upgrades. Each position has a different owner for patch turnaround, and the choice should appear in the supplier register that NIS2 expects for critical dependencies. Review the container image, the Helm chart and the application server (Tomcat, Jetty or Wildfly) as separate dependency trees, using a software bill of materials and a vulnerability scanner on each build, and confirm who signs off each update.

What HAPI FHIR does not cover for NIS2

HAPI FHIR provides a FHIR API, authorization building blocks and audit logging, but it does not run the network, certificates, keys, backups or identity lifecycle around it. The cards below list the controls an essential healthcare entity must add and show who usually owns each one, so the NIS2 risk-management file reflects the whole service rather than the server alone.

Transport encryption and certificates

Every hop into the FHIR endpoint, from clients to the reverse proxy, from the proxy to the application server, and from the server to the database, needs TLS with certificates that your team issues, renews and revokes. Confirm who holds the private keys, how certificate expiry is monitored, and whether internal hops are encrypted or only the edge. Expired certificates are a common cause of outages, so the renewal process belongs in the risk assessment.

Encryption at rest and key management

HAPI FHIR stores clinical resources in a relational database, and the database files, replicas and backup copies sit in storage that the operator controls. Encryption at rest depends on the database, the volume or the cloud storage service, not on HAPI FHIR itself. Confirm where keys are generated, who can read them, how they rotate, and whether backup copies use the same key hierarchy as production data.

Network segmentation and firewall rules

The FHIR server should not be reachable from the internet directly, and the database should accept connections only from the application tier. Define which networks can reach the API, the administrative paths and the database port, and document the rules as part of the evidence for network security measures. Review the rules whenever the Kubernetes or hosting topology changes.

Incident detection and Article 23 reporting

Logs from HAPI FHIR, the proxy, the identity provider and the database have to reach a central place where alerts can fire. Article 23 sets reporting obligations for significant incidents, and your team must be able to determine significance and meet the reporting deadlines in the national transposition law. Confirm with your national competent authority which reporting channel and timelines apply to your entity.

NIS2 text

Backup restore testing and recovery objectives

A backup of the database is not evidence of recoverability until a restore has been completed and the FHIR server has been checked against it. Set recovery time and recovery point objectives with clinical owners, then test restores on a schedule and record the results. Confirm whether your national authority expects specific objectives, and keep the restore runbook with the HAPI FHIR configuration and search parameter state.

Identity lifecycle and access reviews

HAPI FHIR enforces authorization rules, but the accounts, roles and client registrations live in the external identity provider. Joiner, mover and leaver processes, periodic access reviews and removal of unused SMART client applications all happen there. Confirm who approves access, how often reviews run, and how revoked tokens reach the FHIR server in time.

Vulnerability scanning of the surrounding stack

HAPI FHIR releases and the Java runtime are only part of the attack surface. Container base images, the application server, the database, the reverse proxy and the Kubernetes nodes each need scanning and patch timelines. Confirm your vulnerability handling process with your supplier and with your own patch owners, and check that the Java version in use is still supported as the HAPI FHIR release line moves forward.

Questions healthcare teams ask about NIS2 and HAPI FHIR

What does NIS2 readiness work for a HAPI FHIR server cost?

No supplied source gives a price for this work, and DeployOpen does not publish a price list. A quote follows from a written scope. The main cost drivers are the number of environments (production, test, disaster recovery), how many systems sit in scope, how much identity integration is needed (single sign-on, role mapping, service accounts), the volume of evidence to collect and keep current, and whether a partner or your internal team does the work. Costs split into one-time work such as the gap assessment, control design and initial evidence, and recurring work such as log review, access reviews, patch cycles and backup tests. Ask any provider for a quote that separates these two groups and lists the environments and deliverables included.

How long does NIS2 work on a FHIR platform take?

Duration depends on the scope and on how much of the environment is already documented. Classification uncertainty is often the first delay: you need to confirm whether your entity is essential or important under Article 3 of Directive (EU) 2022/2555 before deciding which controls apply in depth. Legacy integrations that push or pull data outside the FHIR API extend the work because each one needs an access and logging review. Database choice matters as well, since the PostgreSQL or Microsoft SQL Server backend has its own backup, encryption and access settings. Internal approval cycles, change freezes and supplier contract reviews add time that no technical task removes. Ask for a timeline that lists the dependencies and the people who must approve each step.

What does our team need to provide for a NIS2 engagement?

The work needs named owners on your side, typically one for security, one for the platform and one for clinical or data governance, with authority to make decisions. It also needs read access to the infrastructure, including hosting accounts, Kubernetes or application server configuration, database settings and the identity provider. Existing policies, such as access management, incident response, business continuity and supplier management, are the starting point, so provide them even if they are out of date. Finally, agree change windows for configuration updates, restarts, schema changes and restore tests, because these affect clinical users. Missing any of these items usually shifts the schedule more than the technical work itself.

Can our own team handle NIS2 controls for HAPI FHIR without a partner?

Yes, for some controls, and a capable internal team can do much of the work. Use the NIS2 text in Directive (EU) 2022/2555 as the legal reference, the ENISA technical implementation guidance for examples of evidence, and the HAPI FHIR documentation for the configuration of authorization, audit and backup. Access control and logging are usually easier to keep in-house because they follow your identity and log tools. Penetration testing, independent review of configuration and cross-checks against the Implementing Regulation (EU) 2024/2690 for cloud and managed service providers are harder to self-assess objectively. Decide per control which work you can run, which needs an outside view, and who will keep the evidence current.

Is HAPI FHIR itself NIS2 compliant?

No. NIS2 does not certify software, and HAPI FHIR is a component you run, not a compliance product. The Apache Software License 2.0 project provides building blocks such as the AuthorizationInterceptor, authentication interceptors and BALP audit logging, and the project states that it does not provide a single security layer. Your organization, as the operator, is responsible for risk management under Article 21 of NIS2, for reporting under Article 23, and for the configuration, hosting, backups, patching and supplier management around the server. National competent authorities assess your entity through inspections, audits and information requests, not through a certificate for the software.

How could the COM(2026) 13 proposal change our NIS2 scope?

The Commission proposed targeted amendments to NIS2 on 20 January 2026 under COM(2026) 13, including a new small mid-cap category. It is a proposal only. It needs approval by the European Parliament and the Council before it changes the law, and Commission pages updated through July 2026 still describe it that way. Until then, plan against the current Directive (EU) 2022/2555 and your national transposition law, which may also set stricter rules under Article 5. Record how your classification was determined, review the proposal's status at each planning checkpoint, and ask your legal or compliance adviser how any final text would affect your entity.

How DeployOpen scopes and delivers NIS2 controls for HAPI FHIR

DeployOpen plans, implements, hardens, documents and supports self-hosted HAPI FHIR servers inside your own infrastructure, so the access control, logging, vulnerability handling, backup and supplier evidence NIS2 asks for can be reviewed by your team and your competent authority. Work starts from a written scope that maps the controls to the systems and suppliers in your environment.

How we scope

  • Inventory the HAPI FHIR servers, databases, identity providers and hosting that fall inside your NIS2 risk-management scope.
  • Agree in writing which Article 21 measures the engagement covers, and which remain with your own teams or other suppliers.
  • Confirm your sector, essential or important classification and the national transposition rules that apply in your Member State.

How we build

  • Configure authorization, consent and audit logging with the HAPI FHIR interceptors, integrated with your external identity provider.
  • Harden the JPA server deployment, database connections, secrets handling, TLS and reverse proxy settings in infrastructure you control.
  • Test the deployed server, including API authorization checks, and retest after fixes so the findings can be closed on record.

How we hand over

  • Deliver written configuration records, access matrices, logging and backup runbooks mapped to your control set and evidence requests.
  • Document the vulnerability handling, patching and upgrade procedure so your staff can run it after handover.
  • Walk your operations, security and compliance teams through the evidence pack and the open items that still need owner sign-off.

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer, scoped in writing to your HAPI FHIR estate.
  • Plan supported upgrades of HAPI FHIR and the JPA server, including Java version and schema migration checks before each change.
  • Keep supplier and dependency records current so your supplier management and incident reporting processes have accurate input.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.