Rule analysis and script · Governance Evidence Pack

Which HIPAA Security Rule requirements can your data platform's logs give evidence for?

DuckDB2026-11-06Tested on Snowflake and Databricks recordsScripts and CSV downloadable, PDF by email

The short answer

By our rating, your data platform's logs give evidence for 22 of the 63 HIPAA Security Rule items (34.9%): one, audit controls, from the log alone, and 21 with a second record such as a policy, ticket or HR date. The second script on this page checks two of them on your own logs: whether each platform kept sign-in and query records on every day of a period, and which logins had more failed sign-ins in one day than your limit.

What you will have at the end

Two Python scripts. The first, hipaa_log_evidence.py, fetches the text of the HIPAA Security Rule, lists every standard and implementation specification in it, checks that list against the rule’s own matrix, rates each item for what a data platform’s logs can show, and counts. It writes the 63 rated items as hipaa_log_evidence.csv. The ratings are our judgment, written out in the script so you can change them.

The second, hipaa_log_check.py, runs on your own records. You export two small files from Snowflake, Databricks or Redshift with the queries in Step 5, and the script prints two lists for the period you choose:

  • Audit controls (164.312(b)): for each platform, the days with sign-in and query records, the days with none, and the days your exports cannot show.
  • Log-in monitoring (164.308(a)(5)(ii)(C)): every failed sign-in, counted by login (the full list is written to failed_sign_ins_in_period.csv), the logins with more failed sign-ins in one day than a limit you set, and failed attempts on names that are not a login.

The second script reads CSV files and writes only its own output files. It never connects to a platform and never changes one. This page rates a rule and checks records. It is not a finding that anyone complies. Whether a log is enough evidence for an item is for your compliance team and your auditor to decide.

Three other guides cover items this page rates Partial, so this page does not repeat them: HIPAA minimum necessary in Snowflake, Databricks and Redshift (who can read patient data, and leavers who held access), account evidence for Snowflake, Databricks and Redshift (accounts with no recent sign-in) and HIPAA audit logs for Claude Enterprise (audit controls and activity review for Claude).

The three ratings

  • Direct: a platform’s own log, by itself, shows that what the text asks for happened or is in place.
  • Partial: the log shows part of it. Another record (a policy, a request, an HR date, a sign-off) shows the rest.
  • None: what the text asks for is not something a data platform’s logs record, such as a contract, a training record or a locked door.

“Standard” and “implementation specification” are the rule’s own terms. Each standard states a requirement. Some standards have implementation specifications, each marked Required or Addressable. For an addressable specification, 45 CFR 164.306(d)(3) asks the entity to assess whether it is reasonable and appropriate, implement it if so, and otherwise document why not and implement an equivalent alternative measure if that is reasonable and appropriate (eCFR: 164.306 (read 2026-10-18)).

Step 1. Fetch the rule text at a pinned date and list every item

The rule is 45 CFR Part 164, Subpart C, in the eCFR (eCFR: Subpart C (read 2026-10-18)). The script fetches the XML of the subpart from the eCFR versioner API with the date fixed in the URL, 2026-10-01, so a later amendment cannot change the answer. It sends an Accept-Encoding: gzip header and prints the byte size and the date of the subpart’s latest amendment. The US federal rule text is public.

It reads sections 164.308 (administrative safeguards), 164.310 (physical), 164.312 (technical), 164.314 (organizational requirements) and 164.316 (policies and documentation). In the XML, a standard is a paragraph with an italic “Standard:” label, and an implementation specification is an italic name followed by “(Required)” or “(Addressable)”. The script keeps the paragraph numbering, so each item gets its citation, for example 164.308(a)(3)(ii)(C). These are the two patterns, copied from the script:

std = re.search(r"<I>Standard: ([^<]+?)\.</I>", p)
spec = re.search(r"<I>(?:Implementation specifications?: )?([^<]+?) \((Required|Addressable)\)\.?</I>", p)

One standard, 164.308(b)(1), has no “Standard:” label in the eCFR text, so the script matches its heading by name. Two specifications, in 164.314(a)(2) and 164.314(b)(2), are labeled only “Implementation specifications (Required)”, and the script names them after their standard.

Step 2. Check the list against the rule’s own matrix

Appendix A to Subpart C is a table of the standards and specifications in 164.308, 164.310 and 164.312. The script parses that table separately and compares it with the list from the paragraphs: the same standards, the same number of specifications under each, and the same Required or Addressable letter wherever the matrix gives one. The matrix does not cover 164.314 and 164.316, so those two sections are not cross-checked.

The check found one oddity in the rule text itself: in Appendix A the row for Workforce Clearance Procedure has no (R) or (A) marker, while the paragraph text marks it Addressable. The script prints it and goes on, since the paragraph text is the rule.

Step 3. Write the rating table

This is the judgment, and it is a table, not a model. Each item gets a rating, what a log shows and what it cannot show. The key is the citation and the rule’s own name for the item, so the script can tell if the table and the rule disagree. Three of the 63 rows:

"164.308(a)(3)(ii)(C)": ("Termination procedures", "Partial", "grant history shows when each access ended", "the termination date comes from HR, so on-time needs that record"),
"164.312(b)": ("Audit controls", "Direct", "the platform's access and query history is a mechanism that records activity", "it covers only what the platform records, for as long as it keeps it"),
"164.310(d)(2)(i)": ("Disposal", "None", "", "disposal of hardware or media is physical"),

The full table is in the script and in the CSV. Disagree with a rating and change it: nothing else in the script moves except the counts.

Step 4. Count in DuckDB

The script loads the parsed items, the rating table and the section names into DuckDB tables, joins them, and counts by rating, by safeguard and by the rule’s Required or Addressable label (DuckDB documentation (read 2026-10-18)). Then it runs its own checks and writes the CSV only if all pass.

Run 1: the rating

We ran the script again on 2026-11-06. The self-check passed: no citation appears twice, the list agrees with Appendix A (18 standards in 164.308 to 164.312), every item has a rating, every key in the rating table matched an item, and the shares add up to 100%. The counts and the CSV are the same as in our first run on 2026-10-18. The byte size and fingerprint of the fetched XML are not: the eCFR now serves the same pinned version with a different byte count, and the parsed list did not change.

Command: run 1
python3 guides/hipaa-security-rule-evidence-from-data-platform-logs/hipaa_log_evidence.py --out guides/hipaa-security-rule-evidence-from-data-platform-logs/hipaa_log_evidence.csv
Output from our run 1
duckdb 1.5.6, python 3.14.8
source  https://www.ecfr.gov/api/versioner/v1/full/2026-10-01/title-45.xml?part=164&subpart=C
        bytes=37883 sha256=de60dfe5fd8c031c... latest amendment of the subpart=2020-11-24
Appendix A rows with no (R) or (A) marker, where the rule text gives one: ['164.308(a)(3) Workforce Clearance Procedure']

items rated: 63 (22 standards, 41 implementation specifications)

by what                         items  Direct  Partial  None  % with some log evidence
  all items                          63        1       21       41      34.9

by safeguard
  Administrative (164.308)           30        0       14       16      46.7
  Physical (164.310)                 12        0        0       12       0.0
  Technical (164.312)                12        1        5        6      50.0
  Organizational (164.314)            4        0        0        4       0.0
  Documentation (164.316)             5        0        2        3      40.0

by designation in the rule
  Addressable                        22        0        6       16      27.3
  Required                           19        0        7       12      36.8
  Standard                           22        1        8       13      40.9

