Loki for HIPAA audit controls

Loki can collect, retain, tenant-separate and access-control the activity logs that support HIPAA audit controls, but it does not make an entity compliant on its own. This page maps the requirements to configuration and evidence.

On this page

How Loki supports HIPAA audit controls for ePHI systems

If you are a covered entity or business associate, 45 CFR 164.312(b) requires hardware, software and/or procedural mechanisms that record and examine activity in information systems that contain or use electronic protected health information (ePHI). Self-hosted Loki can serve as the logging and review layer for that requirement: it collects events from the systems that touch ePHI, stores them in object storage you control, and gives reviewers a query interface in Grafana. Loki does not satisfy the rule on its own. The standard is about the whole mechanism, so the surrounding decisions about what gets logged, who reviews it, how often, and what happens when something looks wrong remain with your policies, your security staff and any other tools you run, such as a SIEM or an endpoint monitoring product.

Loki covers the record-keeping and retrieval parts well when it is configured deliberately. Log sources such as application servers, identity providers, database audit output and the systems that grant access to ePHI can be shipped with Grafana Alloy, and retention is set in the compactor, which is disabled by default, so you must enable it and choose periods that match your documentation rules. Tenant separation through auth_enabled and the X-Scope-OrgID header helps keep logs from different systems or business units apart. What Loki does not provide is an authentication layer, a review procedure or a decision on which events count as suspicious. Confirm with your security officer which event types must be captured for each ePHI system, who reviews them and on what schedule, and how review is documented. Those answers define the control. Loki is the tool that holds the evidence.

There is no HIPAA certification. HHS states that no Security Rule standard requires an entity to certify compliance and that HHS does not endorse private certifications, so any vendor or consultant who offers one should be questioned closely. DeployOpen plans, deploys and hardens the Loki setup, prepares configuration and evidence such as retention settings, access records and review logs, and documents how the control operates. We do not issue audit reports or attestations. Enforcement sits with the HHS Office for Civil Rights, which reviews compliance through complaints, compliance reviews and audits, so the question to answer before any of those reviews is whether your records show that the mechanism runs and that people act on what it records.

Which HIPAA requirements Loki maps to and how to configure it

This table maps the HIPAA Security Rule provisions that log data supports to the Loki capability that helps and the configuration it needs. Read each row for what Loki covers, what it only partly covers, and what remains a process or policy decision outside the log store. The main takeaway is that Loki supplies collection, retention and access mechanics, while the covered entity still owns the audit review procedure and the decision about which systems and events count as in scope.

RequirementLoki capability and configurationCoverage
45 CFR 164.312(b) audit controls: record and examine activity in systems that use ePHIShip audit-relevant events from each ePHI system with Grafana Alloy. Set auth_enabled to true and use per-tenant or per-stream retention. Define the event list before go-live.Partial: Loki records and stores events; the examination procedure and event selection are yours
164.316(b)(2)(i) six-year documentation retentionSet retention_enabled and per-stream selectors so audit records are kept at least six years where the documentation rule applies. Confirm whether the rule reaches log data in your risk analysis with counsel.Partial: retention is configurable, but applicability to log records is a legal interpretation to confirm
164.312(a)(2)(i) unique user identification (required)Place Loki behind an authenticating reverse proxy such as OAuth2 Proxy or Pomerium, so each query and ingest request maps to a named identity. Do not rely on shared service accounts.Partial: Loki does not authenticate users itself; identity must come from the proxy and source systems
164.312(a)(2)(iii) automatic logoff (addressable)Logoff events from source systems are sent to Loki for review. Session timeout for Grafana and the proxy is configured outside Loki.Partial: Loki stores logoff events only; the logoff control lives in the source system and proxy
164.308 review and incident procedures that consume log dataUse Grafana queries and Loki ruler alert rules to support periodic log review and incident triage. Keep ePHI out of labels so queries and alerts do not expose patient identifiers.Partial: Loki supports review tooling; the written review schedule and incident response steps are policy work
Tenant separation of ePHI-bearing logs from other dataEnable auth_enabled and assign a distinct X-Scope-OrgID per environment or covered system. Limit query access per tenant at the proxy.Covered by configuration, subject to proxy enforcement of tenant headers
Access to the logs themselvesRestrict who can query, delete or change retention. Use a separate admin path for the compactor and delete API, and keep audit records of those actions.Partial: Loki has no built-in role model in open source; access control depends on proxy and infrastructure

