Why restrict package download URLs in HAPI FHIR
A security team reviewing a HAPI FHIR server will reasonably ask one question early: which URLs is this server allowed to reach when it installs an implementation guide package? Installing a package means the server fetches a package archive, unpacks it and loads its profiles, value sets and other resources so that validation can use them. When the package location is a URL that can be supplied at runtime, the server is making an outbound request on behalf of whoever can trigger the install. Without a restriction, that request can be pointed at almost anywhere the server's network path reaches, including internal services that are never exposed to the internet.
That is the core risk the package URL allow list is meant to contain. A crafted URL can turn the server into a server-side request forgery (SSRF) tool against private addresses, cloud metadata endpoints or administrative interfaces. A URL can also name a local file system path or a classpath resource, which a fetch routine may read if it accepts those prefixes. Redirects add a second route: a permitted host can answer with a redirect to a forbidden destination unless the fetch logic checks each hop. The allow list, along with the related settings for private network rules, file and classpath prefixes and redirect handling, is the place where you decide which of these paths stay closed. You need this control when packages are installed from URLs at runtime, when the server sits in a network that also hosts internal services, or when auditors ask how outbound fetches are governed.
Treat the allow list as one control among several, not as a complete answer. Network egress rules, least-privilege service accounts, restricted install permissions and logging of every install request all reduce the same risk, and HAPI FHIR documents its security features as building blocks rather than a single layer. Before you write the configuration, confirm the exact property names, defaults and matching rules in the HAPI FHIR documentation for the version you run, since these settings change between releases. The HAPI FHIR versions page is the starting point for checking which version matches your deployment.
Allow list options and when each fits
This table compares the controls you decide on for package download URLs, from permitted prefixes and hosts to private address ranges, file and classpath prefixes, redirects and internal registries. Read each row for what it restricts, the deployment model it suits, and what it can break. Confirm the exact setting names and defaults in the HAPI FHIR documentation for your target version before you write configuration.
| Control | What it restricts | When it fits | Trade-off |
|---|---|---|---|
| Permitted URL prefixes | Limits package downloads to URLs that begin with approved prefixes, such as the public package registry path you have agreed to use. | Public registry only, where the server can reach one known package source. | Any package hosted at an unlisted path or mirror fails until you add its prefix and retest the install. |
| Permitted hosts | Limits downloads to named hostnames, independent of path, so the server accepts only approved origins. | Internal mirror, where one registry host serves all packages for the environment. | Hostname changes, new mirror nodes or DNS aliases need a configuration change and a review. |
| Private and loopback address ranges | Controls whether URLs that resolve to private, link-local or loopback addresses are fetched, which is the main server-side request forgery exposure. | Most deployments should block these ranges unless the internal mirror sits on a private address. | Blocking private ranges breaks installs from an internal mirror on a private network, so the mirror needs an explicit exception. |
| File and classpath prefixes | Decides whether package locations using file or classpath schemes can be read by the server. | Air-gapped builds that load packages from a mounted directory or bundled classpath resource. | Allowing these schemes lets a user point the server at local files, so keep them off in shared or internet-facing servers. |
| Redirect policy | Governs whether the server follows HTTP redirects and whether a redirect target must also match the allow list. | Public registry only, where you want redirects checked against the same rules as the original URL. | A mirror that redirects to a storage host outside the list will fail, and following redirects without checks can bypass the list. |
| Internal registry rules | Sets the specific prefixes, hosts or credentials used for an organization's own package source. | Internal mirror or private registry that replicates the public packages you approved. | Each registry needs an owner, a documented source and a review when its contents or location change. |
| Package source pinning | Ties installs to a known source and version set so the same package URL resolves identically across environments. | Regulated environments that must reproduce a validated configuration in test and production. | Pinning means mirrors must be kept in step, and updates to a package require a deliberate change. |
| Air-gapped package delivery | Removes outbound package fetches entirely and relies on packages loaded from approved storage inside the network. | Air-gapped networks with no route to public package sources. | Packages must be transferred, verified and loaded through a controlled process, and that process needs owners and records. |
Four request paths the allow list has to close
A package URL setting on a HAPI FHIR server makes the server fetch content from addresses you name, so each request path it can take is also a path an attacker or a misconfiguration can aim at. The four cards below cover the paths that matter most, and each one needs both an allow list rule inside HAPI FHIR and a control in the network around the server.
Server-side request forgery to internal hosts
If a user or admin can supply a package URL, the server may be used to send requests on their behalf to services it can reach but outsiders cannot, such as an internal admin console or a metadata endpoint on a cloud host. The allow list should accept only the registry hosts your team has approved, such as an approved package host, and reject everything else before a connection opens. Illustrative example: a URL pointing at an internal hostname is refused even though the server could resolve it. Outside HAPI FHIR, confirm that the server's egress rules block internal ranges that it has no reason to reach.
Requests to private and link-local ranges
Hostnames can be chosen to look public while resolving to private or link-local addresses, so a host check alone may not stop a request to an internal network or to an instance metadata address. Confirm which private and link-local rules the installed version applies, and test them with addresses you control rather than assuming coverage. Outside HAPI FHIR, check DNS resolution from the server's own network, because the address a name resolves to on your resolver is what counts. Treat this as a layer, not the only barrier.
File and classpath references that read local content
Prefixes such as file: or classpath: can point the loader at files on the server's disk or in its application archive instead of a remote registry. Such a reference may expose configuration, keys or other local content if the loader reads it and the result is returned or logged. The allow list should accept only the schemes you need, which for remote packages is normally https. Outside HAPI FHIR, confirm that the service account running the server cannot read sensitive paths, so a missed prefix does less damage.
Redirects that move a permitted URL
A URL on an approved host can respond with a redirect to a host that is not approved, and a fetch that follows the redirect bypasses a check made only on the first address. Decide whether redirects are followed at all, and if they are, check each destination against the same allow list. Outside HAPI FHIR, review whether the HTTP client or any proxy in front of the server follows redirects on its own. Test this with a redirect you host, pointing at a blocked address, before you rely on the rule.
How a package URL passes the allow list
An install request starts with a package URL from the caller. The HAPI FHIR server checks the scheme and prefix first, then the host against the allow list, and resolves the address against private network rules before any outbound fetch. Each redirect target goes through the same checks. Anything that fails is written to the rejection log. Check that the trust boundary sits where your outbound controls actually apply.
Each package URL and redirect target must pass the checks before install.
Configuring and testing the allow list before go-live
This sequence moves the package URL allow list from a draft to a verified setting in every environment. Each step ends with a check, so the team can show that permitted sources install and that internal, file, classpath and redirected requests are refused before the server handles real data.
Inventory every package source
The platform or integration owner lists every host the server must download packages from, including internal mirrors, artifact repositories and any public host that redirects to another domain. For each entry, record the scheme, host, port and owner. Confirm with the team that maintains each source whether it issues redirects. The finished inventory is the reference for every later step, and the check is a reviewed list that each source owner has confirmed.
Write the allow list entries
Using the inventory, the platform engineer writes one allow list entry per source, with no wildcards unless the source owner has approved a pattern. Keep entries in version control next to the rest of the server configuration. Confirm the exact property name and expected format in the official HAPI FHIR documentation for the release in use. The check is a peer review of the entries against the inventory, with every line traced to a named source.
Set private network and file rules
The engineer applies the settings that govern private network addresses, loopback and link-local ranges, and the file and classpath prefixes. The aim is to refuse any request that reaches internal addresses or local files, unless a specific internal mirror has been listed. Confirm the property names and defaults in the HAPI FHIR security documentation at the link below. The check is a documented table showing each rule and its intended behavior.
Set redirect handling
The engineer sets how the server treats HTTP redirects during package downloads. Redirects should be followed only when the final destination is also on the allow list, so a permitted host cannot send the server to an internal address. Confirm the property that controls redirects in the official documentation for your version. The check is a written statement of the redirect policy, agreed with the security team and tied to the inventory.
Apply settings in each environment
The platform team applies the same settings in development, test and production through the configuration mechanism used for the deployment method. For a Docker image this is usually environment variables or a mounted file, for Spring Boot it is the application configuration, for a WAR it is the configuration the application server reads, and for the Helm chart it is the values file. Confirm the correct location for your method in the official docs. The check is a comparison of the effective settings across environments showing no unexplained differences.
Test a permitted package install
The tester installs a package from a source on the allow list, using the method the team will use in production. Success means the install completes and the implementation guide appears as installed on the server. The tester records the request, the outcome and the server log entry for the install. The check is a saved record of the successful install, which becomes the baseline for later regression tests.
Test blocked requests and redirects
The tester sends three kinds of requests that must be refused: a package URL pointing at an internal address, a file or classpath reference, and a permitted URL that redirects to a host not on the list. For each one, the tester records the rejected response, the server log entry and the time of the test. Any request that succeeds is a finding to fix before go-live. The check is a test log showing every blocked case was refused, retested after each configuration change.
Allow list choices by deployment environment
A server that installs packages from the public FHIR package registry needs an allow list that names the registry hosts and nothing broader. Public registries can change hostnames, add mirrors and redirect downloads to storage endpoints, so the list must cover the hosts the install actually reaches, not only the address you configured first. Private network rules usually stay in place for everything except this outbound path.
- Shape: one or a few exact HTTPS prefixes for the registry, with no wildcard domains and no path prefixes wider than the package endpoints.
- Private network rules: keep blocks on loopback, link-local and internal address ranges, and open only the egress rule for the registry hosts through the proxy or firewall you operate.
- Staging: packages are fetched at install time, so record each package ID and version in your change record and confirm registry reachability inside the install window.
- Redirects: decide whether redirects to other hosts are denied or added to the list explicitly, because an approved host can redirect to an address you never reviewed.
- Logging: keep outbound request logs for the installer so you can show which hosts were contacted during each install.
Before you write the list, confirm the registry hostnames and redirect behavior in the documentation for your HAPI FHIR version.
A server that installs only from an internal mirror inside a private network should allow exactly one package source: the mirror. The allow list names the mirror hostname, port and path prefix, and nothing on the public internet is permitted. This case also needs an exception to the usual private address blocks, because the mirror sits on an internal range, so the exception must be narrow enough that other internal hosts stay unreachable.
- Shape: a single exact prefix for the mirror, including scheme and port, with no wildcard hostnames and no parent paths.
- Private network rules: allow the internal address of the mirror only, and keep the rest of the internal ranges blocked. Pin the mirror to a stable internal name so the rule does not depend on a changing address.
- Staging: the mirror is populated from an approved source, checked and frozen by version, and the server is pointed at the mirror only. Mirror content changes should go through the same change process as application releases.
- Redirects: configure the mirror so it does not redirect to public hosts, and deny any redirect that leaves the mirror prefix.
- TLS trust: confirm that the server trusts the mirror certificate chain through your internal certificate authority before the first install.
After any DNS, certificate or mirror address change, confirm that the mirror name resolves to the expected address and that an install fails closed when the mirror is unreachable.
An air-gapped server has no route to package registries, so the allow list covers only local sources: a read-only staging directory or an approved internal store. File and classpath prefixes change what the server may read from disk or from the application class path, so each prefix needs a deliberate review. The main risk is a prefix that is broader than the staging location, which can expose unrelated files to the package loader.
- Shape: the narrowest local prefix that holds the approved packages, with no parent directories and no shared home or temporary paths.
- Private network rules: remove all egress to public registries and confirm there is no default route that could reach them. Keep any internal store on a separate allow rule with its own host and port.
- Staging: move packages on approved media, verify checksums against the values from the source, record provenance, and load them into a non-production environment before production.
- Permissions: make the staging directory read-only for the service account, owned by the deployment role, and separate from the application data directories.
- Container and mount changes: when volumes, mount points or the installation path change, the prefix may point to a different location, so check each package path after every change.
Confirm with the documentation for your version how file and classpath prefixes are treated, and re-test the allow list after moving the server, changing mounts, or updating the internal store hostname.
How redirects and DNS resolution change what the allow list checks
A check on the URL as submitted is not enough to keep package downloads away from internal addresses. A host on the allow list can answer with an HTTP redirect to a different address, and a hostname that looks public can resolve to a private or loopback address. The operator's decision is therefore not only which hosts to permit, but whether the allow list is applied to the resolved target of every hop or only to the first URL a request names. Checking the literal string is cheap and catches obvious mistakes, but it does not see where the server connects.
Those two approaches lead to different settings. A literal check reads the scheme, host and path before the request leaves the server. A resolved-target check looks at the address the connection actually uses, and then again after each redirect. For redirects, the operator should decide the maximum number of hops, whether cross-host redirects are allowed at all, and whether a redirect to a non-allowed host fails the install or is logged. Timeouts matter because a slow or stalled response can hold a worker while the install retries. Proxy settings matter because an outbound proxy can resolve names on its own, which moves the check to a different network path. Confirm which of these the HAPI FHIR version in use enforces, and whether the package URL check runs before or after resolution.
Behavior differs between HAPI FHIR versions, so do not rely on documentation alone. Before you depend on the allow list, run a controlled test: publish a test package on an allowed host that answers with a redirect to a private address in your own lab, then attempt a $install or upload that references it. Repeat with a hostname whose record points at a private address, and with a proxy in the path. Record whether the request is refused, which address was contacted and what the log shows. Repeat the test after every upgrade, because a change in how redirects are followed can reopen a path that was closed.
Operational controls around the allow list
The allow list is only as strong as the controls around it. Egress rules, write access to configuration, change control, alerting, source review and retesting each keep the setting doing what the team intends after the first deployment.
Outbound egress rules
Enforce the allow list a second time at the network or container layer, so the HAPI FHIR server can reach only the package hosts you approved. The application check alone is not enough if a redirect or DNS change reaches an address the server should never contact. Check that the firewall or network policy blocks link-local, metadata and internal ranges from the server's network segment, and test it with a deliberately disallowed package URL. Owner: platform or network team.
Restricted write access to configuration
Limit who can change the server's properties, environment variables or Helm values that hold the allow list. Anyone who can edit that setting can widen what the server fetches, so treat it like a security control rather than an application option. Confirm that production configuration is changed only through the deployment pipeline, that operators cannot edit running containers, and that the service account has no write access to the configuration source. Owner: platform engineering.
Change control for allow list edits
Route every change to the allow list through a reviewed merge request with a named approver from security. Each entry should record the host, the reason it is needed, the requesting IG or project, and an expiry or review date. Ask for the change history and the approval record when a reviewer asks why a host was added. Owner: security with the application owner.
Logging and alerting on rejected requests
Send rejected package requests to your central log platform and alert on unexpected patterns, such as repeated rejections from an installation job or attempts to reach internal addresses. A rejection that nobody reads is a signal lost. Confirm which log lines the server writes for a blocked package URL and that the alert reaches an on-call queue. Owner: security operations.
Package source review on IG version changes
When a team moves to a new implementation guide version, review where the package is fetched from before the allow list is updated. A version bump can change the host, add a mirror or pull in dependencies from a different registry. Keep a record of the source URL, the package identifier and the version for each environment. Owner: the team that maintains the IG configuration.
Retesting after platform upgrades
Repeat the allow list tests after each HAPI FHIR upgrade, JDK change or base image update, because redirect handling, URL parsing and default settings can change between releases. Keep the test cases, including disallowed hosts, file and classpath prefixes and redirects to private addresses, in version control. Ask for the test results from the previous release as evidence. Owner: QA or the platform team.
Questions teams ask about restricting package URLs in HAPI FHIR
How much effort does it take to configure and test a package URL allow list?
Effort depends mainly on how many environments you run and how many package sources you must allow. A single environment with one or two known registries is a contained task: set the allow list, confirm that required IG packages still install, and test that blocked targets are refused. Each additional environment repeats the configuration and the test pass, and each one has its own network path, so its results need their own evidence. Ask any partner to split the quote by environment and by source, so you can see which part scales with your footprint and which part is a one-time design task.
Can our own team restrict package URLs without an outside partner?
Yes, if your engineers can read the HAPI FHIR security documentation, have access to the server configuration, and can run negative tests from the same network position as the server. The work is mostly configuration and verification rather than new code. Teams that struggle usually lack a clear list of required IG sources, have no staging environment to test installs safely, or do not have someone who can confirm network egress rules. A partner is most useful when those inputs are missing or when the controls must be documented for a security or compliance review.
What makes the allow list work harder than expected?
Four factors drive effort up: the number of package sources, whether the server runs in an air-gapped or heavily restricted network, the number of environments, and the number of teams that can request new IG packages. Each new source needs a review of its host, scheme and path, plus a test that confirms the server accepts it and still refuses nearby hosts. Air-gapped installs usually require an internal mirror or a pre-staged package process, which adds design and operations work. Ask for these inputs to be listed explicitly in any quote.
What do we need to provide before work on the allow list starts?
Expect to supply:
- A network diagram showing the HAPI FHIR server, its egress paths, proxies and any private address ranges it reaches
- A written list of the IG sources the server must install from, with owners who can approve changes
- Access to a non-production environment and a test window in which installs and blocked requests can be exercised
- Named contacts for the platform, network and security teams who will review the results
Without the list of sources, the allow list tends to be drafted too broadly or too narrowly, and both outcomes cause later rework.
How does the package URL allow list interact with HAPI FHIR upgrades?
Upgrades can change how IG packages are referenced and installed, so the allow list must be retested after each version change. Review the release notes for the target version, confirm the package identifiers and source URLs your IGs use, and rerun installs and blocked-request tests in staging before production. Keep the allow list in version control next to the deployment configuration so that changes to sources are reviewed like other code. Check the HAPI FHIR releases page for the version you plan to move to before scheduling the change.
Should a security test confirm the package URL controls?
Yes. Configuration review shows intent, but only testing shows whether the server actually refuses private addresses, file and classpath prefixes, and redirects to disallowed hosts. A test plan should cover direct requests, redirected requests, DNS names that resolve to private ranges, and mixed-case or encoded variants of allowed hosts. The output should be a findings list with retests after fixes, which gives your security and compliance teams evidence they can review. DeployOpen runs security testing of applications and infrastructure, but the assessment itself and any certification remain with your chosen independent auditor.
Who owns the allow list after the project is finished?
Your organization owns the allow list and its change process after handover. Decide in advance who may request a new package source, who approves it, and what test must pass before it reaches production. If the work is delivered under a fixed scope, the handover should include the configuration, the test cases, the environment notes and the steps for adding a source. Ongoing review can be handled internally or through a retainer, depending on how often your IG sources change.
Limits to confirm in your environment
The allow list only protects what it actually governs, and its behavior depends on the HAPI FHIR version, the hostnames your platform resolves, and every path that fetches packages. The cards below are items to verify with the vendor documentation, your platform team, or a controlled test in a non-production environment before you rely on them.
Property names and defaults
Confirm the exact configuration keys, their defaults and their accepted formats for the HAPI FHIR version you run. Property names and default behavior can change between releases, so a setting copied from an older example may silently do nothing. Check the version-specific documentation for your release, then read the effective value from the running server's configuration or startup logs rather than from your own files.
HAPI FHIR versionsRedirect and private network handling
Test whether the server follows HTTP redirects and whether it blocks private, loopback and link-local addresses as described for your version. A permitted public host that redirects to an internal address is the classic bypass for a URL allow list. Run a controlled test with a redirect you control and record whether the request reaches the internal target. Treat any gap as a finding to fix before go-live.
Hostname resolution in your platform
Confirm how the server resolves hostnames inside your container runtime, Kubernetes cluster or VM network. DNS records that point a permitted name at a private address, split-horizon DNS and cluster DNS suffixes can all change what the allow list actually sees. Ask the platform team which resolvers the pods use and whether egress proxies or NAT rewrite destinations, then verify resolution from inside the running container, not from an administrator workstation.
Reachability and stability of package sources
Confirm that every package source your organization needs is reachable from the server network and that it stays available. Some sites require a mirror or internal package repository, and each one must be added to the allow list with its exact host. Ask the platform team whether egress is restricted by firewall or proxy policy, and check the source's availability and versioning behavior with the publisher before you depend on it for installs.
Configuration delivery by deployment method
Confirm how settings reach the running server in your deployment model. A Docker image, a Helm chart, a WAR on Tomcat, Jetty or Wildfly, and a Spring Boot run each read configuration differently, and an override in one layer can be hidden by another. Ask the platform team to show the rendered configuration in the live pod or process, and confirm that the allow list survives image upgrades and chart redeployments.
Starter repositoryInstall paths that bypass the allow list
Confirm whether every IG installation route passes through the same URL checks. Uploads, runtime $install operations, startup configuration and any scripted loads may take different code paths, and one of them may skip the restriction. Use a controlled test that attempts a disallowed source through each route, and include the route in your change control so new install methods are reviewed before they are used.
How DeployOpen works on this
DeployOpen plans and delivers package URL allow list work for HAPI FHIR inside your own infrastructure, starting from a written scope that names the package sources, network boundaries and redirect rules your server may use. The work is tested against your environment, documented for your operators, and handed over with a clear plan for ongoing support.
How we scope
- Engagements are fixed-scope, with the package sources, private network ranges and file prefixes agreed in writing before work starts.
- We record which IG package hosts your environments need, so the allow list reflects real install paths rather than broad assumptions.
- The scope states which HAPI FHIR server deployments, configuration files and environments the work covers, and what it excludes.
How we build
- We configure the package URL allow list and its private network and file prefix rules in the starter configuration for your deployment.
- We test redirect handling by attempting installs from permitted and blocked hosts, including redirects that point to internal addresses.
- We verify that server-side requests to private network addresses, file paths and classpath prefixes are refused as the written scope requires.
How we hand over
- You receive the final configuration, a list of approved package sources, and the reasoning behind each allow list entry.
- Operators get a runbook covering how to request a new package host, who approves it, and how the change is tested before rollout.
- We document test cases and results so your security team can repeat the checks in each environment without our involvement.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers, including review when HAPI FHIR versions change.
- Retainer work can cover new package sources, changes to redirect policy and retesting after server upgrades.
- Ask for a quote based on the written scope, and confirm with us how the allow list will be reviewed after each HAPI FHIR upgrade.

