🚧 Under construction — VoTechWorks is being built. A free tech program — complimentary, as our commitment to get America working.
voTechWorksGrade 13 · a vocational technology learning center, by urbanicity
newSchoolWorks.com › VoTechWorks › Technology & Design › Data Management / Database Administration › ETL Pipelines: Extract, Transform, and Load for Database Administration › Lesson 7
TEC-DATA86-06 · Lesson 7 · 10 clock hours · theory

ETL Security, Data Privacy, and Governance Alignment

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.

⚠ Pending professional review

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 Security, Data Privacy, and Governance Alignment

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.

Why ETL Pipelines Are a Security Target

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).

Risk 1: Credential Exposure

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.

Risk 2: Unencrypted Transport

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

```

Risk 3: Excessive Privilege

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.

Risk 4: No Audit Trail

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 CDMP Governance Alignment

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:

Safety Note

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.

Connecting to Exam Objectives

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.

Key terms10

Least PrivilegeThe security principle that a user, role, or process should be granted only the minimum permissions required to perform its defined function and no more.
pg_hba.confThe PostgreSQL host-based authentication configuration file that controls which hosts, users, and databases can connect and which authentication method is required for each combination.
SSL/TLS (in PostgreSQL context)The encryption protocol used to protect data in transit between a PostgreSQL client and server; configured via the ssl server parameter and the hostssl record type in pg_hba.conf.
Environment VariableA named value stored in the operating system's process environment and read by an application at runtime, used to supply secrets such as database passwords without embedding them in source code.
Audit TrailA chronological record of who accessed or modified data, when, and from where; required for accountability, breach investigation, and regulatory compliance.
Role-Based Access Control (RBAC)A model in which database permissions are assigned to named roles rather than directly to individual users, making privilege management consistent and auditable.
DAMA DMBOK2The Data Management Body of Knowledge, second edition, published by DAMA International; the authoritative reference guide for data management practices including data security, governance, and quality.
Credential ExposureA security risk that occurs when authentication secrets such as database usernames and passwords are stored or transmitted in a way that makes them accessible to unauthorized parties.
Data LineageDocumentation of the origin, movement, transformation, and destination of data as it flows through systems; a governance requirement that supports auditability and troubleshooting.
sslmodeA PostgreSQL connection parameter on the client side that specifies the level of SSL enforcement; values include disable, allow, prefer, require, and verify-full.
In class: Analyze an instructor-prepared case study of a pipeline that stores database credentials in plain-text script files; identify the vulnerabilities, then rewrite the credential-handling section to use environment variables or a config file outside the source tree. · Review PostgreSQL's ssl connection parameter and pg_hba.conf role-based entries; configure a test pipeline connection to require SSL and a named application role with SELECT-only privileges on source tables. · Map four pipeline risks (credential exposure, unencrypted transport, excessive privilege, no audit trail) to DAMA CDMP governance controls and Microsoft DP-300 'implement database security' objectives; complete a risk-control matrix worksheet and discuss in pairs.
Materials: Student laptops, PostgreSQL 15 with SSL configured on instructor VM, pg_hba.conf documentation, DAMA DMBOK2 Chapter 11 excerpt (data security), Microsoft DP-300 skills outline, instructor-prepared case study and risk-control matrix worksheet
Check: Completed risk-control matrix with at least four risks each mapped to a specific PostgreSQL or governance control; instructor reviews for accuracy; pass = all four risks correctly mapped with no invented controls

Practice check8

Answer each question, then check it. Nothing is recorded; this is your own practice.

Implement Database Security (DP-300) / Data Security (DAMA CDMP)
1. A developer stores the pipeline database password as the string `password=S3cr3t!` inside a Python script that is committed to a shared Git repository. Which risk does this practice directly create?
Implement Database Security (DP-300) / PostgreSQL CE (EDB)
2. Which pg_hba.conf record type enforces that a connection must use SSL before the server will process it?
Implement Database Security (DP-300) / PostgreSQL CE (EDB)
3. An ETL pipeline extracts data from a single table called `sales_orders`. Following the principle of least privilege, which PostgreSQL grant is most appropriate for the pipeline's application role?
Implement Database Security (DP-300) / PostgreSQL CE (EDB)
4. A DBA wants the pipeline client to refuse to connect if the server cannot provide an encrypted channel. Which sslmode value should be set in the connection string?
Data Security (DAMA CDMP)
5. According to DAMA DMBOK2 data security principles, why is an audit trail considered a fundamental control for data pipelines?
Data Security (DAMA CDMP) / Implement Database Security (DP-300)
6. A risk-control matrix entry reads: Risk = 'Pipeline connects as database superuser'; Control = 'Create a named role with SELECT-only on required tables.' Which DAMA governance principle does this control most directly apply?
Implement Database Security (DP-300) / Data Security (DAMA CDMP)
7. Which of the following is the safest method for supplying a database password to a pipeline script running in a Linux production environment?
Implement Database Security (DP-300) / PostgreSQL CE (EDB)
8. A DBA is completing a risk-control matrix for a new ETL pipeline. The risk 'no log of pipeline data access' has been identified. Which PostgreSQL mechanism most directly addresses this risk at the database level?
Record this lesson on my transcript. Sign in with your key and enrollment email to record lessons (enroll free if you have no key). This page stays open to read and practise.