What activity to collect from ePHI systems

The first decision is which activity to record. 45 CFR 164.312(b) requires hardware, software and procedural mechanisms that record and examine activity in information systems that contain or use ePHI, but it does not list the events that must be captured. The covered entity or business associate has to choose and document its own event sources, based on a risk analysis of where ePHI lives and how it moves. In practice, the candidate sources usually fall into five groups: authentication events (successful and failed sign-ins, MFA challenges, session starts and ends), record access and changes in EHR, billing and document systems, administrative actions such as configuration changes and account creation, privilege changes such as role grants and group membership edits, and system events on servers, containers and applications that host or process ePHI. Each group should name the systems in scope, the log source that produces the event (application audit tables, operating system logs, Kubernetes audit logs, identity provider logs) and the Alloy or OpenTelemetry pipeline that ships it to Loki.

For guidance on the choices, NIST SP 800-66 Rev. 2 (February 2024) is the useful companion. It is informational rather than binding, but it gives key activities and sample questions for each Security Rule standard, which helps you test whether your chosen sources answer the questions an assessor or OCR investigator would ask. Record the mapping from each event source to the standard it supports, and note which addressable specifications you judged reasonable and appropriate, with the reasons. Confirm with the application owners whether their systems emit the fields you need, such as user identity, patient or record identifier, action and outcome, and timestamp, before you commit to a source. Where an application cannot produce them, document the gap and the compensating measure.

Keeping ePHI out of Loki labels and log lines

Loki indexes labels and shares them across every query, so a patient identifier in a label spreads far beyond the record it came from. The controls below keep identifiers in log lines or out of the stream entirely, and each one needs to be verified in your own environment before you rely on it for the HIPAA audit trail.

Why labels are the main exposure

Loki builds its index from stream labels, and every label value creates a stream that is stored and matched in queries. A patient name, medical record number or free-text clinical note used as a label becomes an indexed value visible to anyone who can query that tenant, and it is hard to remove once written. Treat labels as the metadata you would publish, and keep ePHI in log lines only where access controls already apply.

Redact at the shipper with Alloy

Grafana Alloy is the supported shipper for Loki, so it is the natural place to remove or mask identifiers before logs leave the host. Pipeline stages can drop fields, replace values matching identifier patterns and reshape records. Confirm the exact stage configuration against the Alloy version you deploy, and test it with sample records that contain realistic but synthetic identifiers.

Loki send data docs

Allowlist the labels you accept

Define a fixed set of labels such as environment, service, host and log level, and have the shipper drop everything else before it reaches Loki. Free-form keys added by application frameworks are the usual way identifiers leak into labels. Review the allowlist with the application owners, record it as a configuration baseline, and change it through the same approval process as other access-relevant settings.

Log opaque record IDs

Where investigators need to tie an event to a patient record, log an opaque internal identifier rather than the medical record number or name. The mapping from that identifier to the patient is held in the source system or a restricted store, with its own access controls. Document the mapping location and owner, so an auditor can see how a log entry is traced back without the log itself carrying ePHI.

Review application log formats

Before onboarding a system, review what its developers log on login, record access, errors and exports. Stack traces, request bodies and debug output often contain clinical text or identifiers, and that content can change with each release. Set a rule that log format changes are reviewed for ePHI, and keep a sample of each application's current output in the system documentation for the auditor.

Scan ingested samples continuously

Run scheduled tests that sample recently ingested log lines and check for identifier patterns, such as names beside record numbers, dates of birth or sensitive free text. Failed checks should raise an alert and pause the affected pipeline if your procedures require it. Keep the test definitions and results, since they show the control operated over time. Confirm the scanning approach and its false-positive handling with your privacy and security teams.

Tenant separation for covered and non-covered workloads

