Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions chapters/chapter13/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Chapter 13

Code accompanying Chapter 13 (Securing Airflow) of the book [Data Pipelines with Apache Airflow](https://www.manning.com/books/data-pipelines-with-apache-airflow).

## Contents

This folder holds three example Docker Compose examples:

- `ldap`: Example configuration of the webserver, fetching user credentials from OpenLDAP
- `rbac`: Example running the RBAC interface
- `secretsbackend`: Example fetching secrets from HashiCorp Vault

Each folder holds a Docker Compose file which can be started with `docker-compose up -d`.

## Usage

Read the `README.md` file in the respective directory.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Demonstrate RBAC UI + LDAP authentication using OpenLDAP.
docker-compose up -d
```

Login in Airflow with `username=bsmith` and `password=test`.
Login in Airflow with username `bsmith` and password `test`.

## Details

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ x-environment: &airflow_environment
- AIRFLOW__CORE__STORE_SERIALIZED_DAGS=True
- AIRFLOW__WEBSERVER__EXPOSE_CONFIG=True
- AIRFLOW__WEBSERVER__RBAC=True

x-airflow-image: &airflow_image apache/airflow:1.10.12-python3.8
# ====================================== /AIRFLOW ENVIRONMENT VARIABLES ======================================

services:
Expand All @@ -23,7 +25,7 @@ services:
- "5432:5432"

upgradedb:
image: apache/airflow:1.10.11-python3.7
image: *airflow_image
depends_on:
- postgres
environment: *airflow_environment
Expand All @@ -42,7 +44,7 @@ services:
command: webserver

scheduler:
image: apache/airflow:1.10.11-python3.7
image: *airflow_image
restart: always
depends_on:
- postgres
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ x-environment: &airflow_environment
- AIRFLOW__CORE__STORE_SERIALIZED_DAGS=True
- AIRFLOW__WEBSERVER__EXPOSE_CONFIG=True
- AIRFLOW__WEBSERVER__RBAC=True

x-airflow-image: &airflow_image apache/airflow:1.10.12-python3.8
# ====================================== /AIRFLOW ENVIRONMENT VARIABLES ======================================

services:
Expand All @@ -25,7 +27,7 @@ services:
- "5432:5432"

initdb_adduser:
image: apache/airflow:1.10.11-python3.7
image: *airflow_image
depends_on:
- postgres
environment: *airflow_environment
Expand All @@ -35,7 +37,7 @@ services:
command: -c 'airflow initdb && sleep 5 && airflow create_user --role Admin --username airflow --password airflow -e [email protected] -f airflow -l airflow'

webserver:
image: apache/airflow:1.10.11-python3.7
image: *airflow_image
restart: always
depends_on:
- postgres
Expand All @@ -47,7 +49,7 @@ services:
command: webserver

scheduler:
image: apache/airflow:1.10.11-python3.7
image: *airflow_image
restart: always
depends_on:
- postgres
Expand Down
2 changes: 2 additions & 0 deletions chapters/chapter13/secretsbackend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM apache/airflow:1.10.12-python3.8
RUN pip install --user hvac~=0.10
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ x-environment: &airflow_environment
- AIRFLOW__SECRETS__BACKEND_KWARGS={"url":"http://vault:8200","token":"airflow","connections_path":"connections"}
- AIRFLOW__WEBSERVER__EXPOSE_CONFIG=True
- AIRFLOW__WEBSERVER__RBAC=True

x-airflow-image: &airflow_image apache/airflow:1.10.12-python3.8
# ====================================== /AIRFLOW ENVIRONMENT VARIABLES ======================================

services:
Expand Down
15 changes: 0 additions & 15 deletions chapters/chapter14/README.md

This file was deleted.

2 changes: 0 additions & 2 deletions chapters/chapter14/secretsbackend/Dockerfile

This file was deleted.