TRtek Yazılım
Blog
SecurityDecember 5, 20259 min read

KVKK and ISO 27001 for Health Data: How to Build a Compliant Architecture

Ways to build KVKK and ISO 27001 compliance into the architecture when processing patient data — practical notes on segmentation, encryption, audit logs and access control.

Onur YıldızSecurity Architect, TRtek
SecurityOnur YıldızSecurity Architect, TRtek9

Article 6 of KVKK (Türkiye’s Personal Data Protection Law No. 6698) explicitly enumerates special categories of personal data — health among them — and ties their processing to specific conditions. ISO 27001, in turn, defines the operational controls. The good news: in a well-designed architecture the two frameworks overlap naturally. This article describes how to build compliance into the foundations of health software rather than patching it on afterwards.

Start with data classification

Tag every table and every column with a sensitivity label. In health software four classes are enough:

  • PII-HI: identity combined with health data (patient name, national ID, diagnosis). The most protected class.
  • PII: identity only (such as employee information).
  • PHI: health data without identity (anonymous statistics).
  • INT: business/operational data (stock, invoice lines).

Practical note

Put classification into CI/CD — if a new column is added without a label, fail the build. This eliminates the “we’ll forget about it” risk at the root.

Encryption: in transit and at rest

TLS 1.3 is the default for everyone. The real challenge is at rest. Protecting PII-HI data with a single large encryption key is not enough; derive keys per patient (per-record key wrapping). Keep the keys in a separate KMS/HSM so they are not exported together with the database during backups.

Identity and access control

RBAC is not enough — you need ABAC

It is not reasonable for the “nurse” role to reach every patient. With attribute-based access control (ABAC), add constraints such as “patients on their own ward” or “the ward they are on call for today”. Keep the decision engine (OPA / Cerbos) separate from the code so it stays auditable.

Break-glass access

In an emergency a physician may need to reach a patient they are not normally authorised for. Design this break-glass flow explicitly: a justification is mandatory, an automatic notification goes to the chief physician, and the access expires automatically after two hours.

Audit logs — queryable and immutable

  • Log every PII-HI read event (who, what, when, from which screen)
  • Write logs to WORM (write-once-read-many) storage
  • Retain logs for 10 years so you can answer KVKK’s “right to request access”
  • Consider a portal where patients can see who viewed their data — the gold standard from a KVKK perspective

When auditors arrive, their real question is not “how do you encrypt” but “who looked at patient X’s file in the last three months”. An institution that has not prepared in advance spends hours searching for that answer.

ISO 27001 auditor (from an independent assessment)

Network segmentation

HBYS, PACS and the laboratory device network should not sit on a single flat network. Each belongs on its own VLAN, with firewall rules allowing only the necessary ports between them. DICOM traffic between PACS and the lab should not leak into HBYS. The medical device (IoT) network should never reach the internet.

Data retention and deletion

KVKK requires a “period appropriate to the purpose”; health regulation says “retain patient files for 20 years”. It looks like a contradiction, but the practical resolution is clear: keep data active for three to five years, then move it to an archive (encrypted, cold storage, access logged). In response to a deletion request you can tell the patient “we retain this as required by regulation, but we have anonymised fields X”.

What this means for development practice

  • Production data is never copied into test environments — use synthetic data or masking
  • Automatic scanning in pull requests: warn if a newly added column is unclassified
  • SBOM and dependency scanning are mandatory in CI
  • Penetration testing at least once a year, and additionally for major releases

Closing note

KVKK and ISO 27001 compliance is not a certificate-collecting exercise; it is an architectural discipline. The best institutions design for it when the first line of code is written, not afterwards. If you are migrating: start with classification, then encryption, then access, and documentation last — not the other way round.

Let's find the right solution for you

Let's analyse your organisation's needs together and prepare a demo environment tailored to you.