Customer Snapshot
| Attribute | Details |
|---|---|
| Scenario | Representative scenario for a healthcare services and commercialization company with production databases |
| Industry | Healthcare services and commercialization |
| Cloud Environment | Multi-cloud (AWS-heavy), with managed databases on each cloud |
| Databases | PostgreSQL, MySQL, and SQL Server (MSSQL) holding program, member, and prescription-access related records |
| Who Queries | Data analysts, program support staff, application engineers, DBAs, and approved outside partners |
| Data Sensitivity | PHI-adjacent: member and patient identifiers, contact details, enrollment and prescription-access records |
| Compliance Drivers | HIPAA minimum necessary, SOC 2, customer and partner contracts |
| Audience | DBAs, data platform leads, security engineers, compliance |
| Focus Area | Showing each person only the columns and rows their task needs |
The Situation: Everyone Who Needs a Record Can See Every Record
A healthcare services company keeps its working data in relational databases. One database tracks program enrollment. Another holds case notes and support interactions. A third stores the outputs of data pipelines that combine partner files. Across them sit columns that identify people: member identifiers, names, dates of birth, phone numbers, email addresses, addresses, and fields that show that a person is enrolled in a program tied to a prescription.
This page uses the term “PHI-adjacent” for that kind of data. Some of it is protected health information (PHI) under HIPAA. Some of it becomes PHI when it is combined with other fields. All of it should be treated with care. This is a representative scenario, not one named company, and the same shape appears across healthcare commercialization teams.
Different groups need to query these databases for good reasons.
- Support staff answer a member’s question about the status of an enrollment.
- Data analysts build reports on program performance and need aggregates, and sometimes row-level checks to validate a pipeline.
- Application engineers debug production problems and need to see why one record failed.
- Database administrators (DBAs) tune and repair databases.
- Outside partners under a contract troubleshoot a load or validate a file.
The usual setup gives each group a database user with read access to the schemas they work in. A read user in a SQL client sees every column of every row it can select. A support agent who needs to know whether member A’s enrollment is active can also scroll through all members’ phone numbers.
The Core Challenge
HIPAA’s minimum necessary standard (45 CFR 164.502(b), with the implementation specifications in 164.514(d)) asks you to limit the PHI that a person uses or sees to what the task requires. Role-based access is the usual way to meet that expectation for applications. For direct database access, the native tools are coarse.
A relational database can allow or deny access to a table, and sometimes to a column. It cannot do the following by itself:
- Show the last four digits of an identifier to support staff and the full value to a finance role.
- Return a masked phone number in the same query that returns an unmasked enrollment status.
- Refuse a query that has no filter and would return the whole table.
- Limit the number of rows a query may return for a given role.
- Tell you which human ran a statement when several people share a database account.
The workarounds are costly. Teams build masked copies of production for analysts, which adds pipelines, storage, and a second place where sensitive data lives. They write views for support, which drift when the schema changes. They give engineers production access “just for the incident,” and the access lingers. Or they route every question through the DBA team, which becomes a queue.
Each workaround adds either risk or delay. The company needs a control that works at the moment a person queries production, and one that does not move the data out of the company’s cloud.
Where the Gaps Were
1. Shared and Standing Database Accounts
Database users are often created once and used by many people. A shared “readonly_support” user is common. The audit log then shows the account name, not the person. If a question arises about who viewed a member’s record, nobody can answer it. Standing accounts also persist. A user created for a project in 2022 may still work today.
2. Read Access Means Full Visibility
A read user sees plaintext in every column it can select. The support agent, the analyst, and the engineer all see the same thing, even though their tasks differ. Anyone who can run SELECT * can retrieve identifiers they never needed.
3. Exports Are Easy and Unbounded
A SQL client can return a million rows and save them to a file. Business intelligence tools are designed to export. Without a row limit or a table restriction, “looking up one member” and “downloading all members” differ by a few keystrokes.
4. Destructive Statements Are One Typo Away
Engineers who need to fix a production record can also run DELETE without a WHERE clause or DROP a table. Native permissions can remove those abilities, but then fixes need a DBA, and teams grant broader rights to avoid delays.
5. Audit Logs Are Engine-Specific and Hard to Search
Each database engine has its own audit facility, with its own format and its own cost in performance. Even when enabled, logs rarely tie a statement to a human identity from the company’s directory. During a privacy inquiry, assembling “who looked at this member’s data in the last 90 days” can take days.
6. Sending Queries to a Third Party Is a Non-Starter
Some monitoring and masking products capture query traffic on the vendor’s own infrastructure. For a company that must account for every party that can see PHI-adjacent data, adding a vendor to the data path creates a contract, a risk review, and a new place for data to exist.
The Cloudanix Solution
Cloudanix combines two products for this problem: Database JIT controls who can connect and for how long, and Database Activity Monitoring (DAM) controls what they can see and do once connected. DAM requires Database JIT as its foundation. DAM is an add-on to the Database JIT product, which is part of Access Pro.
Layer 1: Database JIT, So Nobody Has a Standing Login
With Database JIT, there is no permanent database account for a person to hold. A user asks for access to a specific database, for a defined time. An approver grants it. Cloudanix issues a temporary credential for that session, and the credential stops working at the end of the window. Database JIT supports MariaDB, MySQL, PostgreSQL, SQL Server, and CosmosDB.
This addresses the first gap directly. The “readonly_support” account disappears. Each person connects as themselves, and the grant carries a reason and an approver. For routine support work, an on-call or team-lead approval may be enough. For analytics against the most sensitive database, you can require a second approval from a data owner. You can read more about the access model in what just-in-time access is.
Layer 2: DAM, a Secure Query Proxy in Your Own Infrastructure
DAM is a secure query proxy that you deploy in your own infrastructure, for example as a container service in your own AWS account. Users connect with the database client they already use, and the proxy sits between the client and the database. Each statement passes through the proxy before it reaches the database, and each result passes through before it reaches the user.
Because the proxy runs in your cloud, the query text, the results, and the audit records stay in your cloud. The control plane (the console where administrators set policy) is separate from the data plane. DAM leads with PostgreSQL, MySQL, and MSSQL, and other engines are built in order of customer priority. The existing page on data-sovereign DAM on an existing ECS and VPC peering setup shows how this deployment fits into a network you already run.

