Blog

    Healthcare Secure Testing for HIPAA Compliance: Threat Models, Scans and Penetration Tests

    By GauravJuly 4, 20269 mins read
    On this page

    Security testing in healthcare is often bought as a single penetration test the month before launch, then filed as proof of HIPAA compliance. That report answers one question on one day, and the HIPAA Security Rule asks for something more continuous: an evaluation that is repeated whenever the system changes.

    This post is for engineering, QA and security leads building software that handles electronic protected health information. It covers threat modeling, automated scans, how to scope a penetration test, test data that contains no PHI, and how findings become evidence for the risk analysis.

    What is secure testing for HIPAA compliance?

    Preparing a healthcare app for a security review?

    Our HIPAA engineering team builds the security tests, scans and evidence trail into your delivery pipeline.

    Secure testing for HIPAA compliance is the set of security tests, from threat modeling and automated scans to penetration tests, that check whether a healthcare application protects electronic protected health information against realistic attacks. Agnotic Technologies runs these tests inside the delivery pipeline, so each release produces evidence the risk analysis can use.

    This is different from checking that a control exists. A control test confirms that session timeouts are configured; a security test tries to get around them.

    Which HIPAA requirements does security testing support?

    Security testing supports two Security Rule requirements most directly: the risk analysis and the periodic evaluation. Neither names a specific test, but both need evidence that only testing produces.

    The HIPAA Security Rule requires an accurate and thorough risk analysis of the potential risks and vulnerabilities to the confidentiality, integrity and availability of ePHI.

    The HIPAA Security Rule requires a periodic technical and nontechnical evaluation, and another one after environmental or operational changes that affect the security of ePHI, to establish how well security policies and procedures meet the rule.

    The phrase about operational changes matters for software teams. A new integration, a new hosting setup or a major feature is a change, and the evaluation evidence should follow it rather than wait for the annual cycle.

    Start with a threat model

    Start with a threat model, because tests chosen without one tend to cover what is easy to test rather than what is likely to be attacked. A threat model is a short document, not a research project.

    • Assets: where ePHI is stored, processed and sent, including logs, backups and analytics exports.
    • Entry points: web and mobile clients, APIs, integration endpoints, admin tools and file uploads.
    • Actors: patients, clinicians, support staff, integration partners and outside attackers.
    • Threats: for each entry point, what an actor could read, change or deny that they should not.
    • Tests: the checks that would show each threat is handled, mapped back to the threat.

    Revisit the model when the architecture changes. A new partner API or a reporting export adds entry points that the original tests never covered.

    Which automated scans belong in the pipeline?

    Automated scans belong in the pipeline because they run on every change at almost no extra effort. They catch known classes of problems early, before a human tester spends time on them.

    NIST SP 800-218, the Secure Software Development Framework, groups secure development practices into four areas: prepare the organization, protect the software, produce well-secured software and respond to vulnerabilities.

    • Static analysis: scans source code for injection, unsafe deserialization and hard-coded secrets.
    • Dependency scanning: flags libraries with known vulnerabilities and tracks how long they stay open.
    • Secret scanning: blocks commits that contain keys, tokens or passwords.
    • Infrastructure checks: reviews cloud and container configuration for open storage and weak network rules.
    • Dynamic scanning: probes a running test build for common web and API weaknesses.

    Tune the scanners so their findings are worth reading. A pipeline that reports hundreds of low-value warnings teaches the team to ignore all of them.

    Set a rule for what blocks a release. A critical finding in code that handles ePHI should stop the merge, while low findings can go to the backlog with an owner and a date, so the pipeline protects patients without stalling every change.

    How should a penetration test be scoped?

    A penetration test should be scoped around the threat model and the parts of the system that changed. A generic external test of the marketing site tells you little about the patient API.

    • In scope: the APIs, roles and data flows that handle ePHI, named explicitly.
    • Accounts: test accounts for every role, including support and admin roles that attackers target.
    • Environment: a production-like environment with synthetic data, never live patient records.
    • Rules: what testers may and may not do, who to call if they find something serious, and the test window.
    • Retest: a second pass after fixes, so the report shows closure and not only findings.

    Ask the testers to report how they reached each finding, not only the finding itself. The path tells your team which assumption failed, which is more useful than the label.

    Test data without PHI

    Security testing should never use real patient data. Testers copy, export and sometimes leak what they find, and a test environment with real ePHI turns every test into a disclosure risk.

    Use synthetic patients that look real enough to exercise every screen and API, with names, identifiers and histories that belong to nobody. Seed a few records with markers so you can tell, in a finding, exactly which record an attacker reached.

    • Synthetic sets: generated patients covering every role relationship the access rules depend on.
    • Markers: unique strings in specific records to prove cross-account access in a finding.
    • No copies: production databases are never restored into test, even masked, without a privacy review.

    Give testers their own accounts and keys for the test window, and revoke them when it closes.

    How do you test access control and audit logging?

    Test access control from the attacker's side: sign in as one user and try to reach another user's data. Most serious healthcare findings are this kind of broken object-level access, not exotic exploits.

    • Horizontal access: patient A changes an identifier in a request and asks for patient B's record.
    • Vertical access: a front-desk role calls an admin endpoint directly, skipping the hidden button.
    • Indirect paths: search, export and report features that return records the user cannot open directly.
    • Audit check: every attempt, allowed or refused, appears in the audit log with user, time and record.

    Automate the horizontal and vertical checks once they pass, so a later change cannot quietly reopen them. Pair each with an audit log assertion, because an access path nobody logged is a gap even when the test is refused.

    What goes wrong in healthcare security testing?

    The common failures are about timing and scope, not tooling.

    • One test a year: a single annual report while the system changes every sprint.
    • Wrong target: testers given the website instead of the APIs that carry ePHI.
    • Real data: a production copy in the test environment, turning findings into incidents.
    • No retest: findings marked fixed without anyone confirming the fix holds.
    • Lost evidence: reports emailed around and never linked to the risk analysis.

    A worked example: a patient portal before launch

    A team is preparing a patient portal that shows results, messages and bills. The threat model lists the portal API, the messaging attachment upload, proxy access for caregivers and the support console as the main entry points.

    Pipeline scans run on every merge. Two weeks before launch, a penetration test targets the API and the proxy access rules using synthetic families with marked records, and testers find that a caregiver can still see a record after proxy access is revoked.

    The team fixes the cache that kept the old permission, adds an automated test for revoked proxies, and the testers confirm the fix in a retest. The report, the fix and the new test are linked in the risk analysis as evidence for the access control risk.

    Who owns threat models, scans and test findings?

    Security testing involves people who rarely sit together, so ownership has to be written down.

    • Security lead: the threat model, test scope, tester selection and the link to the risk analysis.
    • Engineering lead: pipeline scans, fixes, and automated tests for every confirmed finding.
    • QA lead: synthetic test data, test accounts for every role and access control regression tests.
    • Privacy or compliance officer: confirms no real ePHI enters test environments and reviews serious findings.

    How do findings become risk analysis evidence?

    Findings become evidence when each one is tied to a risk, a fix and a confirmation. A folder of reports is not evidence; a traceable record is.

    • Risk link: each finding points to the risk it affects in the risk register.
    • Decision: fix, accept or transfer, with the reason and the person who decided.
    • Proof: the commit, the new automated test and the retest result.
    • Trend: open findings by severity over time, reviewed at each evaluation.

    Keep these records with the other Security Rule documentation. When a customer's security review or an auditor asks how you know a risk is controlled, the answer should be one link away.

    What are healthcare secure testing best practices?

    Write a threat model and let it choose the tests, run automated scans on every change, and scope penetration tests around the APIs and roles that touch ePHI. Use synthetic data only, with marked records that make findings precise.

    Retest every fix, turn each confirmed finding into an automated test, and link findings to the risk analysis so each evaluation builds on the last one instead of starting again.

    How can Agnotic help build security testing into delivery?

    Agnotic builds security testing into healthcare delivery: threat models, pipeline scans, synthetic test data, access control regression tests and the evidence trail that links findings to your risk analysis. We work with your security lead and outside testers, and fix what they find in the same codebase we maintain.

    Plan your security testing with Agnotic

    We set up the scans, tests and evidence your HIPAA risk analysis needs, release by release.

    Related reading on Agnotic

    Control tests, security architecture and audit trails.

    Sources

    Frequently Asked Questions

    HIPAA does not name penetration testing. It requires a risk analysis and periodic evaluations, and security testing is one of the most direct ways to produce evidence for both.

    Talk to an engineer about your project

    Send us your architecture and last security report. We will map the tests and evidence your next release needs.

    Go deeper

    Services and solutions on this topic