Placing every ePHI-bearing system in a single tenant is the simplest model to run. One X-Scope-OrgID value covers all of those log streams, so retention, limits and dashboards are configured once, and an investigator can correlate events across applications without switching context. The cost is that everyone who can query that tenant can see logs from every ePHI system in it, so access has to be controlled at the proxy or in the dashboard layer rather than inside Loki.

  • Access: Anyone granted the tenant ID through the reverse proxy can read all ePHI logs in it, so proxy group mapping must be narrow and reviewed.
  • Operations: One set of per-tenant limits and retention rules applies to every system, which keeps configuration small.
  • Query scope: Cross-system investigations are straightforward because all events sit in one place.
  • Blast radius: A misconfigured proxy rule or dashboard exposes the whole ePHI set at once.

Confirm with your security team whether a single-tenant model satisfies your access review requirements before you rely on it.",

Setting retention against the six-year documentation rule

Loki keeps logs indefinitely until you turn retention on, so the retention setting is a compliance decision you make on purpose, not a default you inherit. Retention is applied by the compactor and is disabled by default, which means nothing is deleted until retention_enabled is set. Once you enable it, you can define retention globally, per tenant, or per stream selector, and each stream rule must be at least 24 hours. For HIPAA audit controls, this gives you a practical way to keep audit-relevant streams from systems that hold ePHI longer than general operational logs, provided the compactor is running and the rules are tested against a sample tenant before they reach production.

The six-year figure in 45 CFR 164.316(b)(2)(i) applies to Security Rule documentation: policies, procedures and the records of actions or assessments required by the rule, retained for six years from creation or from the date last in effect, whichever is later. The rule does not say that audit logs must be kept for six years. Your organization therefore has to decide which log streams are documentation that supports a documented policy or assessment and which are operational data with a shorter need. Record that decision in your policy, map each retained stream to it, and keep the reasoning with the configuration so an auditor can follow it.

Confirm the final retention periods with your privacy counsel and against your own documented retention policy before you set them, because counsel and your policy decide what counts as documentation in your environment. Also confirm how long your business associate contracts and any state law requirements expect records to be kept, since these can be longer than the federal Security Rule minimum. Once periods are agreed, verify that the compactor is applying them and that deletion behaves as your policy describes, and note in the decision record that logs under legal hold or in backups may not follow the same schedule.

Evidence Loki produces and how to keep it

A HIPAA review of a Loki deployment rests on records you can show, not on the log platform alone. The cards below cover the artifacts an auditor or OCR reviewer is likely to ask for and how to keep each one in a form you can produce on request. This evidence supports your own compliance work and does not amount to an attestation or certification.

Documented log source inventory

Keep a written list of every system that creates or uses ePHI and the log sources feeding Loki for each one, including applications, databases, identity providers, reverse proxies and the Grafana instance itself. Record the collector, the labels applied and the retention rule that applies. Store the inventory in the same repository as the Loki configuration, so a change to a shipped source requires a matching change to the list. Ask your team to confirm the list against live sources at each review, since drift between the inventory and the running system is a common finding.

Retention configuration in version control

Commit the Loki configuration that sets retention, including the retention_enabled flag, global and per-tenant limits and any per-stream selectors, to a Git repository with reviewed changes. Retention is disabled by default, so the committed file should show it explicitly enabled. Tag releases of the configuration so you can show which retention settings applied on a given date. Documentation rules for HIPAA require six years of retention for Security Rule documentation, which is a separate question from how long audit logs are kept, so record both decisions with their rationale.

Documentation retention
6 years
Loki retention docs

Tenant and reverse proxy access configuration

Loki has no built-in authentication layer, so the reverse proxy that authenticates users and sets tenant identity is part of the audit control. Keep the proxy configuration, the mapping from identity groups to the X-Scope-OrgID header and the setting that enables multi-tenancy under version control. Export the list of tenants and the users or groups allowed to query each one. Review changes to this configuration as you would changes to any access control, because a misrouted header can expose one tenant's logs to another team.

Loki authentication docs

Access logs for the Loki query path

Record who queried Loki, when, from which address and against which tenant. Access logs from the reverse proxy and the Grafana instance are the primary source, and they should be shipped to a separate, access-restricted store so that administrators of Loki cannot alter their own query history. Confirm that these logs capture query text where your policy allows it, and that they reference the authenticated user rather than a shared account. Reviewers will ask whether these records exist for the period under review, so retention for them should match or exceed the period covered by the audit log.