Direct and Partial items:
  Partial 164.308(a)(1)           Security management process
  Partial 164.308(a)(1)(ii)(D)    Information system activity review
  Partial 164.308(a)(3)           Workforce security
  Partial 164.308(a)(3)(ii)(A)    Authorization and/or supervision
  Partial 164.308(a)(3)(ii)(C)    Termination procedures
  Partial 164.308(a)(4)           Information access management
  Partial 164.308(a)(4)(ii)(A)    Isolating health care clearinghouse functions
  Partial 164.308(a)(4)(ii)(B)    Access authorization
  Partial 164.308(a)(4)(ii)(C)    Access establishment and modification
  Partial 164.308(a)(5)(ii)(C)    Log-in monitoring
  Partial 164.308(a)(5)(ii)(D)    Password management
  Partial 164.308(a)(6)           Security incident procedures
  Partial 164.308(a)(6)(ii)       Response and reporting
  Partial 164.308(a)(7)(ii)(A)    Data backup plan
  Partial 164.312(a)(1)           Access control
  Partial 164.312(a)(2)(i)        Unique user identification
  Partial 164.312(a)(2)(ii)       Emergency access procedure
  Direct  164.312(b)              Audit controls
  Partial 164.312(c)(1)           Integrity
  Partial 164.312(d)              Person or entity authentication
  Partial 164.316(b)(1)           Documentation
  Partial 164.316(b)(2)(i)        Time limit

SELF-CHECK PASSED: 63 items parsed, no citation twice, parsed list agrees with Appendix A (18 standards in 164.308-164.312), every item rated, every rating key matched, shares add up to 100%
wrote guides/hipaa-security-rule-evidence-from-data-platform-logs/hipaa_log_evidence.csv

The result

Rating of all 63 items, by safeguard
SafeguardItemsDirectPartialNone% with some log evidence
Administrative (164.308)300141646.7
Physical (164.310)1200120.0
Technical (164.312)1215650.0
Organizational (164.314)40040.0
Documentation (164.316)502340.0
All items631214134.9
The same items, by the rule’s own label
Label in the ruleItemsDirectPartialNone% with some log evidence
Required (implementation specification)19071236.8
Addressable (implementation specification)22061627.3
Standard (no label)22181340.9

Two things stand out. Every physical and organizational item rates None, because a data platform’s logs do not record doors, hardware or contracts. And only one item rates Direct: audit controls (164.312(b)). The standard asks for mechanisms that record and examine activity. A platform’s access and query history is a mechanism that records it, and people do the examining. Even there the log covers only what the platform records. For the rest, the log is half of the evidence at most.

The 22 items with some log evidence
CitationItemRatingWhat a log showsWhat it cannot show
164.312(b)Audit controlsDirectthe platform's access and query history is a mechanism that records activityit covers only what the platform records, for as long as it keeps it
164.308(a)(1)Security management processPartialaccess and login logs are the records used to detect violationsthe policies, and proof that violations were contained and corrected, are not in a log
164.308(a)(1)(ii)(D)Information system activity reviewPartialaudit logs are the records to be reviewed, and a scheduled review query leaves a run recordwho reviewed what, and what they decided, is a sign-off
164.308(a)(3)Workforce securityPartialgrant history shows who has access to what and when it changedwhether that access is appropriate for each role is a policy decision
164.308(a)(3)(ii)(A)Authorization and/or supervisionPartialaccess history shows what each user readthe authorization or supervision is a manager's record
164.308(a)(3)(ii)(C)Termination proceduresPartialgrant history shows when each access endedthe termination date comes from HR, so on-time needs that record
164.308(a)(4)Information access managementPartialgrant history shows access given and removedthe policies for authorizing access are not in a log
164.308(a)(4)(ii)(A)Isolating health care clearinghouse functionsPartialgrants show whether clearinghouse data is reachable from other roleswhether the separation was designed and approved is a document
164.308(a)(4)(ii)(B)Access authorizationPartialgrant history shows who granted access, to whom and whenthe approval sits in a request or ticket system
164.308(a)(4)(ii)(C)Access establishment and modificationPartialgrant, revoke and role-change records show who changed access and whenthe review the text asks for is a sign-off
164.308(a)(5)(ii)(C)Log-in monitoringPartiallogin history records each attempt, successes and failuresmonitoring and reporting discrepancies needs an alert and a response record
164.308(a)(5)(ii)(D)Password managementPartiallogin history shows which authentication method each login usedpassword rules are a setting, not a log
164.308(a)(6)Security incident proceduresPartiallogs show what happened during an incidentthe procedure is a document
164.308(a)(6)(ii)Response and reportingPartiallogs let a team identify suspected incidents and their reachresponse, mitigation and outcome records are kept elsewhere
164.308(a)(7)(ii)(A)Data backup planPartialif backups run as jobs, job history shows each runthat a copy is retrievable and exact is shown by a restore test, not a log
164.312(a)(1)Access controlPartialgrant history and login history show who can reach the data and who didwhether each person should have that access is not in a log
164.312(a)(2)(i)Unique user identificationPartialthe user list and login history tie every action to a named usera login shared by several people looks like one user
164.312(a)(2)(ii)Emergency access procedurePartialuse of an emergency account shows in login and access historythat the procedure exists and was approved is a document
164.312(c)(1)IntegrityPartialquery and access history show who changed or deleted datawhether a change was improper is not in a log
164.312(d)Person or entity authenticationPartiallogin history records each attempt, the method used and whether it succeededit does not show that the person is who they claim; the identity provider does that
164.316(b)(1)DocumentationPartialan electronic log can be the record of an activity the rule requires to be documentedthe policies and assessments must be documented too
164.316(b)(2)(i)Time limitPartialthe log's own retention period shows how long records are keptthe rule asks 6 years for documentation, and a log's retention is a separate setting

The other 41 items, with the reason each rates None, are in the CSV.

Run 2: plant three faults in the rule list and see whether the script notices

We ran the same script with three faults planted in the parsed list before the checks: the Termination procedures item listed twice, the name of Audit controls changed to “Audit control”, and the Person or entity authentication standard dropped. Each fault trips a named check:

  • The duplicate trips the check that no citation appears twice and the check that the number of specifications under a standard equals the matrix (4 against 3).
  • The rename trips the check that each key in the rating table meets an item with the same name.
  • The dropped item trips the comparison with Appendix A (a standard the matrix lists and the parsed rule lacks) and the check that every key in the rating table matches an item.

The script reports all five failures, exits with code 1 and writes no CSV. The tables above it are printed from the faulty list, so they are wrong on purpose: they show 63 items, but 21 standards and 42 specifications.

Command: run 2
python3 guides/hipaa-security-rule-evidence-from-data-platform-logs/hipaa_log_evidence.py --out loop-out/planted.csv --plant duplicate-row,renamed-item,drop-item
Output from our run 2 (from the planted faults on)
PLANTED: 'Termination procedures' listed twice
PLANTED: 164.312(b) 'Audit controls' renamed 'Audit control'
PLANTED: 164.312(d) 'Person or entity authentication' dropped from the parsed list

items rated: 63 (21 standards, 42 implementation specifications)

by what                         items  Direct  Partial  None  % with some log evidence
  all items                          63        1       21       41      34.9

by safeguard
  Administrative (164.308)           31        0       15       16      48.4
  Physical (164.310)                 12        0        0       12       0.0
  Technical (164.312)                11        1        4        6      45.5
  Organizational (164.314)            4        0        0        4       0.0
  Documentation (164.316)             5        0        2        3      40.0

by designation in the rule
  Addressable                        23        0        7       16      30.4
  Required                           19        0        7       12      36.8
  Standard                           21        1        7       13      38.1