Layer 3: Masking by Role, With Eight Strategies
After a statement runs and before rows reach the user, DAM applies masking policy according to the user’s role. The same SELECT returns different views to different people. DAM offers eight masking strategies: full mask, show last four, show first four, email mask, phone mask, hash, redact, and tokenize.
For a healthcare data set, a policy might look like this.
| Column | Support role | Analyst role | Approved data steward |
|---|---|---|---|
| Member identifier | Show last four | Hash, so records can be joined without exposing the value | Full value |
| Full name | Full mask | Full mask | Full value |
| Date of birth | Redact | Redact | Full value |
| Phone number | Phone mask | Full mask | Full value |
| Email address | Email mask | Hash | Full value |
| Street address | Full mask | Redact | Full value |
| Enrollment status | Visible | Visible | Visible |
| Program code | Visible | Visible | Visible |
| Prescription-access flag | Visible | Visible | Visible |
The support agent can answer “is this member enrolled, and is the program active” without seeing a full identifier or contact details. The analyst can join and count records by hashed identifier, validate a pipeline, and never see a name. The steward role, held by a small group with a documented need, sees full values.
Hashing is the strategy to know for analytics. A hashed value is consistent, so the analyst can confirm that two records share an identifier or count distinct members. They cannot read the original value.
Two honest notes apply. First, masking at the query layer is a minimum-necessary control. It is not HIPAA de-identification. Your privacy officer decides whether any output meets a de-identification standard. Second, your teams decide which columns are sensitive. DAM applies the policy you write. It does not discover or classify sensitive data on its own, so build the column list from your data dictionary and your privacy review, and revisit it when schemas change.
Layer 4: Guardrails Against Wide and Destructive Queries
Masking controls what a person sees. Guardrails control what a statement may do and how much it may return. Administrators can set the following per policy:
- Block
DELETE,DROP, andTRUNCATEstatements. - Require a
WHEREclause on queries, so an unfiltered table dump is rejected. - Restrict specific tables and columns for a role.
- Limit the number of rows a query may return.
For the support role, a sensible policy blocks destructive statements, restricts access to tables with no support use, requires a filter, and caps rows at a small number. For analysts, the row cap is higher and the table list is wider, but the destructive statements remain blocked. For engineers on an incident, a break-glass role can allow broader reads with approval and a short time window.
When a statement breaks a rule, the user sees a clear message that names the rule. That feedback helps people learn the policy instead of looking for a way around it. The existing page on safe production data fixes for support teams with DAM guardrails and approvals shows how guardrails and approvals work together for people who need to correct records.
Layer 5: Every Query Logged to Your Storage
DAM records each statement: who ran it, when, which tables and columns it touched, how many rows came back, and whether a rule blocked it. The log is written to storage in your own account, so you control retention and who can read it. Because the user connected through Database JIT, the “who” is the person’s directory identity, tied to the approval and the reason for the session.
When a privacy officer asks who viewed a member’s record in the last quarter, the answer is a search over the log. When an auditor asks for evidence of minimum-necessary controls, you can show the masking policy, the guardrail policy, the approvals, and the query records.
How a Session Works End to End
Here is one example, a support agent investigating a member complaint.
- The agent opens a request in Slack or the Cloudanix console: production enrollment database, support role, 60 minutes, reason “Member complaint, case 20417.”
- The team lead approves. If policy requires it, a second approver for sensitive databases also approves.
- Cloudanix issues a temporary credential. The agent connects with their usual SQL client to the DAM proxy endpoint.
- The agent runs
SELECT status, program_code, member_id, phone FROM enrollment WHERE member_id = '...'. - The proxy checks the statement against the support policy. It has a
WHEREclause, targets an allowed table, and is not destructive, so it proceeds. - The database returns the row. The proxy masks
member_idto the last four digits and masksphonebefore the rows reach the agent. - The agent sees status and program code in full, and masked identifiers. They resolve the complaint.
- The agent then tries
SELECT * FROM enrollmentto look at “a few more.” The proxy rejects it because there is noWHEREclause, and the log records the blocked attempt. - After 60 minutes, the credential stops working. The session ends with no cleanup step.
Nothing in this flow moved data to Cloudanix. The query, the result, and the log stayed in the company’s infrastructure.
Designing the Policy: A Working Method
A masking and guardrail program succeeds when the policy matches how people actually work. Use these steps.
- Name the roles by task, not by title.
“Support lookup,” “analytics validation,” “incident debugging,” and “data steward” describe tasks. Titles change. Tasks are stable. Map directory groups to these roles.
- List the columns, then the tasks that need them.
Start with your data dictionary. For each sensitive column, write who needs the full value, who needs a partial value, and who needs only to join on it. Most columns will have a short list of people who need the full value.
- Pick the weakest strategy that does the job.
If a role needs to compare identifiers, hash them. If they need to verify identity by the last digits, show the last four. Use full mask or redact when the column serves no purpose for the role.
- Set row limits from real behavior.
Review a week of normal queries in a non-production copy of the policy, then set caps just above normal use. A cap that is too tight pushes people to workarounds.
- Start in non-production.
Turn on the proxy for a non-production database first, with strict guardrails. Use the blocked-query log to tune. Then promote to production.
- Decide the exceptions in advance.
Incidents will need broader access. Define a break-glass role with approval, a short window, and a mandatory review afterward. Then people use it instead of inventing a shortcut.
- Review on a schedule.
Policies drift when schemas and teams change. Add a periodic review, for example quarterly, and check new columns for sensitivity.
What to Verify in a Proof of Concept
Privacy and security teams should test claims in their own environment. These checks help.
| Question | How to verify |
|---|---|
| Does query data leave our cloud? | Inspect the proxy’s network paths and the location of the audit log. Both should be in your account |
| Does masking apply per role? | Run the same query as two roles and compare the results |
| Do aggregates leak masked values? | Try counts and group-by queries on a masked column and review the output |
| Are unfiltered queries blocked? | Run a SELECT with no WHERE as the support role |
| Are destructive statements blocked? | Try DELETE, DROP, and TRUNCATE in non-production |
| Can the row cap be enforced? | Run a query that would return more rows than the cap |
| Is each statement tied to a person? | Review the log for the identity, the approval, and the reason |
| Do sessions expire? | Wait out the window and try to reconnect |
| Which engines are covered? | Confirm that your PostgreSQL, MySQL, and MSSQL instances are in scope, and ask about any other engine you run |
Where DAM Fits With Other Controls
DAM does not replace the rest of your data protection program. It works alongside:
- Encryption at rest and in transit, which protects data on disks and in the network.
- Network segmentation, which limits which systems can reach the databases at all.
- Application-level access control, which governs what users see in the applications themselves.
- Cloud posture checks, which find public databases, missing encryption, and weak settings. Cloudanix CSPM covers those, and the HIPAA framework mapping helps you collect evidence for them.
- Vendor access governance, which decides who outside the company can reach the databases. See just-in-time access for data partners and vendors for that program.
Data that must be shared with a partner in a de-identified form should be prepared as an extract at the source. Masking at a query proxy protects interactive access. It does not replace a de-identification process for data sets you release.
What Changes
For a healthcare services company that puts JIT and DAM in front of its production databases, the changes show up in each group’s work.
- For DBAs, shared database accounts and the queue of ad hoc requests give way to policy. DBAs set the roles and rules once and then review exceptions.
- For data platform leads, analysts can validate pipelines on production data without building and refreshing masked copies, and without seeing names and contact details.
- For support teams, a lookup shows what the task needs. Support staff can resolve member questions without holding a full copy of the member’s identity.
- For security engineers, destructive statements and unfiltered dumps are blocked before they run, and every statement is attributed to a person.
- For compliance and privacy, minimum-necessary access has a technical control behind it, and evidence for inquiries and audits is a log search, not a reconstruction.
Key Results
- ✅ No Standing Database Logins: Database JIT grants time-limited, approved sessions under each person’s own identity
- ✅ Role-Based Masking: Eight strategies show each role only the form of a column that its task requires
- ✅ Guardrails Before Execution: Destructive statements, unfiltered queries, restricted tables and columns, and oversized result sets are stopped at the proxy
- ✅ Query-Level Audit: Every statement is recorded with the person, the tables, the row count, and the outcome
- ✅ Data Stays in Your Cloud: The proxy, the query data, and the logs sit in your own infrastructure
- ✅ No Masked Copies to Maintain: One database serves every role through policy
- ✅ Practical Rollout: Start in non-production, tune from the blocked-query log, then promote
Do Your Analysts and Support Staff See More Member Data Than Their Work Needs?
Cloudanix Database JIT and DAM give each person a time-limited, approved session, show only the columns their task requires, and record every query in your own storage. Start with PostgreSQL, MySQL, or MSSQL, and keep the data in your cloud.
Book a Free Assessment to walk through your databases, roles, and a first masking policy.
Related Resources
- Masked Production Visibility for Support Teams on Aurora MySQL
- Data-Sovereign DAM on Your Existing ECS and VPC Peering Setup
- Query-Level Audit and PII Masking for RDS Databases Behind ECS Workloads
- Safe Production Data Fixes for Support Teams with DAM Guardrails and Approvals
- Just-in-Time Access for Data Partners and Vendors in Healthcare Commercialization
- Database Activity Monitoring: Real-Time Data Security
- What is Real-Time Data Masking?
- What is HIPAA Compliance?