Log review records and follow-up investigations

The Security Rule's audit control expects that activity is examined, not only recorded. Keep dated records of periodic review of Loki-collected logs, including who reviewed them, which queries or alert rules were used and what was found. For each finding, link the investigation ticket, its outcome and any corrective change. Ask your team to define the review frequency in a written procedure before the first review, so the records show that the procedure was followed rather than assembled after an incident.

Retention proof from object storage

Export the lifecycle or retention settings on the object storage bucket that holds Loki chunks and index data, and keep dated copies alongside the Loki configuration. Compare them with the retention periods your documentation states. Confirm whether the bucket has versioning, object lock or an equivalent control that prevents early deletion by administrators, and record the answer. Where the storage is Amazon S3, Google Cloud Storage or Azure Blob Storage, the provider's own settings are the evidence, so capture them directly rather than relying on a description.

Controlling access to the logs themselves

Audit logs about systems that hold ePHI are sensitive in their own right, because they reveal who looked at which records and when. The section of the Security Rule that asks for mechanisms to record and examine activity (45 CFR 164.312(b)) does not stop at collection. The log store must also resist unauthorized reading and unauthorized alteration, and those two protections need separate controls. Start by writing down the actors who may write to Loki, who may query it, and who may change its retention, tenant and limit settings, then enforce each boundary in a different place.

Restrict the write path first. Only Grafana Alloy instances or other shipping agents that hold their own credentials should push to the Loki push endpoint, and every tenant should be bound to the X-Scope-OrgID header that the authenticating layer sets, not one a client chooses. Loki has no built-in authentication layer, so the reverse proxy in front of it (nginx, HAProxy, OAuth2 Proxy or Pomerium, as the Loki authentication documentation describes) must reject unauthenticated pushes and strip any tenant header supplied by a caller. For query access, route Grafana and command-line users through the same proxy with SSO, and keep human accounts off the write path. Confirm each of these behaviors in your chosen proxy's documentation and test them with a rejected push and a rejected cross-tenant query before go-live.

Restrict the administrative plane separately. Retention, per-tenant limits and the auth_enabled setting live in configuration and runtime overrides that a small operator group should control through version-controlled changes with review. Make sure that the people who can edit retention rules are not the same people who can read the tenant they govern, and record every configuration change in your change system. For object storage, confirm with your provider whether the bucket supports separate read and write roles, deny-delete policies, object versioning or object lock for the chunk and index prefixes. The supplied facts do not establish which immutability features each object store offers for Loki, so treat that answer as an open item to confirm before you rely on it.

What Loki does not cover for HIPAA

Loki records and stores activity, but it does not make an organization HIPAA compliant. The cards below name the gaps that other controls, documents and contracts must cover before Loki's logs can support the Security Rule's audit controls standard.

No built-in authentication

Loki has no authentication layer of its own. Its documentation requires an authenticating reverse proxy such as nginx, HAProxy, OAuth2 Proxy or Pomerium in front of it. Until that proxy enforces identity, every request reaching the push and query endpoints is effectively unauthenticated, so the logs of ePHI systems could be read or altered by anyone with network reach. Check that the proxy, the network path and the tenant header policy are all tested and reviewed as part of the audit control design.

Loki authentication docs

No HIPAA certification exists

HHS states that no Security Rule standard requires an entity to certify compliance, and it does not endorse or recognize private certifications. A Loki deployment therefore cannot be certified as HIPAA compliant, and a vendor or consultant claim of certification should be treated as a red flag. Evidence of audit controls should be built as documented operating records that the HHS Office for Civil Rights could review through a complaint, compliance review or audit.

HHS certification FAQ

Risk analysis and policies sit outside Loki

The Security Rule requires a risk analysis and documented policies and procedures, including decisions about which activity to record, who reviews it and how often. Loki stores whatever pipelines send to it and cannot make these decisions. Confirm that your risk analysis names the systems that hold or use ePHI, that your policies assign log review ownership, and that each addressable specification has a documented decision.