Direct and Partial items:
  Partial 164.308(a)(1)           Security management process
  Partial 164.308(a)(1)(ii)(D)    Information system activity review
  Partial 164.308(a)(3)           Workforce security
  Partial 164.308(a)(3)(ii)(A)    Authorization and/or supervision
  Partial 164.308(a)(3)(ii)(C)    Termination procedures
  Partial 164.308(a)(4)           Information access management
  Partial 164.308(a)(4)(ii)(A)    Isolating health care clearinghouse functions
  Partial 164.308(a)(4)(ii)(B)    Access authorization
  Partial 164.308(a)(4)(ii)(C)    Access establishment and modification
  Partial 164.308(a)(5)(ii)(C)    Log-in monitoring
  Partial 164.308(a)(5)(ii)(D)    Password management
  Partial 164.308(a)(6)           Security incident procedures
  Partial 164.308(a)(6)(ii)       Response and reporting
  Partial 164.308(a)(7)(ii)(A)    Data backup plan
  Partial 164.312(a)(1)           Access control
  Partial 164.312(a)(2)(i)        Unique user identification
  Partial 164.312(a)(2)(ii)       Emergency access procedure
  Direct  164.312(b)              Audit control
  Partial 164.312(c)(1)           Integrity
  Partial 164.316(b)(1)           Documentation
  Partial 164.316(b)(2)(i)        Time limit
  Partial 164.308(a)(3)(ii)(C)    Termination procedures

SELF-CHECK FAILED: no CSV written
  - 164.308(a)(3)(ii)(C) appears 2 times in the parsed rule
  - 164.308(a)(3): parsed rule has 4 specifications, Appendix A has 3
  - Appendix A lists 164.312(d) (Person or Entity Authentication) but the parsed rule has no such standard
  - RATINGS key 164.312(b) expects 'Audit controls' but the rule says 'Audit control'
  - RATINGS key 164.312(d) ('Person or entity authentication') matches no item in the parsed rule

Step 5. Export two files from each platform’s own logs

The rating says which items a log can support. This step and the next check two of them on your records: audit controls, the one item rated Direct, and log-in monitoring. For the first, a platform in use writes sign-in records and query records every day, so a day with none needs a reason, and a day the platform no longer keeps cannot be shown at all. For the second, the sign-in log records each failed attempt with the name tried and the reason.

The rule’s own words for the two items, from 164.312 and 164.308 (read 2026-11-06): audit controls are to “Implement hardware, software, and/or procedural mechanisms that record and examine activity in information systems that contain or use electronic protected health information.” Log-in monitoring is “Procedures for monitoring log-in attempts and reporting discrepancies.” Log-in monitoring is Addressable. Neither text sets a number of days or a limit on failed attempts, so the limit in Step 6 is yours to choose.

Each platform needs two exports, run as a user who can read every user’s records:

  • daily_records.csv: one row for each platform, day and log, with the number of records that day. log is sign_ins (every sign-in attempt, successful or not) or queries. A day with no records has no row.
  • failed_sign_ins.csv: one row for each failed sign-in, with the time in UTC, the name tried and the reason the platform recorded.

These are the queries a reader runs. Change each start date to the day before your period starts. We could not run the Snowflake ACCOUNT_USAGE form or the Redshift queries in our sandboxes: our Snowflake role cannot read ACCOUNT_USAGE (the error is in Run 7), and we had no Redshift account. Run 7 used Snowflake’s INFORMATION_SCHEMA functions, which return the columns these queries use and which Snowflake documents as covering the last 7 days, and the Databricks queries below with a later start date.

Snowflake -> daily_records.csv and failed_sign_ins.csv
SELECT 'snowflake' AS platform, TO_CHAR(TO_DATE(CONVERT_TIMEZONE('UTC', event_timestamp)), 'YYYY-MM-DD') AS day,
       'sign_ins' AS log, COUNT(*) AS records
FROM SNOWFLAKE.ACCOUNT_USAGE.LOGIN_HISTORY
WHERE event_timestamp >= '2026-06-30' GROUP BY 2
UNION ALL
SELECT 'snowflake', TO_CHAR(TO_DATE(CONVERT_TIMEZONE('UTC', start_time)), 'YYYY-MM-DD'), 'queries', COUNT(*)
FROM SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY
WHERE start_time >= '2026-06-30' GROUP BY 2;

SELECT 'snowflake' AS platform, TO_CHAR(CONVERT_TIMEZONE('UTC', event_timestamp), 'YYYY-MM-DD HH24:MI:SS') AS event_time,
       COALESCE(NULLIF(TRIM(user_name), ''), '(no user recorded)') AS login, error_message AS reason
FROM SNOWFLAKE.ACCOUNT_USAGE.LOGIN_HISTORY
WHERE is_success = 'NO' AND event_timestamp >= '2026-06-30';

LOGIN_HISTORY covers “login attempts by Snowflake users within the last 365 days”, with IS_SUCCESS and ERROR_MESSAGE, and its latency “may be up to 120 minutes”. QUERY_HISTORY covers the last 365 days, with a latency of up to 45 minutes (both read 2026-11-06). Export the day after the period ends, so the last day is complete. Each start date is a day before the period, because a date written without a time is read in the session’s time zone; starting a day early means no UTC day of the period is cut, and the script ignores the extra day. The INFORMATION_SCHEMA functions “return login activity within the last 7 days” and return at most RESULT_LIMIT rows (read 2026-11-06), so they suit a daily export, not a quarter.

Databricks -> daily_records.csv and failed_sign_ins.csv
SELECT 'databricks' AS platform, CAST(to_date(event_time) AS STRING) AS day, 'sign_ins' AS log, COUNT(*) AS records
FROM system.access.audit
WHERE service_name = 'accounts' AND request_params['authenticationMethod'] IS NOT NULL AND event_date >= '2026-06-30'
GROUP BY 2
UNION ALL
SELECT 'databricks', CAST(to_date(start_time) AS STRING), 'queries', COUNT(*)
FROM system.query.history WHERE start_time >= '2026-07-01' GROUP BY 2;

SELECT 'databricks' AS platform, date_format(event_time, 'yyyy-MM-dd HH:mm:ss') AS event_time,
       coalesce(nullif(user_identity.email, ''), '(no user recorded)') AS login,
       coalesce(response.error_message, CAST(response.status_code AS STRING)) AS reason
FROM system.access.audit
WHERE service_name = 'accounts' AND request_params['authenticationMethod'] IS NOT NULL
  AND response.status_code <> 200 AND event_date >= '2026-06-30';

Databricks writes sign-ins to the audit log with the service name accounts, and the audit log reference lists authenticationMethod as a parameter of each sign-in action, such as tokenLogin and aadBrowserLogin, so the filter keeps sign-ins and leaves out other account events (read 2026-11-06). The system tables page gives the audit log a free retention period of 395 days and query history 365 days (read 2026-11-06). event_time is in UTC; the filter on event_date starts a day early so no UTC day is cut. A reader needs USE CATALOG on system, USE SCHEMA on system.access and system.query, and SELECT on the two tables, which an account admin grants.

Redshift -> daily_records.csv and failed_sign_ins.csv, one export (as a superuser)
SELECT 'redshift' AS platform, TO_CHAR(record_time, 'YYYY-MM-DD') AS day, 'sign_ins' AS log, COUNT(*) AS records
FROM sys_connection_log WHERE event IN ('authenticated', 'authentication failure') GROUP BY 2
UNION ALL
SELECT 'redshift', TO_CHAR(start_time, 'YYYY-MM-DD'), 'queries', COUNT(*)
FROM sys_query_history GROUP BY 2;

SELECT 'redshift' AS platform, TO_CHAR(record_time, 'YYYY-MM-DD HH24:MI:SS') AS event_time,
       COALESCE(NULLIF(TRIM(user_name), ''), '(no user recorded)') AS login, TRIM(event) AS reason
FROM sys_connection_log WHERE event = 'authentication failure';
Redshift -> the same two files, a daily job for a longer period (as a superuser)
-- each run exports yesterday only, one whole day, so the daily files never overlap
SELECT 'redshift' AS platform, TO_CHAR(record_time, 'YYYY-MM-DD') AS day, 'sign_ins' AS log, COUNT(*) AS records
FROM sys_connection_log WHERE event IN ('authenticated', 'authentication failure')
  AND record_time >= DATEADD(day, -1, TRUNC(GETDATE())) AND record_time < TRUNC(GETDATE()) GROUP BY 2
