A data warehouse or lakehouse concentrates an organisation's most valuable data behind a single platform, so whoever controls the platform's own administration, service identities and keys can read or export all of it. Most warehouse security work focuses on what analysts may see: classification, masking and row level policies. This guide covers the inside view instead: the account administrator roles, the service accounts and tokens used by pipelines and BI tools, encryption keys, network policies, audit logs and the platform lifecycle. It is vendor-neutral and applies to cloud warehouses, lakehouses on object storage and self-managed analytical databases. It is written for data platform engineers, cloud security architects and security operations teams. For the data security discipline as a whole see the Data Security Guide, and for database engines in general the Database Security Guide.
Key takeaways
- The warehouse admin role is a crown jewel identity. The account or workspace administrator can grant itself any data, change network policy and switch off logging, so it needs the protection of a tier 0 account.
- Most logins are not human. ETL jobs, orchestration tools, BI dashboards, reverse ETL and notebooks connect with service users, tokens and keys that outnumber people and are rarely reviewed.
- Password-only access is the main failure. The 2024 campaign against cloud warehouse tenants succeeded with infostealer passwords on accounts that had no MFA and no network allow list.
- Keys, storage and logs sit partly outside the warehouse. Customer managed keys, the object storage under a lakehouse and the exported audit trail each need their own owners and access rules.
- Lifecycle drift is constant. New workspaces, shares, external stages and integrations appear weekly, so a quarterly review of admins, service identities and external access is the minimum.
The warehouse and lakehouse attack surface
Product terminology differs, but every warehouse or lakehouse has the same building blocks. Each one carries privileged identities that need an owner.
| Component | What it does | Identities involved | Primary hardening |
|---|---|---|---|
| Account or organisation control plane | Creates workspaces, users, roles, network and security policies | Account administrators, security administrators, SCIM provisioning token | Few named admins, phishing-resistant MFA, SSO with a break-glass exception |
| Compute (warehouses, clusters, SQL endpoints) | Runs queries and jobs | Job owners, cluster service identities, instance profiles or managed identities | Least privilege run-as identities, no shared admin clusters |
| Catalogue and access policies | Grants on databases, schemas, tables, views, masking and row policies | Data owners, policy administrators | Role hierarchy with separate policy and data ownership |
| Storage layer | Managed storage, or customer object storage for lakehouse tables | Storage integration roles, bucket or container policies, direct storage readers | No direct storage access around the catalogue, encryption with customer keys where required |
| Ingestion and export paths | Stages, external locations, connectors, data shares, unload jobs | Pipeline service users, external stage credentials, share consumers | Allow-listed destinations, monitored exports, owner per share |
| Client connections | SQL clients, drivers, BI tools, notebooks, APIs | Personal access tokens, OAuth clients, key pairs | Short-lived tokens, key pair or federated auth for services, network policies |
| Audit and query history | Login history, query history, access history, admin events | Auditors, log export service | Export to a SIEM run by another team, retention set by policy |
The relevant ATT&CK techniques include T1078.004 Cloud Accounts (stolen warehouse logins), T1213 Data from Information Repositories, T1530 Data from Cloud Storage (reading lakehouse files directly), T1537 Transfer Data to Cloud Account (exports or shares to an attacker controlled account) and T1552.001 Credentials In Files (warehouse passwords and tokens in scripts, notebooks and dbt or orchestration configuration). NIST SP 800-210 notes that cloud access control guidance for the lower service layers also applies to the layers above, which is why a lakehouse needs both storage and catalogue controls.
Administrative roles and separation of duties
Most platforms ship with one or more all powerful built-in roles at account level, plus a security or user administration role and a system role that owns compute. NIST SP 800-53 AC-5 (separation of duties) and AC-6(5) (privileged accounts) apply directly.
| Role | Can do | Should not be able to do | Typical holders |
|---|---|---|---|
| Account administrator | Billing, organisation settings, network and authentication policy | Read business data day to day, approve its own changes | Two or three named platform engineers, used rarely |
| Security or user administrator | Create users and roles, manage grants and policies | Change audit or log export settings unobserved | Platform security team |
| Data owner role per domain | Grant access to its own schemas and tables | Change account-wide settings | Domain data stewards |
| Compute or system administrator | Create and size compute, manage jobs | Grant data access | Data engineering leads |
| Auditor | Read login, query and access history | Change anything | Security operations, internal audit |
- Do not use the top role as a default: set every admin's default role to a low privilege one, and grant the account administrator role to as few people as possible. Never make it the default role of a service user.
- Phishing-resistant MFA for every admin: IA-2(1) requires MFA for privileged accounts. Enforce it through the identity provider and keep a local break-glass admin with a hardware key, stored under split control. See the Break-Glass Account Guide.
- Administer from trusted devices: restrict admin logins to privileged access workstations or a managed device network range. See the Privileged Access Workstations Guide.
- Watch the provisioning path: SCIM tokens and IdP group mappings can create admins. Treat the groups that map to warehouse admin roles as tier 0 and alert on membership changes.
- Grant admin roles just in time: where the platform or a PAM tool supports it, activate admin roles for a session with approval instead of holding them permanently. See the JIT Access Guide.
Service accounts, tokens and integrations
A typical warehouse has more service identities than people: ingestion tools, transformation jobs, orchestrators, BI dashboards, data science notebooks, reverse ETL, data quality tools and AI assistants that generate SQL. Each one is a non-human identity with standing access to data. The OWASP Database Security Cheat Sheet's advice still applies: one account per application or service, least privilege grants, no built-in admin accounts for applications, and separate accounts per environment.
| Authentication method | Use for | Risk if mishandled | Control |
|---|---|---|---|
| Password for a service user | Legacy tools only | Phished, reused, stored in scripts, cannot take MFA | Retire; block password login for service users where the platform allows |
| Key pair (private key on the client) | Pipelines and connectors | Private key copied into repos or images | Store in a secrets manager, rotate with two active keys, one owner per key |
| Personal or programmatic access token | Notebooks, CLI, short tasks | Long lifetimes, tied to a person who leaves | Maximum lifetime set by policy, scoped, revoked at leaver |
| OAuth client (BI and SaaS tools) | Dashboards acting for users | Refresh tokens with broad scopes held by a third party | Approved integrations only, short refresh lifetimes, review of consented clients |
| Workload identity federation | Jobs running in a cloud or CI platform | Over-broad trust conditions | Pin issuer, audience and subject claims to specific workloads |
- Owner and purpose for every service user: record who owns it, which role it uses, which network ranges it connects from and when its credential was last rotated (IA-5, IA-9). See the Database Credential and Access Security Guide.
- Network policy per service user: bind each service user to the egress addresses of the tool that uses it, so a stolen key does not work from anywhere else.
- Read-only by default: BI and AI query tools rarely need write rights. Give them a role that can only select from published views, and route generated SQL through that role. See the AI data access review.
- Storage integration roles: the cloud role that lets the warehouse read external stages or lakehouse storage should be limited to named buckets or containers and prefixes, with a trust condition tied to the warehouse account.
- Leaked tokens: warehouse tokens turn up in notebooks, dbt profiles and CI logs. Run secret scanning on the repos and notebook stores that touch the warehouse, and see Database platform tokens for the response.
Authentication and network policy
In the 2024 campaign against cloud data warehouse tenants, attackers logged in with passwords harvested by infostealer malware, some years old, on accounts with no MFA and no network allow list; about 165 organisations were notified. No platform vulnerability was involved. See the 2024 data warehouse tenant breach analysis. The customer-side controls that would have stopped it are basic:
- SSO for people: human users authenticate through the corporate IdP with MFA, and local passwords are disabled for them.
- No password for services: service users use key pairs, OAuth or federation, never a password.
- Account network policy: allow connections only from corporate egress, private connectivity endpoints and named tool ranges, then add per-user policies for services (SC-7).
- Private connectivity: use the platform's private link option for internal tools and pipelines where it exists, and close the public endpoint if nothing needs it.
- Encrypted transport: require TLS 1.2 or later from all drivers and verify the server certificate (SC-8), as the OWASP cheat sheet recommends.
- Session limits: set idle session timeouts and token lifetimes by policy rather than leaving product defaults unreviewed.
The NCSC Cloud Security Principles make the same point for any cloud service: principle 10 asks that all access to service interfaces be limited to authenticated and authorised identities, human or machine, and principle 11 asks that external interfaces such as APIs, web consoles and command line access be identified and defended.
Encryption keys and storage
- Know the key hierarchy: platforms encrypt by default with provider managed keys. Customer managed keys (bring your own key or a key held in your cloud KMS) give you a revocation lever and separate custody, at the cost of availability risk if the key is disabled. Decide per data domain, not for the whole account. See the Database and Storage Encryption Guide.
- Separate key administrators from warehouse administrators: the people who can disable or rotate the customer managed key should not be the warehouse account admins (SC-12, AC-5). See Securing the cloud key management service (KMS) itself.
- Close the storage side door: in a lakehouse the table files sit in your object storage. Anyone with direct read on the bucket bypasses catalogue grants, masking and row policies. Restrict direct storage access to the warehouse integration role and a break-glass path, and log storage data reads (SC-28).
- Column level encryption or tokenisation: for the most sensitive fields, encrypt or tokenise before loading so that warehouse admins see ciphertext. See the Data Masking and Tokenisation Buyer's Guide.
Logging and monitoring
NCSC principle 13 expects a cloud service to give customers the audit information needed to reconstruct how and when an incident happened. Warehouses expose login history, query history, access history and administrative events, often in system views with limited retention. Export them to a SIEM that warehouse admins cannot alter (AU-9) and keep them for your investigation window (AU-11).
| Event | Why it matters | Suggested response |
|---|---|---|
| Grant of an account admin or security admin role | Fastest route to all data | Alert immediately, confirm with a second person |
| Change to network policy, authentication policy or MFA settings | Opens a path around controls | Alert, match to a change ticket |
| Login with a password by a service user, or from a new IP or client | Matches stolen credential use | Alert, disable and rotate if unexplained |
| New share, external stage, external location or replication target | Data can leave the account | Alert, owner approval within one business day |
| Large result exports, unload commands or row counts above baseline | Matches bulk exfiltration | Alert per identity against a baseline |
| Change to log retention or log export | Classic step before misuse | Critical alert, treat as possible compromise |
| Direct object storage reads outside the integration role | Bypass of catalogue controls | Alert, investigate |
For query-level detection rules see the Database Audit Log Detection Guide.
Lifecycle: build, operate, change, retire
- Build: create accounts and workspaces from code or a documented baseline, with network policy, SSO, MFA enforcement and log export on from day one (CM-6). Record every service identity and key created.
- Operate: review quarterly the holders of admin roles, every service user and token, every share and external location, and every OAuth integration. Remove anything without an owner (AC-2).
- Change: run role and policy changes through change control with peer review (CM-5), and test policy changes in a non-production account first.
- Back up and recover: know what time travel or snapshot features cover and what they do not, keep an independent copy of critical datasets and of the role and grant configuration, and test a restore (CP-9, CP-10).
- Respond: prepare a runbook for a compromised warehouse identity: disable the user, revoke tokens and keys, check query and access history for the exposure window, and review shares and stages created in that window. See the Database Breach Response Playbook.
- Retire: when a workspace or the platform is decommissioned, revoke integrations, rotate credentials held by connected tools, delete external stages and shares, and record key destruction. See the Data warehouse and lakehouse migration playbook.
Hardening an existing warehouse: a phased approach
- Days 1 to 30, visibility: export login, query and admin logs to the SIEM; list all admins, service users, tokens, OAuth clients, shares and external locations; find every user still authenticating with a password only. Rollback: not needed, this phase only reads and alerts.
- Days 31 to 60, authentication: enforce SSO and MFA for people, move services to key pairs or federation one pipeline at a time, then apply an account network policy in a report or test mode where available, starting with a pilot group. Rollback: keep the previous policy definition ready to reapply and a break-glass admin exempt from the new policy.
- Days 61 to 120, privilege: reduce account admins, change default roles, split policy ownership from data ownership and give BI and AI tools read-only roles on views. Test each role change against job runs in non-production.
- Ongoing: quarterly reviews, alerts tuned against the baseline and an annual restore and break-glass exercise. Use the Data warehouse and lakehouse health check as the annual review.
These timings are NHI Mgmt Group's recommendation; scale them to the size of your estate.
Decision guidance
- Provider keys or customer managed keys: provider keys are simpler and resilient. Choose customer managed keys where regulation, contracts or a separate custody requirement demand them, and accept that a disabled key makes data unavailable.
- Public endpoint with network policy, or private connectivity only: private connectivity removes internet exposure but needs every SaaS tool to have a private path. Many organisations run both, with private links for internal pipelines and a strict allow list for SaaS tools.
- Central platform team or federated domains: a central team keeps admin roles small; a data mesh model spreads data owner roles across domains, so central review of shares and grants matters more.
- Small organisations: with one data engineer, separation of duties is impractical. Compensate with SSO and MFA everywhere, a network policy, alerts sent to someone outside the data team and a quarterly review by a second person.
Detection and measurement
- Admin footprint: number of identities holding account level admin roles, target the smallest workable number with none as a default role.
- Password-only logins: percentage of human and service logins in the last 30 days without MFA or key based authentication, target zero.
- Service identity ownership: percentage of service users, tokens and OAuth clients with an owner, a network policy and a rotation date in the last 12 months.
- External data paths: number of shares, external stages and replication targets without a named owner and approval record.
- Log coverage: share of warehouse accounts exporting login, query and admin logs to the SIEM, and alerts tested in the last quarter.
Framework mapping
| Control area | NIST SP 800-53 Rev 5 | NIST CSF 2.0 |
|---|---|---|
| Admin roles and separation | AC-2(7), AC-5, AC-6(5) | PR.AA-05 |
| Human and admin authentication | IA-2(1) | PR.AA-03 |
| Service users and tokens | IA-5, IA-9 | PR.AA-01 |
| Network policy and private connectivity | SC-7, SC-8 | PR.IR-01, PR.DS-02 |
| Keys and storage | SC-12, SC-28 | PR.DS-01 |
| Logging and review | AU-6, AU-9, AU-11, AU-12, AC-6(9) | PR.PS-04, DE.CM-03 |
| Backup, recovery and response | CP-9, CP-10, IR-4 | PR.DS-11, RC.RP-01 |
For cloud provider assurance, the Cloud Security Alliance Cloud Controls Matrix (version 4.1, 17 domains and 197 control objectives) shows which party in the cloud supply chain owns each control.
Common failure patterns
- Password-only service users: a pipeline account with a static password and no network policy works for anyone who finds the password.
- Account admin as everyday role: engineers run routine work under the top role, so one phished session exposes every database.
- Lakehouse buckets readable outside the catalogue: data scientists or tools read table files directly, skipping masking and row policies.
- Orphaned tokens and integrations: tokens and OAuth grants from leavers and abandoned BI tools keep working for years.
- Untracked shares and stages: a data share or external stage created for a one-off project stays open to an outside account.
- Logs left in the platform: query history is kept only for the platform default and never exported, so an investigation cannot reach back far enough.
Practitioner checklist
- Limit account admin roles to a few named people with phishing-resistant MFA and low privilege default roles.
- Enforce SSO and MFA for every human user and disable local passwords for them.
- Move every service user to key pair, OAuth or federated authentication and block password logins.
- Apply an account network policy and per-service-user network policies.
- Give BI and AI query tools read-only roles on published views.
- Restrict direct object storage access under lakehouse tables to the integration role.
- Separate customer managed key administrators from warehouse administrators.
- Export login, query and admin logs to a SIEM run by another team and alert on admin, policy and export events.
- Review admins, service identities, shares and external locations every quarter.
- Test restore and break-glass access at least once a year.
Standards and references
- NIST: SP 800-53 Rev. 5 Security and Privacy Controls
- NIST: SP 800-210 General Access Control Guidance for Cloud Systems
- NIST: Cybersecurity Framework 2.0
- NCSC: The cloud security principles
- OWASP: Database Security Cheat Sheet
- Cloud Security Alliance: Cloud Controls Matrix
- MITRE ATT&CK: Valid Accounts: Cloud Accounts
- MITRE ATT&CK: Transfer Data to Cloud Account
Related NHI Mgmt Group resources: Data Access Governance Guide · Data Security Posture Management (DSPM) · Database Privileged Access Review Template · Data warehouse and lakehouse health check