Business associate contracts for hosted logging

Under 45 CFR 164.314(a)(2)(i), a business associate contract must require the business associate to comply with the Security Rule, flow the same terms down to subcontractors that handle ePHI, and report security incidents to the covered entity. If a managed service provider, hosting company or cloud operator runs the Loki cluster or stores its object storage buckets and can access ePHI-derived logs, a contract is needed. Ask your counsel whether logs containing ePHI make that provider a business associate.

45 CFR 164.314 text

Logs are not reviewed or alerted on by default

The audit control standard requires mechanisms that record and examine activity. Loki records activity, but it does not decide what is suspicious, send alerts or review entries on its own. Someone must write the queries or alert rules, route alerts to people who can act on them, and record each review. Without that staffed workflow, the logs are a store of evidence that nobody reads, and an incident may go unnoticed until it is reported to you.

Security Rule revision not yet final

HHS proposed a major Security Rule revision on January 6, 2025, and the Federal Register entry for it is at 90 FR 898. As of October 2026 no final rule has been published, and the Unified Agenda projects final action for July 2027. Track the rulemaking and plan for changes to the current standards, including any new logging or monitoring expectations. Current obligations under the existing rule still apply in full until a final rule takes effect.

Proposed rule text

Grafana Enterprise Logs features are commercial

Token authorization, label-based access control and cross-tenant queries are features of Grafana Enterprise Logs, a commercial product, not of open-source Loki. If your access model depends on label-based restrictions on who can read which streams, plan for that control in another layer or confirm its availability and terms with Grafana Labs before design work starts. Open-source Loki still needs tenant separation and access control provided by your proxy and Grafana configuration.

Enterprise Logs docs

Configuration sequence for HIPAA audit logging in Loki

This sequence turns a set of ePHI systems into a Loki deployment that records activity, keeps tenants and labels controlled, retains logs against a documented rule and restricts who can read the logs. Each step ends with a check the team confirms in its own environment before the next step starts.

  1. Scope the ePHI systems and document the risk analysis

    The compliance lead and system owners list every system that creates, receives, maintains or transmits ePHI, including the identity provider, the reverse proxy, and any host or application that writes logs about those systems. The risk analysis records which activity must be examined and why, since 45 CFR 164.312(b) requires mechanisms that record and examine activity in systems that contain or use ePHI. The step is done when each in-scope system has a named owner, a log source list and a signed-off scope document that the audit team can read without asking follow-up questions.

  2. Choose the deployment mode and object store

    The platform team selects a deployment mode from the Loki deployment modes documentation based on the daily log volume measured from the in-scope sources, and selects a production object store that the organization can place under its own controls. Because the simple scalable mode is being deprecated ahead of Loki 4.0, teams should confirm which mode fits their volume and plan for that change. The step closes when the sizing worksheet, the chosen object store and the data residency location are documented and approved by the security owner.

  3. Enable authentication and place a reverse proxy in front

    The platform team sets auth_enabled to true so Loki enforces tenant identification through the X-Scope-OrgID header, then deploys an authenticating reverse proxy such as nginx, HAProxy, OAuth2 Proxy or Pomerium in front of Loki, because Loki does not provide its own authentication layer. Clients must reach Loki only through the proxy, and the proxy must bind user identity from the organization's identity provider. The step is complete when an unauthenticated request is refused, and an authenticated user can reach only the tenants that their role allows.

  4. Define tenant IDs and the label policy

    The architect defines tenant IDs for each separation boundary the audit requires, such as production ePHI systems apart from non-clinical environments, and writes a label policy that allows only low-cardinality, non-identifying values such as environment, application, host role and log type. Patient identifiers, names, medical record numbers and free-text clinical content must not become labels. The step is verified by reviewing the policy against sample events from each source and confirming that no sampled label contains an identifier.

  5. Configure Alloy with redaction before shipping

    The platform team configures Grafana Alloy, the supported log shipper, to drop or mask ePHI in log lines and to attach only the approved labels before data leaves each host. Redaction rules are tested against representative log samples, including error messages that echo request payloads, and the team records which fields are removed so the auditor can see the control. The step is done when test events leave the sending host with the expected fields and no identifiers in labels or the stored line, and the pipeline configuration is under version control.

  6. Set retention and per-stream rules

    The platform team sets retention_enabled, because retention is disabled by default and logs are kept indefinitely until it is turned on, then writes per-tenant or per-stream retention rules that match the documentation retention period chosen by the compliance owner. Each stream rule must run for at least 24 hours, and the compactor must be running for retention to apply. The step closes when a test stream with a short rule is confirmed deleted on schedule and the production rules match the written retention decision.

  7. Restrict access to the logs and test it

    The security team grants read access to the logs only to roles that need it, such as the audit reviewers and on-call responders, and keeps write, delete and administrative actions with a small set of platform administrators. Access is tested from the outside by attempting queries as each role, including attempts to query another tenant and to reach Loki directly without the proxy. The step is verified by a written access test result that shows each role's allowed and denied actions, with any gaps fixed and retested.

  8. Document the review procedure and retain evidence

    The compliance lead writes the review procedure that states who examines which logs, how often, what they look for, and how a suspicious finding is escalated to incident response. The team retains the scope document, risk analysis, configuration files, access test results and review records for the documentation period, which 45 CFR 164.316(b)(2)(i) sets at 6 years from creation or from the date last in effect, whichever is later. The step is complete when a sample review can be traced from a recorded event to the reviewer's signed note.