UNION ALL
SELECT 'redshift', TO_CHAR(start_time, 'YYYY-MM-DD'), 'queries', COUNT(*)
FROM sys_query_history
WHERE start_time >= DATEADD(day, -1, TRUNC(GETDATE())) AND start_time < TRUNC(GETDATE()) GROUP BY 2;

SELECT 'redshift' AS platform, TO_CHAR(record_time, 'YYYY-MM-DD HH24:MI:SS') AS event_time,
       COALESCE(NULLIF(TRIM(user_name), ''), '(no user recorded)') AS login, TRIM(event) AS reason
FROM sys_connection_log WHERE event = 'authentication failure'
  AND record_time >= DATEADD(day, -1, TRUNC(GETDATE())) AND record_time < TRUNC(GETDATE());

SYS_CONNECTION_LOG records authentication failure and authenticated events and “is visible only to superusers”. SYS_QUERY_HISTORY shows a regular user only their own queries (both read 2026-11-06). Redshift does not keep these logs for long. Its system tables page says “STL system views retain seven days of log history” and that to keep more “you have to periodically copy it to other tables or unload it to Amazon S3” (read 2026-11-06). That sentence is about the STL views; the pages for the two SYS views state no period of their own, so plan for about seven days. So the one-export form covers about the last seven days, which is what HISTORY_DAYS says for Redshift. For a quarter, run the daily job every day; each run exports the day before. GETDATE returns “the current date and time in the current session time zone (UTC by default)” (read 2026-11-06), so run the Redshift queries in a session left on UTC. Add each day’s rows to one daily_records.csv and one failed_sign_ins.csv, with the header row once, and set KEPT_SINCE to the first day your copies cover. A day exported twice fails the duplicate check. If a daily run is missed, run the one-export form within the week and keep only that day’s rows. A missed day you cannot fill shows as NO RECORDS. Note beside the output that the export was missed, and do not list the day in QUIET_DAYS, which is only for days with no activity.

A third file is optional: logins.csv, with the columns platform and login, and email if you have it, one row for each login that exists. With it, the script lists failed attempts on any other name. A failed sign-in counts as a known login when its name matches the login of a row. On Databricks it also counts when the name matches the row’s email, because the Databricks export records the user’s email; on Snowflake and Redshift an email tried as a user name is listed as a name that is not a login. Without logins.csv, the list of failed attempts on other names is NOT CHECKED.

Step 6. Set the period and run the check

The settings are at the top of hipaa_log_check.py: the period, the day you took the exports, the platforms, how many days each platform keeps each log (HISTORY_DAYS, filled in from the pages linked in Step 5), the first day of any daily copies you keep (KEPT_SINCE), days you know had no activity (QUIET_DAYS) and FAILED_PER_DAY_LIMIT, the number of failed sign-ins in one day above which a login is listed. The script checks the input first and computes nothing if a check fails. Then it gives each day of the period one state for each platform and log:

  • records: the export has records for that day.
  • NO RECORDS: the platform keeps that day, the export holds that log, and there are none. Each such day needs a reason, or a line in QUIET_DAYS.
  • NOT COVERED: the exports cannot show the day: it is before the platform’s records start, after the day the exports were taken, or the platform was not exported. The script never reads such a day as a day with nothing in it.

With --strict the script exits 1 if any day has no records or is NOT COVERED, so a scheduled run can fail loudly.

Run 3: days with no records and a run of failed sign-ins, planted

Runs 3 to 6 use generated records: invented logins with example.com addresses, laid out the way the Step 5 queries write them, for the period 2026-07-01 to 2026-09-30. They are not anyone’s logs and not a run on any platform. In Run 3 we planted four things: three days with no Databricks records at all, one Redshift day with query records but no sign-in records, twelve failed sign-ins for BEN within one hour, and three attempts on ADMIN, a name that is not a login. The script lists all four. Because some days have no records, the same run with --strict would exit 1.

Command: run 3
python3 guides/hipaa-security-rule-evidence-from-data-platform-logs/hipaa_log_check.py --demo --plant-error --out loop-out/out
Output from our run 3 (from the audit controls on)
1. AUDIT CONTROLS: did each platform keep sign-in and query records on every day of the period?
  snowflake   sign_ins  92 of 92 days with records, 0 with none, 0 NOT COVERED
  snowflake   queries   92 of 92 days with records, 0 with none, 0 NOT COVERED
  databricks  sign_ins  89 of 92 days with records, 3 with none, 0 NOT COVERED
  databricks  queries   89 of 92 days with records, 3 with none, 0 NOT COVERED
  redshift    sign_ins  91 of 92 days with records, 1 with none, 0 NOT COVERED
  redshift    queries   92 of 92 days with records, 0 with none, 0 NOT COVERED
  Population: 552 platform-log-days, period 2026-07-01 to 2026-09-30, exports taken 2026-10-05, SHA-256 baf309c8104a3482...

  Days with no records (a platform in use writes sign-in and query records every day; each day needs a reason):
    databricks  queries   2026-08-12 to 2026-08-14 (3 day(s))
    databricks  sign_ins  2026-08-12 to 2026-08-14 (3 day(s))
    redshift    sign_ins  2026-09-02 to 2026-09-02 (1 day(s))

2. LOG-IN MONITORING: failed sign-ins from 2026-07-01 to 2026-09-30
  Population: 92 failed sign-in(s), SHA-256 98d8529338a8b088...
  By login:
    snowflake   BEN                          23 failed on 12 day(s), most in one day 12, first 2026-07-08 13:22:57, last 2026-09-25 17:20:27  (INCORRECT_USERNAME_PASSWORD)
    databricks  ben.reyes@example.com        14 failed on 14 day(s), most in one day 1, first 2026-07-01 17:45:53, last 2026-09-28 07:33:24  (401)
    redshift    ada                          10 failed on 10 day(s), most in one day 1, first 2026-07-03 19:18:34, last 2026-09-23 13:59:06  (authentication failure)
    redshift    etl_loader                    9 failed on 9 day(s), most in one day 1, first 2026-07-08 08:13:50, last 2026-09-04 08:59:27  (authentication failure)
    databricks  ada.novak@example.com         7 failed on 7 day(s), most in one day 1, first 2026-07-17 18:19:59, last 2026-09-30 09:29:11  (401)
    snowflake   CHLOE                         7 failed on 7 day(s), most in one day 1, first 2026-07-11 15:48:15, last 2026-09-26 09:48:33  (INCORRECT_USERNAME_PASSWORD)
    databricks  chloe.novak@example.com       6 failed on 6 day(s), most in one day 1, first 2026-07-02 19:28:42, last 2026-09-04 12:41:08  (401)
    redshift    ben                           5 failed on 5 day(s), most in one day 1, first 2026-08-01 11:16:41, last 2026-09-27 12:19:19  (authentication failure)
    snowflake   ADA                           4 failed on 4 day(s), most in one day 1, first 2026-07-23 19:39:28, last 2026-09-15 13:42:30  (INCORRECT_USERNAME_PASSWORD)
    snowflake   ETL_SVC                       4 failed on 4 day(s), most in one day 1, first 2026-08-13 09:14:20, last 2026-09-20 13:03:37  (INCORRECT_USERNAME_PASSWORD)
    snowflake   ADMIN                         3 failed on 1 day(s), most in one day 3, first 2026-09-09 03:10:44, last 2026-09-09 03:12:44  (USER_DOES_NOT_EXIST)
  Logins with more than FAILED_PER_DAY_LIMIT = 5 failed sign-ins on one day:
    snowflake   BEN                        2026-08-19  12 failed
  Failed attempts on names that are not a login in logins.csv:
    snowflake   ADMIN                      3 failed

3. NOT COVERED (days these exports cannot show; never read as nothing happened)
  none

7 platform-log-day(s) with no records, 0 NOT COVERED, 92 failed sign-in(s), 1 login-day(s) over the limit, 1 unknown name(s).
Evidence written to loop-out/out/ (audit_days.csv, failed_sign_ins_in_period.csv, logins_over_limit.csv, unknown_login_names.csv)

