Most companies threat model the product and skip the data platform. The product gets the reviews, the penetration tests and the security champion. The pipeline that copies the product's database into a warehouse every hour, joins it with payments and CRM data, and serves it to half the company through dashboards gets a service account and a Slack channel.
That's backwards. The warehouse often holds more sensitive data than production, in one place, with weaker access controls and more people reading it. This guide walks through a complete threat model of a data pipeline, from ingestion to BI and reverse ETL, on one worked example: the analytics stack behind Invoicely, the fictional invoicing app from our threat model example.
The short version: to threat model a data pipeline, draw every hop the data takes as a data flow diagram: sources, ingestion, landing storage, the warehouse layers, orchestration, transformations, BI, reverse ETL, the secrets that tie it together and the people who query it. Put trust boundaries around vendors, staff devices and anything outside your cloud account. Walk each element with STRIDE plus four pipeline questions: where does each sensitive field end up, which identities can read each layer, what happens when a source sends bad data, and what leaves the platform. Score the threats in a risk register, and expect the top rows to be about copies and credentials, not clever attacks.
What makes a data pipeline different
The method is the same as for any system: a data flow diagram, threats per element, attack trees for the outcomes that matter, and a scored risk register. Five things change what you find:
- Data multiplies. Each stage makes a copy: the landing bucket, the raw schema, staging, marts, extracts, dashboard caches, CSV downloads. Controls on the production database don't follow the data into any of them.
- Identities are machines. Connectors, the orchestrator, transformation jobs and BI tools each hold a credential, usually long lived and usually broad, because a nightly job can't answer a two-factor prompt.
- The code is SQL and configuration. A dbt model, an Airflow DAG or a sync mapping decides what data goes where. A one-line change can expose a column to everyone or send it to a third party, and it rarely gets the review an application change does.
- Integrity failures are quiet. A bad source row doesn't crash anything. It flows through every model and shows up as a wrong revenue number in the board deck a month later.
- Many readers, one big target. Analysts, finance, sales operations, data scientists and contractors all query the warehouse. It's the one place an attacker can get everything at once.
The example: Invoicely's analytics stack
Invoicely is a fictional SaaS invoicing app: a web front end and API in front of a Postgres database, with Stripe for payments. Its data team runs a typical modern stack:
- Ingestion: a managed ELT service replicates the Postgres read replica with change data capture (CDC) and syncs payments from the Stripe API. It writes raw files to a landing bucket in S3.
- Warehouse: a cloud warehouse with three layers: raw (as loaded), staging (cleaned and typed) and marts (modeled tables for reporting).
- Orchestration and transformation: Airflow schedules the loads and runs dbt, which turns raw into staging and marts with SQL models kept in Git. Credentials live in a secrets store.
- Consumers: BI dashboards for finance and the leadership team, ad hoc SQL for data engineers and analysts, and a reverse ETL sync that pushes customer traits and scores into HubSpot for the sales team.
If you're thinking of a build pipeline instead, that's a different system with different threats; see how to threat model your CI/CD pipeline.
Step 1: Draw every hop the data takes
Three choices in this diagram matter more than the rest:
- The ELT vendor is its own trust boundary. A managed ingestion service runs in someone else's cloud and holds a login to your production database. It's a supplier with standing access, and it belongs on the diagram like one.
- The warehouse is one element, but its layers aren't equal. Raw and staging hold every column as it came from production; marts should hold only what reporting needs. Label the layers, because that's where access control has to differ.
- Exits are drawn as flows. CSV exports to laptops, ad hoc SQL and the reverse ETL sync to the CRM are where data leaves the platform. Teams draw the arrows going in and forget the ones going out.
Step 2: Threats per element
Walk each element with STRIDE, as in STRIDE per element, and add the four pipeline questions from the short version: where each sensitive field ends up, which identities can read each layer, what bad source data does, and what leaves the platform. The table lists what that finds on Invoicely.
| Element | What can go wrong | First controls |
|---|---|---|
| Postgres read replica | The replication user can read every table, including password hashes, tokens and bank details nobody reports on; heavy syncs slow production | A dedicated replication role limited to the tables and columns analytics needs; secrets tables excluded at the source |
| Ingestion connectors (ELT vendor) | The vendor's stored database login and Stripe API key are stolen or misused; connector logs keep sample rows; a breach at the vendor reaches you | Read-only credentials scoped per connector; network access only from the vendor's published addresses; a restricted Stripe key; vendor security review |
| Raw landing bucket | Bucket policy or a cross-account share opened too widely; files kept forever; no record of who read them | Block public access; one writer and one reader identity; lifecycle rules that delete landed files after loading; access logging |
| Warehouse | Personal data copied with weaker controls than production; one broad analyst role that reads raw and staging; no row or column level security; data stored in the wrong region | Mask or tokenize sensitive columns at load; separate roles per layer, with raw and staging limited to engineers; masking policies on the columns that stay |
| Orchestrator (Airflow) | Credentials kept in Airflow variables or DAG code; a DAG change runs arbitrary code with every connection the scheduler holds; the web UI exposed | A secrets backend instead of stored variables; DAG changes through reviewed pull requests; the UI behind single sign-on |
| dbt transformations | A model change exposes a sensitive column in a mart, or quietly changes how revenue is calculated; tests don't run before deploy | Code review with an owner for each mart; tests and contracts in CI; column documentation that marks personal data |
| Secrets store | Every job can read every secret; secrets never rotated; no record of access | One secret per job, readable only by that job; scheduled rotation; access logging |
| BI dashboards | Dashboards shared by public link; CSV exports with customer data saved to laptops and forwarded by email; a cached result shown to the wrong group | No public links; exports limited to roles that need them; row level permissions in the BI tool that match the warehouse |
| Reverse ETL sync | A mapping sends sensitive fields to the CRM, where far more people and integrations can see them; a bad sync overwrites good CRM data | An allowlist of fields per destination, reviewed like code; a dry run before a new mapping; sync logs |
| Sources (Postgres, Stripe) | Malformed, duplicated or deliberately poisoned rows flow into every model and report; a schema change silently breaks a join | Source freshness checks and tests on keys and values; alerts on row count and schema changes; quarantine for rows that fail |
Two of these deserve a closer look. The replication role is where the biggest copy starts: if the connector can read the whole database, the whole database ends up in raw, and every later control is cleaning up after that decision. Excluding a column at the source is the cheapest control in the entire pipeline. And the analyst role is where most real exposure happens. It's rarely an attacker; it's a broad role granted in week one so a dashboard would work, which still reads raw tables two years later. The principle of least privilege applies to warehouse roles as much as to servers.
Step 3: An attack tree for data leaving the platform
The per-element list is complete but flat. It doesn't show that the same outcome, customer financial data leaving Invoicely, has three quite different routes, and that a fix on one does nothing for the others. An attack tree with the outcome as its goal does:
The tree makes the uncomfortable point visible: four of the six leaves need no attacker at all. A copy nobody masked, an export nobody tracked, a sync mapping nobody reviewed. For insiders who do mean harm, the same leaves apply, which is why our guide to insider threat modeling treats broad read access as the first thing to fix.
Step 4: Score it and build the register
Each leaf becomes a register row, scored likelihood × impact on a 1 to 5 scale, with ThreatTree's default bands: 16 and above Critical, 10 to 15 High, 5 to 9 Medium. Impact 5 means the whole customer base's financial data; 4 means a large set of customers, or wrong figures in financial reporting. Three integrity and availability rows (P7 to P9) come from the per-element table rather than the tree.
| ID | Threat | L × I | Level | Treatment |
|---|---|---|---|---|
| P3 | Unmasked personal and bank data in raw and staging, readable by every analyst role | 4 × 4 = 16 | Critical | Mitigate: exclude secrets at the source, mask or tokenize bank details on load, raw and staging limited to data engineers |
| P2 | A long-lived warehouse service-account key leaks from Airflow variables, DAG code or Git history | 3 × 5 = 15 | High | Mitigate: secrets backend, short-lived or key-pair credentials, one identity per job, secret scanning on the repository |
| P4 | CSV exports with customer data leave the BI tool for laptops and email | 4 × 3 = 12 | High | Mitigate: exports only for named roles, marts without direct identifiers by default, export events logged |
| P5 | The reverse ETL sync pushes sensitive fields into the CRM | 3 × 4 = 12 | High | Mitigate: per-destination field allowlist, mapping changes reviewed in a pull request, monthly diff of synced fields |
| P7 | Malformed or poisoned source data corrupts revenue and churn figures used in financial reporting | 3 × 4 = 12 | High | Mitigate: tests on keys, amounts and currencies; reconciliation of mart totals against Stripe; quarantine for failing rows |
| P1 | The ELT vendor's stored database login or Stripe key is stolen or misused | 2 × 5 = 10 | High | Mitigate: read-only replication role on allowed tables, restricted Stripe key, source IP allowlist, vendor review each year |
| P6 | The raw landing bucket, or a warehouse share, is opened too widely | 2 × 5 = 10 | High | Mitigate: block public access at the account level, shares reviewed quarterly, alerts on policy changes |
| P8 | An unreviewed dbt or DAG change alters how a metric is calculated, or runs code with the scheduler's credentials | 2 × 4 = 8 | Medium | Mitigate: protected main branch, required review by the mart's owner, CI that runs tests before deploy |
| P9 | A failed load leaves dashboards silently stale | 3 × 2 = 6 | Medium | Accept: dashboards show their last refresh time, freshness alerts go to the data team, and finance closes the month on the ledger, not on dashboards |
The Critical row isn't an attack. It's a copy. That's the most common result of a first data pipeline threat model, and the most useful one: it shows the team that the warehouse already holds data production protects more carefully, and that one masking decision at load time removes most of the exposure downstream. If personal data is involved, the same rows feed your data protection impact assessment; our guide to GDPR threat modeling covers that side.
P9 is the honest row. Invoicely accepts that dashboards can be a day out of date, and writes down why that's acceptable: nothing with legal or financial weight is decided on them alone. Accepting a risk with a reason is part of the threat model, not a gap in it; see risk treatment for the four options.
Step 5: Treat integrity as a security threat
Security reviews of data platforms tend to stop at confidentiality. For a pipeline, integrity is at least as important, because the platform's whole purpose is to produce numbers people trust. Three checks catch most of it:
- Test at the edges. Tests on source keys, required fields and accepted values stop bad rows before they spread. dbt's built-in tests and source freshness checks cover the basics.
- Reconcile against the system of record. A daily check that mart revenue matches Stripe's payouts within a tolerance catches both bugs and tampering, whichever caused the gap.
- Review metric definitions like code. Who can change how "monthly recurring revenue" is calculated, and does anyone else look before it ships? That's an access control question as much as a data quality one.
If your pipeline also feeds a model training set or a retrieval index, poisoned data stops being a reporting problem and becomes a model behavior problem; see how to threat model a RAG application for that case.
Step 6: Keep it current as the pipeline grows
Data platforms change faster than the products they serve: a new source this week, a new dashboard audience next month. Revisit the model when:
- a new source is connected, especially one with personal, payment or health data;
- a new destination appears: a reverse ETL sync, a data share with a partner, a feed into a machine learning pipeline;
- a new group of readers gets access, such as contractors, a new region's team or an external auditor;
- you change ingestion vendor, warehouse or BI tool;
- a number in a report turns out to be wrong: find where the model should have caught it.
Our guide on when to re-threat model has the general triggers. For pipelines, new destinations are the one teams forget, because adding one feels like a configuration change rather than a design change.
What threat modeling can't do for a data pipeline
- It doesn't find the data. Knowing which columns hold personal data needs a data catalog or classification scan. The threat model tells you why it matters and where to look first.
- It doesn't enforce access. Roles, masking policies and bucket policies are configured in the warehouse and the cloud account. The model decides what they should be; something has to check they still are.
- It doesn't test the data. Tests, reconciliation and monitoring catch bad rows. The model tells you which tables need them most.
- It doesn't assess your vendors. The ELT service, the warehouse and the BI tool appear as elements and boundaries, but reviewing their security is a separate job, covered in our supply chain threat modeling guide.
A checklist for your data pipeline threat model
- The diagram shows every hop: sources, ingestion, landing storage, warehouse layers, orchestration, transformations, BI, reverse ETL and secrets.
- Vendors, staff devices and anything outside your cloud account have their own trust boundaries.
- Every flow that takes data out of the platform is drawn: exports, shares, syncs and ad hoc queries.
- Each sensitive field has a known path, and it's masked, excluded or justified at every copy.
- Every job has its own identity and secret, with only the access it needs, and no secret lives in code or variables.
- Raw and staging are readable only by the people who build the pipeline.
- Transformations and sync mappings are reviewed like application code.
- Integrity threats (bad source data, changed metric definitions) are in the register next to confidentiality threats.
- The register ranks likely threats first, and copies are scored as seriously as attacks.
- The model has an owner and is reviewed when a source, destination or reader group is added.
Frequently asked questions
How do you threat model a data pipeline?
Draw every hop the data takes as a data flow diagram: sources, ingestion, landing storage, warehouse layers, orchestration, transformations, BI, reverse ETL, secrets and the people who query it. Put trust boundaries around vendors, staff devices and anything outside your cloud account. Find threats per element with STRIDE plus four pipeline questions (where each sensitive field ends up, which identities can read each layer, what bad source data does, what leaves the platform), build attack trees for the outcomes that matter, and score the threats in a risk register.
What are the biggest security risks in a data pipeline?
Usually not sophisticated attacks. The most common high risks are sensitive data copied into raw and staging layers without masking, broad analyst roles that can read everything, long-lived service-account keys stored in orchestrator variables or code, uncontrolled CSV exports, and reverse ETL syncs that send sensitive fields to tools with far wider access. Integrity risks, such as bad source data corrupting financial reporting, belong on the same list.
How is a data pipeline threat model different from an application threat model?
The method is the same, but the emphasis moves. In an application, most threats sit at the edges where users and attackers interact. In a pipeline, data is copied at every stage, the main identities are machines with standing access, the logic lives in SQL and configuration rather than application code, and the most serious failures are often silent: a leaked copy or a wrong number rather than an outage.
Should bad or poisoned source data be in a security threat model?
Yes. Integrity is one of the three security properties, and for a data platform it's the one the business relies on most. A source sending malformed, duplicated or deliberately falsified rows, or a change to how a metric is calculated, can corrupt financial reporting without any system failing. Model it as a threat, score it, and give it controls such as tests at the source, reconciliation against the system of record and reviewed metric definitions.
Who should own a data pipeline threat model?
The data platform team, with security reviewing it. The people who build the pipeline know where data flows and which credentials exist; security brings the attacker's view and the link to the company's other threat models. Owners of the most sensitive marts, often finance, should review the rows that affect them.