Objective. Students will identify at least four security and privacy risks in ETL pipelines and map each risk to a control drawn from PostgreSQL role-based access, connection encryption, and DAMA CDMP data governance principles.
This lesson, its worked examples and its practice questions has not yet been verified by an industry-certified professional or by a certification or approval body. It is a study draft and may contain errors. Do not use it as instructions for work on a job site or on live equipment. Always follow your instructor, your supervising professional, and current official references and regulations.
VoTechWorks program approval and accreditation are still in progress. Credentials are issued only by the certifying bodies named in each program, after their own exams.
ETL pipelines move data across system boundaries—from source databases, through transformation logic, and into destination stores. Every boundary crossing is a potential attack surface. A poorly secured pipeline can expose credentials, transmit sensitive records in the clear, grant more access than necessary, and leave no record of what happened. This lesson maps the four most common pipeline risks to concrete controls drawn from PostgreSQL features, DAMA CDMP governance principles, and Microsoft DP-300 security objectives.
Pipelines run automatically, often on a schedule, and they need credentials to connect to databases. Developers under deadline pressure sometimes hard-code those credentials directly in script files or check them into version control. Once a password appears in a Git repository, it is effectively public—even after deletion, it remains in commit history. Pipelines also transfer large volumes of data, so an unencrypted connection exposes bulk sensitive records to anyone who can intercept network traffic. Finally, pipelines are often granted broad database privileges because it is easier to connect as a superuser than to figure out the minimum required permissions.
These problems are not hypothetical. Industry breach investigations consistently identify credential mismanagement, unencrypted data in motion, and excessive privilege as root causes. Recognizing each risk and applying a specific control is a core competency for database administrators—and is tested in both the Microsoft DP-300 exam (Implement Database Security domain) and the DAMA CDMP Associate exam (Data Security knowledge area).
Storing a database username and password in a plain-text script file—or worse, in a file committed to version control—means any person with read access to that repository or file system can authenticate to the database as the pipeline user.
Control: Remove credentials from source code entirely. Use environment variables (e.g., `DB_PASSWORD` read at runtime with `os.environ` in Python) or a configuration file stored outside the source tree with file-system permissions restricted to the service account that runs the pipeline. For production environments, a secrets manager (such as a vault service) is the strongest option, but environment variables are a significant improvement over plain-text files.
PostgreSQL connections default to allowing unencrypted sessions unless the server and client are both configured to require SSL/TLS. A pipeline running without encryption sends query results—including personally identifiable information (PII)—across the network in plain text, readable by any network observer on the path.
Control: In `pg_hba.conf`, use the `hostssl` record type for the pipeline's application role so the server rejects unencrypted connections from that account. In the pipeline's connection string, set `sslmode=require` (or `sslmode=verify-full` when server certificate validation is also needed). Together these enforce mutual commitment to encryption: the server will not accept a plain connection, and the client will not send one.
```
hostssl source_db etl_reader 10.0.0.0/24 scram-sha-256
```
Connecting a pipeline as a superuser or as a role with write access to all tables violates the principle of least privilege. If the pipeline is compromised, the attacker inherits its full database permissions. A read-only pipeline has no business writing to tables, dropping indexes, or modifying roles.
Control: Create a dedicated PostgreSQL role for each pipeline with only the privileges it requires. A pipeline that extracts from two source tables needs `SELECT` on exactly those tables—nothing more.
```sql
CREATE ROLE etl_reader LOGIN PASSWORD 'use_env_var_not_this';
GRANT CONNECT ON DATABASE source_db TO etl_reader;
GRANT SELECT ON orders, customers TO etl_reader;
```
In PostgreSQL, default privileges for new tables are not automatically granted to existing roles, so revisit grants when the schema changes.
If the pipeline runs silently—no log of what data was accessed, when, by which role, and whether it succeeded—there is no way to detect anomalous behavior, satisfy a data subject access request, or demonstrate compliance during an audit.
Control: Enable PostgreSQL's `log_connections`, `log_disconnections`, and `pgaudit` extension (where available) to capture session and object-level activity. At the pipeline level, write structured logs that record run time, row counts, source and destination, and any errors. DAMA DMBOK2 Chapter 11 identifies auditability as a fundamental data security principle: every access to sensitive data should be attributable to an identity and preserved for review.
DAMA's Data Management Body of Knowledge (DMBOK2) organizes data security under the Data Security knowledge area. Key governance principles that map directly to pipeline controls include:
Data pipelines can process health records, financial data, or other regulated information. Exposing such data through a misconfigured pipeline carries legal and ethical consequences for the organization and potentially for the individuals whose data is affected. Treat credential files and configuration files that contain connection strings with the same physical security you would apply to any other sensitive document—restrict file-system permissions, do not print them, and do not share them in chat tools or email.
The Microsoft DP-300 skills outline includes "implement database security" as a scored domain. DP-300 expects candidates to understand role-based access control, network security for Azure SQL (analogous principles apply to on-premises PostgreSQL), and auditing. The DAMA CDMP Associate exam draws questions from the DMBOK2 knowledge areas; data security, data governance, and data quality are all represented. Building a complete risk-control matrix—identifying each risk, its likelihood and impact, and the specific control applied—is exactly the kind of structured thinking both exams reward.
Answer each question, then check it. Nothing is recorded; this is your own practice.
A free tech program — complimentary, as our commitment to get America working. Help us build VoTechWorks. Tell us what works, what doesn’t, and what you want to learn.