Run 4: the clean records

The same generated records with nothing planted. Every day has records on every platform, 77 failed sign-ins are spread over ten logins, no login passes the limit, and every name is a login. Run the clean records three times and the two SHA-256 values are the same each time; we did.

Command: run 4
python3 guides/hipaa-security-rule-evidence-from-data-platform-logs/hipaa_log_check.py --demo --out loop-out/out
Output from our run 4 (from the audit controls on)
1. AUDIT CONTROLS: did each platform keep sign-in and query records on every day of the period?
  snowflake   sign_ins  92 of 92 days with records, 0 with none, 0 NOT COVERED
  snowflake   queries   92 of 92 days with records, 0 with none, 0 NOT COVERED
  databricks  sign_ins  92 of 92 days with records, 0 with none, 0 NOT COVERED
  databricks  queries   92 of 92 days with records, 0 with none, 0 NOT COVERED
  redshift    sign_ins  92 of 92 days with records, 0 with none, 0 NOT COVERED
  redshift    queries   92 of 92 days with records, 0 with none, 0 NOT COVERED
  Population: 552 platform-log-days, period 2026-07-01 to 2026-09-30, exports taken 2026-10-05, SHA-256 7982565c21a08b69...

  Days with no records (a platform in use writes sign-in and query records every day; each day needs a reason):
    none

2. LOG-IN MONITORING: failed sign-ins from 2026-07-01 to 2026-09-30
  Population: 77 failed sign-in(s), SHA-256 db318579440432f1...
  By login:
    databricks  ben.reyes@example.com        14 failed on 14 day(s), most in one day 1, first 2026-07-01 17:45:53, last 2026-09-28 07:33:24  (401)
    snowflake   BEN                          11 failed on 11 day(s), most in one day 1, first 2026-07-08 13:22:57, last 2026-09-25 17:20:27  (INCORRECT_USERNAME_PASSWORD)
    redshift    ada                          10 failed on 10 day(s), most in one day 1, first 2026-07-03 19:18:34, last 2026-09-23 13:59:06  (authentication failure)
    redshift    etl_loader                    9 failed on 9 day(s), most in one day 1, first 2026-07-08 08:13:50, last 2026-09-04 08:59:27  (authentication failure)
    databricks  ada.novak@example.com         7 failed on 7 day(s), most in one day 1, first 2026-07-17 18:19:59, last 2026-09-30 09:29:11  (401)
    snowflake   CHLOE                         7 failed on 7 day(s), most in one day 1, first 2026-07-11 15:48:15, last 2026-09-26 09:48:33  (INCORRECT_USERNAME_PASSWORD)
    databricks  chloe.novak@example.com       6 failed on 6 day(s), most in one day 1, first 2026-07-02 19:28:42, last 2026-09-04 12:41:08  (401)
    redshift    ben                           5 failed on 5 day(s), most in one day 1, first 2026-08-01 11:16:41, last 2026-09-27 12:19:19  (authentication failure)
    snowflake   ADA                           4 failed on 4 day(s), most in one day 1, first 2026-07-23 19:39:28, last 2026-09-15 13:42:30  (INCORRECT_USERNAME_PASSWORD)
    snowflake   ETL_SVC                       4 failed on 4 day(s), most in one day 1, first 2026-08-13 09:14:20, last 2026-09-20 13:03:37  (INCORRECT_USERNAME_PASSWORD)
  Logins with more than FAILED_PER_DAY_LIMIT = 5 failed sign-ins on one day:
    none
  Failed attempts on names that are not a login in logins.csv:
    none

3. NOT COVERED (days these exports cannot show; never read as nothing happened)
  none

0 platform-log-day(s) with no records, 0 NOT COVERED, 77 failed sign-in(s), 0 login-day(s) over the limit, 0 unknown name(s).
Evidence written to loop-out/out/ (audit_days.csv, failed_sign_ins_in_period.csv, logins_over_limit.csv, unknown_login_names.csv)

Run 5: the input checks stop a bad export

We planted four input faults: a day written 8/5/26, a record count of -3, the same platform, day and log twice, and a time written 2026/08/05 10:00. Each one fails its check, and the script computes nothing. The duplicate check counts two, because the -3 row also repeats a day already in the file.

Command: run 5
python3 guides/hipaa-security-rule-evidence-from-data-platform-logs/hipaa_log_check.py --demo --plant-input --out loop-out/out
Output from our run 5 (from the input checks on)
Input checks (nothing is computed unless all pass)
  [ok] PERIOD_START, PERIOD_END and AS_OF are real dates written YYYY-MM-DD and the period starts before it ends
  [ok] PLATFORMS lists the platforms you exported, from snowflake, databricks, redshift
  [ok] HISTORY_DAYS gives a whole number of days for each platform and log
  [ok] every day in KEPT_SINCE and QUIET_DAYS is YYYY-MM-DD
  [ok] daily_records.csv has the columns platform, day, log, records
  [ok] failed_sign_ins.csv has the columns platform, event_time, login, reason
  [ok] logins.csv has the columns platform, login
  [ok] every platform in daily_records.csv is snowflake, databricks or redshift
  [FAIL] every day in daily_records.csv is written YYYY-MM-DD: 1 row(s) not written as YYYY-MM-DD
  [ok] every log in daily_records.csv is sign_ins or queries
  [FAIL] every records value is a whole number of 0 or more: 1 row(s) with another value
  [FAIL] no platform, day and log appears twice in daily_records.csv: 2 platform-day-log(s) twice: export each day once
  [ok] every platform in failed_sign_ins.csv is snowflake, databricks or redshift
  [FAIL] every event_time is a real time written YYYY-MM-DD HH:MM:SS (UTC): 1 row(s) that are not
  [ok] every failed sign-in names a login

INCOMPLETE: 4 input check(s) failed, so nothing is computed. Fix the input.

Run 6: a renamed column stops the run

We renamed the records column of daily_records.csv to count. The header check names the missing column and says how to fix it: rename it in the file, or change COLUMN_MAP.

Command: run 6
python3 guides/hipaa-security-rule-evidence-from-data-platform-logs/hipaa_log_check.py --demo --plant-header --out loop-out/out
Output from our run 6 (from the input checks on)
Input checks (nothing is computed unless all pass)
  [ok] PERIOD_START, PERIOD_END and AS_OF are real dates written YYYY-MM-DD and the period starts before it ends
  [ok] PLATFORMS lists the platforms you exported, from snowflake, databricks, redshift
  [ok] HISTORY_DAYS gives a whole number of days for each platform and log
  [ok] every day in KEPT_SINCE and QUIET_DAYS is YYYY-MM-DD
  [FAIL] daily_records.csv has the columns platform, day, log, records: missing records: rename it in the file or change COLUMN_MAP
  [ok] failed_sign_ins.csv has the columns platform, event_time, login, reason
  [ok] logins.csv has the columns platform, login

INCOMPLETE: 1 input check(s) failed, so nothing is computed. Fix the input.

Run 7: real exports from a Snowflake and a Databricks account

On 2026-11-06 we made real failed sign-ins and exported real records from sandbox accounts of ours. At 11:25 UTC we tried to sign in to Snowflake three times as our loop’s user, CONTENT_LOOP_RUNNER, with a newly made key that Snowflake does not know, and sent three requests to our Databricks workspace with a made-up token. Then we ran the export queries, with each result written to a table in a schema of its own, read the table back, saved the rows as the CSV files the script reads, and dropped the schema. Four things in what came back matter:

  • Snowflake recorded the three failures, with the reason. Each row has the time, the login and JWT_TOKEN_INVALID_PUBLIC_KEY_FINGERPRINT_MISMATCH.
  • The ACCOUNT_USAGE form was refused. Our role cannot read SNOWFLAKE.ACCOUNT_USAGE; the error is below word for word. So the Snowflake part used the INFORMATION_SCHEMA functions for one user, which see only that user’s sign-ins and queries, and only for 7 days. A reader exporting ACCOUNT_USAGE gets every user, for 365 days.
  • No sign-in record of the Databricks requests was in the audit log when we exported. The audit log held records up to 11:27:54 UTC, but no event at all between 11:24 and 11:26. A request that fails before Databricks knows who sent it may leave no sign-in record, so a reader should not read an empty failure list as proof that nobody tried.
  • Our Databricks workspace has a sign-in record every day, but query records on two days only. The workspace’s SQL warehouse ran no queries from 2026-10-31 to 2026-11-04. On a platform in use, five days with no query records is a finding to explain; in a sandbox, it is a quiet week.