Questions buyers ask about Loki and HIPAA audit controls

Does Loki alone satisfy the HIPAA audit controls requirement in 45 CFR 164.312(b)?

No. Loki is one part of the mechanism. Section 164.312(b) requires hardware, software and/or procedural mechanisms that record and examine activity in systems that contain or use ePHI, so the audit control depends on what Loki collects, how people review it and how the review is documented. Loki stores and queries logs, but it does not decide which events matter, who reviews them, how often, or what happens when something looks wrong. Those procedures belong in your policies and runbooks. Before relying on Loki, map each ePHI system to its log sources, confirm that the records you need are generated at the application or host level, and agree a review routine with your security team.

What drives the cost and effort of a HIPAA-oriented Loki deployment?

The main drivers are the number of ePHI systems in scope, how many log sources each one has, and how you separate tenants and teams. Each source needs a shipping agent configuration, field and label review, and testing. Reverse proxy and SSO work adds effort because Loki has no built-in authentication layer and the documentation says an authenticating reverse proxy must sit in front of it. Retention and storage design, including how long you keep logs and where they sit in object storage, affects both the build and the recurring storage bill. Review procedures, alert tuning and evidence collection are ongoing. Ask any partner for a quote that itemizes these components, separates one-time build work from recurring operations, and states which systems are excluded.

How long does a Loki audit logging project take, and what does the timing depend on?

The supplied sources do not give a standard duration for this work, so treat any timeline as something to agree in writing. The schedule depends on how many ePHI systems are in scope, whether their logs can be shipped without application changes, how quickly your identity and network teams can deliver a reverse proxy and SSO integration, and how many review and approval cycles your compliance team requires. Deployment mode also matters. The Loki documentation describes monolithic, simple scalable and microservices modes, with simple scalable mode being deprecated, so the chosen mode affects planning. Ask for a fixed-scope plan with milestones, and confirm which dependencies sit with your team.

What does our security, compliance and platform team need to provide?

Each team has distinct inputs. Security should supply the list of ePHI systems, the events they must record and the review expectations, along with the access model for who may read the logs. Compliance should confirm the documentation and retention periods your policies require and approve the procedures that document review. The platform team should provide the Kubernetes or server environment, object storage, DNS and certificates, identity provider access for SSO, and network paths from log sources to Loki. Someone must also own the reverse proxy, backups and upgrades after handover. Agree these responsibilities before work starts so that no required input is left unassigned.

Can our own engineers build a HIPAA-oriented Loki setup without an outside partner?

Often yes, if your team has the skills and time. Loki is open source and its documentation covers installation, storage, retention, multi-tenancy and authentication. The harder parts for a regulated environment are the design decisions: keeping ePHI out of labels, separating tenants so one team cannot read another's ePHI logs, protecting the log store from tampering, and writing review procedures that an auditor can sample. Internal teams should also check whether they need Grafana Enterprise Logs features such as label-based access control, which the product documentation describes, against the open-source approach. A partner can plan and implement the build, while your staff keep ownership of the policies and daily review.