We ran the Databricks queries as the workspace’s admin user. The loop’s own service principal cannot read the system catalog: the first query below finds its refusal in the audit log, word for word. A reader needs USE CATALOG on system, USE SCHEMA on system.access and system.query, and SELECT on the two tables.

Output from our run 7: Snowflake
-- ran 2026-11-06 12:44 UTC on Snowflake (Enterprise Edition)

> CREATE SCHEMA IF NOT EXISTS CONTENT_LOOP_SANDBOX.HIPAA_LOG_CHECK
status                                      
--------------------------------------------
Schema HIPAA_LOG_CHECK successfully created.

> SELECT COUNT(*) AS sign_ins FROM SNOWFLAKE.ACCOUNT_USAGE.LOGIN_HISTORY WHERE event_timestamp >= '2026-10-31'
ERROR: 002003 (02000): SQL compilation error: Schema 'SNOWFLAKE.ACCOUNT_USAGE' does not exist or not authorized. Your primary role CONTENT_LOOP_ROLE or one of your secondary roles must have USAGE or any other privilege granted on SCHEMA SNOWFLAKE.ACCOUNT_USAGE.

> CREATE OR REPLACE TABLE CONTENT_LOOP_SANDBOX.HIPAA_LOG_CHECK.DAILY_RECORDS AS SELECT 'snowflake' AS platform, TO_CHAR(TO_DATE(CONVERT_TIMEZONE('UTC', event_timestamp)), 'YYYY-MM-DD') AS day, 'sign_ins' AS log, COUNT(*) AS records FROM TABLE(CONTENT_LOOP_SANDBOX.INFORMATION_SCHEMA.LOGIN_HISTORY_BY_USER(USER_NAME => 'CONTENT_LOOP_RUNNER', RESULT_LIMIT => 10000)) GROUP BY 2 UNION ALL SELECT 'snowflake', TO_CHAR(TO_DATE(CONVERT_TIMEZONE('UTC', start_time)), 'YYYY-MM-DD'), 'queries', COUNT(*) FROM TABLE(CONTENT_LOOP_SANDBOX.INFORMATION_SCHEMA.QUERY_HISTORY_BY_USER(USER_NAME => 'CONTENT_LOOP_RUNNER', RESULT_LIMIT => 10000)) GROUP BY 2
status                                   
-----------------------------------------
Table DAILY_RECORDS successfully created.

> SELECT * FROM CONTENT_LOOP_SANDBOX.HIPAA_LOG_CHECK.DAILY_RECORDS ORDER BY log, day
PLATFORM  | DAY        | LOG      | RECORDS
----------+------------+----------+--------
snowflake | 2026-10-27 | queries  | 16     
snowflake | 2026-10-29 | queries  | 10     
snowflake | 2026-10-30 | queries  | 896    
snowflake | 2026-11-05 | queries  | 3938   
snowflake | 2026-11-06 | queries  | 135    
snowflake | 2026-10-30 | sign_ins | 25     
snowflake | 2026-11-05 | sign_ins | 162    
snowflake | 2026-11-06 | sign_ins | 14     

> SELECT COUNT(*) AS query_rows_returned FROM TABLE(CONTENT_LOOP_SANDBOX.INFORMATION_SCHEMA.QUERY_HISTORY_BY_USER(USER_NAME => 'CONTENT_LOOP_RUNNER', RESULT_LIMIT => 10000))
QUERY_ROWS_RETURNED
-------------------
4997               

> CREATE OR REPLACE TABLE CONTENT_LOOP_SANDBOX.HIPAA_LOG_CHECK.FAILED_SIGN_INS AS SELECT 'snowflake' AS platform, TO_CHAR(CONVERT_TIMEZONE('UTC', event_timestamp), 'YYYY-MM-DD HH24:MI:SS') AS event_time, user_name AS login, error_message AS reason FROM TABLE(CONTENT_LOOP_SANDBOX.INFORMATION_SCHEMA.LOGIN_HISTORY_BY_USER(USER_NAME => 'CONTENT_LOOP_RUNNER', RESULT_LIMIT => 10000)) WHERE is_success = 'NO'
status                                     
-------------------------------------------
Table FAILED_SIGN_INS successfully created.

> SELECT * FROM CONTENT_LOOP_SANDBOX.HIPAA_LOG_CHECK.FAILED_SIGN_INS ORDER BY event_time
PLATFORM  | EVENT_TIME          | LOGIN               | REASON                                           
----------+---------------------+---------------------+--------------------------------------------------
snowflake | 2026-11-06 11:25:09 | CONTENT_LOOP_RUNNER | JWT_TOKEN_INVALID_PUBLIC_KEY_FINGERPRINT_MISMATCH
snowflake | 2026-11-06 11:25:10 | CONTENT_LOOP_RUNNER | JWT_TOKEN_INVALID_PUBLIC_KEY_FINGERPRINT_MISMATCH
snowflake | 2026-11-06 11:25:11 | CONTENT_LOOP_RUNNER | JWT_TOKEN_INVALID_PUBLIC_KEY_FINGERPRINT_MISMATCH

> DROP SCHEMA IF EXISTS CONTENT_LOOP_SANDBOX.HIPAA_LOG_CHECK CASCADE
status                               
-------------------------------------
HIPAA_LOG_CHECK successfully dropped.
Output from our run 7: Databricks
-- ran 2026-11-06 11:44 UTC on Azure Databricks (Premium, serverless compute, Unity Catalog), SQL warehouse 2X-Small

> CREATE SCHEMA IF NOT EXISTS content_loop.hipaa_log_check
(done)

> SELECT event_time, action_name, response.error_message AS error FROM system.access.audit WHERE event_date = '2026-11-06' AND response.error_message LIKE '%content-loop-runner%does not have BROWSE on Catalog%' ORDER BY event_time LIMIT 1
event_time               | action_name | error                                                                                                                   
-------------------------+-------------+-------------------------------------------------------------------------------------------------------------------------
2026-11-06T07:25:24.119Z | getSchema   | DatabricksServiceException: PERMISSION_DENIED: Principal 'content-loop-runner' does not have BROWSE on Catalog 'system'.

> CREATE OR REPLACE TABLE content_loop.hipaa_log_check.daily_records AS SELECT 'databricks' AS platform, CAST(to_date(event_time) AS STRING) AS day, 'sign_ins' AS log, COUNT(*) AS records FROM system.access.audit WHERE service_name = 'accounts' AND request_params['authenticationMethod'] IS NOT NULL AND event_date >= '2026-10-30' GROUP BY 2 UNION ALL SELECT 'databricks', CAST(to_date(start_time) AS STRING), 'queries', COUNT(*) FROM system.query.history WHERE start_time >= '2026-10-30' GROUP BY 2
num_affected_rows | num_inserted_rows
------------------+------------------

> SELECT * FROM content_loop.hipaa_log_check.daily_records ORDER BY log, day
platform   | day        | log      | records
-----------+------------+----------+--------
databricks | 2026-11-05 | queries  | 225    
databricks | 2026-11-06 | queries  | 66     
databricks | 2026-10-30 | sign_ins | 142    
databricks | 2026-10-31 | sign_ins | 144    
databricks | 2026-11-01 | sign_ins | 142    
databricks | 2026-11-02 | sign_ins | 145    
databricks | 2026-11-03 | sign_ins | 144    
databricks | 2026-11-04 | sign_ins | 144    
databricks | 2026-11-05 | sign_ins | 2512   
databricks | 2026-11-06 | sign_ins | 322    

> CREATE OR REPLACE TABLE content_loop.hipaa_log_check.failed_sign_ins AS SELECT 'databricks' AS platform, date_format(event_time, 'yyyy-MM-dd HH:mm:ss') AS event_time, coalesce(nullif(user_identity.email, ''), '(no user recorded)') AS login, coalesce(response.error_message, CAST(response.status_code AS STRING)) AS reason FROM system.access.audit WHERE service_name = 'accounts' AND request_params['authenticationMethod'] IS NOT NULL AND response.status_code <> 200 AND event_date >= '2026-10-30'
num_affected_rows | num_inserted_rows
------------------+------------------

> SELECT * FROM content_loop.hipaa_log_check.failed_sign_ins ORDER BY event_time
platform | event_time | login | reason
---------+------------+-------+-------

> SELECT max(event_time) AS latest_audit_record FROM system.access.audit
latest_audit_record     
------------------------
2026-11-06T11:27:54.645Z

> SELECT COUNT(*) AS events_11_24_to_11_26 FROM system.access.audit WHERE event_time >= '2026-11-06T11:24:00' AND event_time < '2026-11-06T11:26:00'
events_11_24_to_11_26
---------------------
0                    

> DROP SCHEMA IF EXISTS content_loop.hipaa_log_check CASCADE
(done)

We set the period to 2026-10-31 to 2026-11-06, the day the exports were taken to 2026-11-06, PLATFORMS to Snowflake and Databricks, Snowflake’s HISTORY_DAYS to 7 for both logs (the INFORMATION_SCHEMA functions’ limit), and FAILED_PER_DAY_LIMIT to 2, so our three failures would be listed. logins.csv maps CONTENT_LOOP_RUNNER to an invented email address; it has no Databricks rows. Then we ran the script on the two files.

Command: run 7, the script on those exports
python3 loop-out/real/hipaa_log_check.py --out loop-out/real/out
Output from our run 7, the script (from the audit controls on)
1. AUDIT CONTROLS: did each platform keep sign-in and query records on every day of the period?
  snowflake   sign_ins  2 of 7 days with records, 5 with none, 0 NOT COVERED
  snowflake   queries   2 of 7 days with records, 5 with none, 0 NOT COVERED
  databricks  sign_ins  7 of 7 days with records, 0 with none, 0 NOT COVERED
  databricks  queries   2 of 7 days with records, 5 with none, 0 NOT COVERED
  redshift    NOT CHECKED: not in PLATFORMS
  Population: 28 platform-log-days, period 2026-10-31 to 2026-11-06, exports taken 2026-11-06, SHA-256 faf8b63331b6aa8a...

  Days with no records (a platform in use writes sign-in and query records every day; each day needs a reason):
    databricks  queries   2026-10-31 to 2026-11-04 (5 day(s))
    snowflake   queries   2026-10-31 to 2026-11-04 (5 day(s))
    snowflake   sign_ins  2026-10-31 to 2026-11-04 (5 day(s))

2. LOG-IN MONITORING: failed sign-ins from 2026-10-31 to 2026-11-06
  Population: 3 failed sign-in(s), SHA-256 01ec7d992ae6f382...
  By login:
    snowflake   CONTENT_LOOP_RUNNER           3 failed on 1 day(s), most in one day 3, first 2026-11-06 11:25:09, last 2026-11-06 11:25:11  (JWT_TOKEN_INVALID_PUBLIC_KEY_FINGERPRINT_MISMATCH)
  Logins with more than FAILED_PER_DAY_LIMIT = 2 failed sign-ins on one day:
    snowflake   CONTENT_LOOP_RUNNER        2026-11-06  3 failed
  Failed attempts on names that are not a login in logins.csv:
    none
    databricks: NOT CHECKED (no rows for this platform in logins.csv)

3. NOT COVERED (days these exports cannot show; never read as nothing happened)
  none

15 platform-log-day(s) with no records, 0 NOT COVERED, 3 failed sign-in(s), 1 login-day(s) over the limit, 0 unknown name(s).
Evidence written to loop-out/real/out/ (audit_days.csv, failed_sign_ins_in_period.csv, logins_over_limit.csv, unknown_login_names.csv)

The days with no Snowflake records are the days our loop’s user did not sign in or run queries, because the export read that one user only. In a reader’s ACCOUNT_USAGE export, a Snowflake day with no sign-in records means nobody signed in to the whole account, which is a day to explain.

Run it on your own data

To run it on your own data, save your exports as CSV files, each with a header row, in one folder. Then change the settings at the top of the script and nothing else. Set DATA_DIR to that folder. Set PERIOD_START and PERIOD_END to the first and last day of the period, and AS_OF to the day you took the exports. Set PLATFORMS to the platforms you exported; a platform with no rows in your daily file is reported as NOT CHECKED. In HISTORY_DAYS, give the number of days each platform's views keep each log, and in KEPT_SINCE the first day covered by any daily copies you keep, or {} if you keep none. List in QUIET_DAYS any day you know a platform had no activity. Set FAILED_PER_DAY_LIMIT to the number of failed sign-ins in one day above which a login is listed. Set FILE_NAMES to the names of your files. In COLUMN_MAP, change the name on the right of each line to the column name in your file; leave the names on the left as they are, and names are matched without regard to case. Write every day as YYYY-MM-DD, every time as YYYY-MM-DD HH:MM:SS in UTC, and each log as sign_ins or queries. Then run the script with no options.

We ran those sentences literally on a reader’s files built for the purpose: other file names, other column names in another order, platform names typed in capitals and in mixed case, a time with fractions of a second, a period of 2026-04-01 to 2026-06-30, and Redshift in PLATFORMS with no rows. We planted one Snowflake day with no sign-in records, a Databricks holiday listed in QUIET_DAYS, six failed sign-ins in one day for SVC_BI against a limit of 3, and one attempt on root, a name that is not a login. Run 8 is the output. Each planted case is listed, Redshift is reported as NOT CHECKED, and the holiday is listed as a quiet day, not as a gap.

Output from our run 8: the script on that reader’s files (from the audit controls on)
1. AUDIT CONTROLS: did each platform keep sign-in and query records on every day of the period?
  snowflake   sign_ins  90 of 91 days with records, 1 with none, 0 NOT COVERED
  snowflake   queries   91 of 91 days with records, 0 with none, 0 NOT COVERED
  databricks  sign_ins  90 of 91 days with records, 0 with none, 1 quiet, 0 NOT COVERED
  databricks  queries   90 of 91 days with records, 0 with none, 1 quiet, 0 NOT COVERED
  redshift    NOT CHECKED: no rows in signins_per_day.csv
  Population: 364 platform-log-days, period 2026-04-01 to 2026-06-30, exports taken 2026-07-02, SHA-256 742dd7cfc8541cf5...

  Days with no records (a platform in use writes sign-in and query records every day; each day needs a reason):
    snowflake   sign_ins  2026-06-10 to 2026-06-10 (1 day(s))
  Quiet days you listed in QUIET_DAYS (not counted as gaps, still listed):
    databricks  queries   2026-05-25 to 2026-05-25 (1 day(s))
    databricks  sign_ins  2026-05-25 to 2026-05-25 (1 day(s))

2. LOG-IN MONITORING: failed sign-ins from 2026-04-01 to 2026-06-30
  Population: 8 failed sign-in(s), SHA-256 4761ee3a35cce97c...
  By login:
    snowflake   SVC_BI                        6 failed on 1 day(s), most in one day 6, first 2026-06-03 14:00:00, last 2026-06-03 14:05:00  (JWT_TOKEN_INVALID)
    databricks  lee@corp.example              1 failed on 1 day(s), most in one day 1, first 2026-05-02 08:00:00, last 2026-05-02 08:00:00  (401)
    snowflake   root                          1 failed on 1 day(s), most in one day 1, first 2026-06-20 09:15:00, last 2026-06-20 09:15:00  (USER_DOES_NOT_EXIST)
  Logins with more than FAILED_PER_DAY_LIMIT = 3 failed sign-ins on one day:
    snowflake   SVC_BI                     2026-06-03  6 failed
  Failed attempts on names that are not a login in accounts.csv:
    snowflake   root                       1 failed
  Failed sign-ins cannot be seen on the NOT COVERED sign_ins days below.