Is there a HIPAA certification that proves our logging meets the Security Rule?

No. HHS states that no Security Rule standard requires an entity to certify compliance, that HHS does not endorse or recognize private organizations' certifications, and that such certifications do not prevent HHS from later finding a violation. The HHS Office for Civil Rights enforces the rule through complaint investigations, compliance reviews and audits. Be cautious with any vendor or consultant who offers a HIPAA certificate. For logging, the useful evidence is your documented risk analysis, the logging configuration, retention settings, access records to the log store, and proof that reviews happened. Independent auditors and certification bodies issue reports where a client wants one. DeployOpen prepares systems, controls and evidence for compliance assessments but does not issue audit reports or certifications.

What does the six-year documentation rule mean for how long we keep Loki logs?

The six-year rule applies to HIPAA Security Rule documentation, which must be kept for six years from creation or from the date it was last in effect, whichever is later, under 45 CFR 164.316(b)(2)(i). It does not directly state how long activity logs themselves must be kept. Many organizations therefore keep the documentation that describes their audit controls, such as the logging policy, review procedures and retention decisions, for six years, and set log retention separately based on their risk analysis and internal policy. Loki retention is disabled by default, so logs are kept indefinitely until you configure it. Confirm your retention periods with your compliance lead and legal counsel, and record the reasoning in your documentation.

Why must ePHI stay out of Loki labels, and how does that affect the build?

Loki indexes labels, so values placed in labels become part of the index and can be spread across many streams. Putting patient identifiers, medical record numbers or other ePHI in labels would copy sensitive data into the index, make it harder to control and delete, and create high-cardinality streams that slow queries. Keep labels to low-cardinality attributes such as environment, application and component. Records that need identifiers should keep them in the log line or structured metadata, with access controls applied at the tenant and reverse proxy layer. Build a field review into the pipeline so that new log sources are checked before they reach production, and test that known ePHI fields do not appear as labels.

How the logging path and trust boundaries fit together

The path starts in the ePHI environment, where Grafana Alloy collects logs from applications and hosts and sends them to Loki with auth_enabled set so each request carries a tenant ID. Loki writes compressed chunks and the index to object storage, and the compactor applies retention. Analysts reach queries only through an authenticating reverse proxy and Grafana behind SSO. Check that the boundary holds at every hand-off: no ePHI-bearing components sit outside it, and no path lets a user query Loki directly.

Log flow from ePHI systems into Loki, with the trust boundary around the ePHI environment.

How DeployOpen scopes and delivers HIPAA-oriented Loki logging

DeployOpen plans, builds, documents and supports self-hosted Loki inside your own infrastructure, so the audit log store sits under your control. Engagements are fixed-scope, with the collection, retention, tenancy and access decisions agreed in writing before the build starts. The output is a configured system and the evidence your compliance and security teams need to review it.

How we scope

  • Inventory which systems that create, receive, maintain or transmit ePHI must feed the Loki audit log.
  • Agree in writing which event types, label sets and retention periods each log source will use.
  • Confirm with your compliance lead how documentation retention and review obligations map to the Loki design.

How we build

  • Deploy Loki on object storage in your cloud account, data center or air-gapped network with auth_enabled set.
  • Place an authenticating reverse proxy in front of Loki, with SSO and role-based access to the log store.
  • Configure ingestion so ePHI stays out of labels and is kept out of structured metadata where it does not belong.

How we hand over

  • Deliver runbooks for tenant onboarding, retention changes, access reviews and log integrity checks.
  • Document the configuration, data flows and control mapping so your auditors can sample the evidence.
  • Test ingestion, retention deletion and access restrictions, then hand over findings with fixes and a retest.

How we support

  • Offer ongoing support, upgrades and continuous testing as a retainer after the initial handover.
  • Review Loki version upgrades, storage changes and configuration drift against the agreed documentation.
  • Ask any quote to name the systems in scope, the tenants involved and the review cadence before pricing.

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.