3. NOT COVERED (days these exports cannot show; never read as nothing happened)
  redshift    all logs  2026-04-01 to 2026-06-30 (91 day(s)): no rows exported for this platform

1 platform-log-day(s) with no records, 91 NOT COVERED, 8 failed sign-in(s), 1 login-day(s) over the limit, 1 unknown name(s).
Evidence written to hipaa-log-out/ (audit_days.csv, failed_sign_ins_in_period.csv, logins_over_limit.csv, unknown_login_names.csv)

Download: hipaa_log_check.py · hipaa_log_evidence.py · Get the full guide (PDF)

Get the full guide as a PDF

We'll email you a link to it. Please use your work email.

How to show access was approved and removed on time

The ratings say most about one pair of items. Access authorization (164.308(a)(4)(ii)(B)) and Termination procedures (164.308(a)(3)(ii)(C)) are both Partial, and the log gives half of each:

  • Given and removed, with times: the platform’s grant history. As one example, Snowflake’s GRANTS_TO_USERS view has a CREATED_ON column for when a role is granted, a DELETED_ON column for when it is revoked (null while the grant is active) and a GRANTED_BY column naming the role that made the grant (Snowflake: GRANTS_TO_USERS (read 2026-10-18)).
  • Approved: not in the log. The request and the approver are in your request or ticket system.
  • On time: not in the log either. It is the gap between the grant and removal dates and the dates the policy sets, and the end date of a person’s employment or assignment comes from HR.

So the evidence for the pair is three records joined on the person and the dates: the grant history, the approval and the HR date. The guide to proving who approved each data access and the minimum necessary guide do that join with code.

Method

  • Rule source: 45 CFR Part 164 Subpart C from the eCFR versioner API, https://www.ecfr.gov/api/versioner/v1/full/2026-10-01/title-45.xml?part=164&subpart=C, 37,883 bytes after decompression in Run 1 (37,860 in our first run on 2026-10-18, with the same parsed list); the subpart’s latest amendment is dated 2020-11-24 (from https://www.ecfr.gov/api/versioner/v1/versions/title-45.json?part=164&subpart=C). It is a US federal regulation, public.
  • Rating unit: one row per standard and one per implementation specification, 63 in all. A standard that has specifications is rated on its own text too, so a rated standard and its rated specifications are separate rows. The rating table is written out in the script and in the CSV, with a reason for each item.
  • Rating self-checks, each with the fault that trips it: no citation twice (a duplicated row); the list equals Appendix A for 164.308 to 164.312 (a duplicated or dropped item); every item has a rating (an item the rating table lacks); every key in the rating table matches an item with the same name (a renamed or dropped item); every rating is Direct, Partial or None and the shares add up to 100% (a typo in the table). The CSV is written only if all pass.
  • Records in Runs 3 to 6: generated by the script from a fixed seed, so every run of the same command prints the same lines: ten logins with example.com addresses or invented user names, three platforms, invented daily counts. Nothing in them is a measurement of any company or platform.
  • Day states: a day is NOT COVERED when it is after AS_OF, outside the HISTORY_DAYS days that end on AS_OF (unless KEPT_SINCE starts earlier), or the platform or log was not exported. Otherwise it has records, or is listed as a quiet day, or is a day with no records.
  • Checks and what trips each: the date, time, count, platform, log and duplicate checks (Run 5), the header check (Run 6), and a cross-check that no day has more failed sign-ins than sign-in records, since both files come from the same log. The dates, PLATFORMS, HISTORY_DAYS, KEPT_SINCE and QUIET_DAYS are checked before any file is read.
  • Populations: each list is printed with its period, row count and a SHA-256 of its rows in a fixed order, so the same files give the same fingerprint (Run 4).
  • Names: platforms, logs and logins are compared without regard to case or surrounding spaces.

Limits

  • This is not a client result. Run 1 rates a public regulation. Runs 3 to 6 and Run 8 use generated or invented records. Run 7 is real records from sandbox accounts of ours, read through one user’s functions on Snowflake. None of them says what any company’s logs record.
  • The ratings are our judgment, made by us from the rule text. A reasonable reader could rate some items differently, for example whether a setting counts as evidence (automatic logoff, encryption), whether the login history is enough for person or entity authentication (164.312(d)) or whether a log can be “the record” the rule asks to be documented (164.316(b)(1)). That is why the table is written out.
  • A day with records is not proof that every action was recorded. The check shows that each platform’s log was writing on each day, and which days your exports cannot show. It cannot show that a record is missing from a day that has some.
  • A failed sign-in is only what the platform recorded. Run 7 shows one case: the requests we sent to Databricks with a made-up token had left no sign-in record in the audit log when we exported. Failures that end before the platform records them are not in any export.
  • The limit is yours. The rule sets no number of failed attempts. A service account with a stale key can fail every few minutes, and a person once a month; set the limit, and read each listed login, with that in mind.
  • A log is evidence, not proof of compliance. Direct means a log alone is the record of the thing. It does not mean the organization meets the standard, and we do not say what any auditor or regulator will accept.
  • The rule is technology-neutral. It says covered entities may use any security measures that allow them to reasonably and appropriately implement the standards (164.306(b)), so an item rated None here may still be met by a measure that leaves a different record.
  • Only Subpart C. We did not rate the Privacy Rule (Subpart E) or the Breach Notification Rule (Subpart D), which also call for records. Our numbers are for the eCFR version dated 2026-10-01.

Tested on

Tested on

Platform
DuckDB 1.5.6, Python 3.14, run from Python with the duckdb module; Runs 3 and 4 also ran on DuckDB 2.0.0 with the same output
Edition
Open-source DuckDB, in-memory. The Run 7 exports came from Snowflake Enterprise Edition and from Azure Databricks, Premium tier, serverless compute, Unity Catalog.
Date
2026-11-06
Dataset
Run 1 and 2: 45 CFR Part 164 Subpart C, eCFR version of 2026-10-01 (US federal regulation, public; source). Runs 3 to 6: generated records, shaped like the Step 5 exports. Run 7: real sign-in and query records from Snowflake and Databricks sandbox accounts, with failed sign-ins we made, and a logins file we wrote. Run 8: an invented reader layout. There was no Redshift account: nothing here is a run on Redshift.
Code
hipaa_log_check.py, hipaa_log_evidence.py, result hipaa_log_evidence.csv

When this is not enough

  • A list is not a review. The rule’s text asks for monitoring and for reporting discrepancies. Someone has to read the lists, decide which entries matter, and keep a record of what they decided.
  • One run is one picture. Run the exports and the script on a schedule, keep the files, and the days add up to a period. On Redshift that is the only way to cover more than about a week.
  • The None items are most of the rule. Risk analysis, policies, contracts, training and physical safeguards need their own evidence, from outside the data platform.
  • Legal advice is not here. Whether a safeguard is reasonable and appropriate for your organization is for your compliance and legal team.

Evidence for HIPAA from the records your platforms already keep

Governance Evidence Pack is in early access, open now to design partners. It checks every night that sensitive data has an owner, is deleted when your policy says, and is reached only through your approval process. When the audit comes, it turns those checks into evidence for SOX or HIPAA. Every finding shows how it was produced, so the auditor can check it themselves.

Governance Evidence Pack is a separate module of Data Control Tower. Every day Data Control Tower reads the records your data platforms already keep, and it never writes to them. We produce the evidence. Your auditor decides.

See the Governance Evidence Pack