CIS Apache Airflow Benchmark

Security configuration benchmark for Apache Airflow workflow orchestration

v1.0.0 03-2025

Overview

▶

This benchmark provides prescriptive guidance for establishing a secure configuration posture for Apache Airflow. It covers authentication and RBAC, HTTPS enforcement, Fernet encryption, remote logging, database backend security, executor configuration, DAG access control, API authentication, secrets backend integration, and operational best practices.

14Recommendations
7Sections
2Profile Levels
SectionAreaFocus
1Installation & PermissionsVersion management, file security
2Authentication & AuthorizationAuth backend, RBAC configuration
3Encryption & SecretsHTTPS, Fernet key management
4Logging & AuditingRemote logging, audit trails
5Database & ExecutorPostgreSQL TLS, Celery/K8s executor
6DAG & API SecurityDAG access control, API auth
7Maintenance & Secrets ManagementDB cleanup, Vault integration

Profile Definitions

▶
ProfileDescriptionIntended Use
L1Level 1 — StandardEssential security for all Apache Airflow deployments; minimal performance impact.
L2Level 2 — HardenedAdvanced hardening for PCI-DSS, HIPAA, or high-security environments.

1 — Installation & Permissions

▶

1.1 Deployment & File Security

▶
1.1.1 Ensure Airflow is running the latest stable version (Manual)
L1 Manual
Description

This recommendation verifies that Airflow is running the latest stable version on the Apache Airflow workflow orchestration platform. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Apache Airflow workflow orchestration platform vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Verify Airflow version
airflow version
# Check if running as dedicated user
ps -eo user,pid,comm | grep airflow
Remediation
# Upgrade Airflow to latest stable
pip install --upgrade apache-airflow
# Run as dedicated user:
useradd -r -s /usr/sbin/nologin airflow
chown -R airflow:airflow /opt/airflow
1.1.2 Ensure Airflow configuration file permissions are restricted (Automated)
L1 Auto
Description

This setting ensures that Airflow configuration file permissions are restricted on the Apache Airflow workflow orchestration platform. Restricting this capability limits potential abuse and enforces the principle of least privilege across the environment.

Rationale

Unrestricted access to this capability could allow unauthorized users or processes to perform actions beyond their intended scope. Applying least-privilege principles to the Apache Airflow workflow orchestration platform is essential for defense in depth.

Audit
# Check Airflow home permissions
stat -c '%a %U %G' $AIRFLOW_HOME
stat -c '%a %U %G' $AIRFLOW_HOME/airflow.cfg
stat -c '%a %U %G' $AIRFLOW_HOME/dags/
Remediation
# Restrict Airflow configuration permissions
chmod 700 $AIRFLOW_HOME
chmod 600 $AIRFLOW_HOME/airflow.cfg
chmod 750 $AIRFLOW_HOME/dags/
chown -R airflow:airflow $AIRFLOW_HOME

2 — Authentication & Authorization

▶

2.1 Auth Backend & RBAC

▶
2.1.1 Ensure production authentication backend is configured (Automated)
L1 Auto
Description

This recommendation verifies that production authentication backend is configured on the Apache Airflow workflow orchestration platform. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Apache Airflow workflow orchestration platform vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check web server authentication backend
grep 'auth_backend\|auth_type' $AIRFLOW_HOME/airflow.cfg
grep 'AIRFLOW__WEBSERVER__AUTH_BACKEND' /etc/environment 2>/dev/null
Remediation
# Configure authentication backend (FAB with LDAP/OAuth)
# In airflow.cfg [webserver]:
# auth_backend = airflow.providers.fab.auth_manager.fab_auth_manager
# In webserver_config.py:
# AUTH_TYPE = AUTH_OAUTH
# or AUTH_TYPE = AUTH_LDAP
# Disable default password auth in production
2.1.2 Ensure RBAC is enabled with appropriate roles (Automated)
L1 Auto
Description

This recommendation verifies that RBAC is enabled with appropriate roles on the Apache Airflow workflow orchestration platform. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Apache Airflow workflow orchestration platform vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check RBAC settings
grep -E 'rbac|auth_role' $AIRFLOW_HOME/airflow.cfg
airflow users list
Remediation
# Configure RBAC roles
# In airflow.cfg [webserver]:
# rbac = True
# auth_role_public = Public
# auth_role_admin = Admin
# Create users with appropriate roles:
airflow users create --username admin --role Admin --email admin@example.com
airflow users create --username viewer --role Viewer --email viewer@example.com

3 — Encryption & Secrets

▶

3.1 TLS & Fernet

▶
3.1.1 Ensure HTTPS is configured for the web server (Automated)
L1 Auto
Description

This recommendation verifies that HTTPS is configured for the web server on the Apache Airflow workflow orchestration platform. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Apache Airflow workflow orchestration platform vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check web server SSL configuration
grep -E 'web_server_ssl|ssl_cert|ssl_key' $AIRFLOW_HOME/airflow.cfg
Remediation
# Enable HTTPS for web server
# In airflow.cfg [webserver]:
# web_server_ssl_cert = /etc/airflow/ssl/cert.pem
# web_server_ssl_key = /etc/airflow/ssl/key.pem
# base_url = https://airflow.example.com
3.1.2 Ensure Fernet key is configured for connection encryption (Automated)
L1 Auto
Description

This recommendation verifies that Fernet key is configured for connection encryption on the Apache Airflow workflow orchestration platform. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Apache Airflow workflow orchestration platform vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check Fernet key configuration
grep 'fernet_key' $AIRFLOW_HOME/airflow.cfg
python3 -c "from cryptography.fernet import Fernet; print('Fernet available')"
Remediation
# Configure Fernet key for connection encryption
python3 -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
# In airflow.cfg [core]:
# fernet_key = <GENERATED_KEY>
# Or via environment variable:
# export AIRFLOW__CORE__FERNET_KEY=<GENERATED_KEY>

4 — Logging & Auditing

▶

4.1 Remote Logging & Audit

▶
4.1.1 Ensure remote logging is configured for task logs (Automated)
L1 Auto
Description

This recommendation verifies that remote logging is configured for task logs on the Apache Airflow workflow orchestration platform. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Apache Airflow workflow orchestration platform vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check logging configuration
grep -E 'base_log_folder|remote_logging|remote_log_conn_id' $AIRFLOW_HOME/airflow.cfg
Remediation
# Configure remote logging
# In airflow.cfg [logging]:
# remote_logging = True
# remote_log_conn_id = aws_default
# remote_base_log_folder = s3://airflow-logs/
# encrypt_s3_logs = True
# Or for local logging:
# base_log_folder = /var/log/airflow
# logging_level = INFO
4.1.2 Ensure audit logging is enabled for web UI actions (Automated)
L1 Auto
Description

This recommendation verifies that audit logging is enabled for web UI actions on the Apache Airflow workflow orchestration platform. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Apache Airflow workflow orchestration platform vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check audit log settings
grep -E 'audit|action_logger' $AIRFLOW_HOME/airflow.cfg
Remediation
# Enable action logging
# In airflow.cfg [webserver]:
# audit_view_excluded_events =
# audit_view_included_events = all
# Configure log rotation:
cat > /etc/logrotate.d/airflow << 'EOF'
/var/log/airflow/*.log {
    daily
    rotate 30
    compress
    missingok
}
EOF

5 — Database & Executor

▶

5.1 Backend & Processing

▶
5.1.1 Ensure production database backend is used with TLS (Automated)
L1 Auto
Description

This recommendation verifies that production database backend is used with TLS on the Apache Airflow workflow orchestration platform. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Apache Airflow workflow orchestration platform vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check database backend
grep 'sql_alchemy_conn' $AIRFLOW_HOME/airflow.cfg
airflow db check
Remediation
# Configure production database backend
# In airflow.cfg [database]:
# sql_alchemy_conn = postgresql+psycopg2://airflow:PASS@db:5432/airflow?sslmode=verify-full
# Do NOT use SQLite in production
# sql_alchemy_pool_size = 5
# sql_alchemy_max_overflow = 10
5.1.2 Ensure production-grade executor is configured (Automated)
L1 Auto
Description

This recommendation verifies that production-grade executor is configured on the Apache Airflow workflow orchestration platform. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Apache Airflow workflow orchestration platform vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check executor type
grep 'executor' $AIRFLOW_HOME/airflow.cfg | head -3
Remediation
# Use production-grade executor
# In airflow.cfg [core]:
# executor = CeleryExecutor
# Or:
# executor = KubernetesExecutor
# Do NOT use SequentialExecutor or LocalExecutor in production

6 — DAG & API Security

▶

6.1 Access Control & API Auth

▶
6.1.1 Ensure DAG discovery and access are restricted (Automated)
L1 Auto
Description

This setting ensures that DAG discovery and access are restricted on the Apache Airflow workflow orchestration platform. Restricting this capability limits potential abuse and enforces the principle of least privilege across the environment.

Rationale

Unrestricted access to this capability could allow unauthorized users or processes to perform actions beyond their intended scope. Applying least-privilege principles to the Apache Airflow workflow orchestration platform is essential for defense in depth.

Audit
# Verify DAG access control
grep -E 'dag_default_view|hide_paused' $AIRFLOW_HOME/airflow.cfg
airflow dags list | wc -l
Remediation
# Restrict DAG access
# In airflow.cfg [webserver]:
# expose_config = False
# dag_default_view = grid
# In airflow.cfg [core]:
# dag_discovery_safe_mode = True
# dags_are_paused_at_creation = True
6.1.2 Ensure API authentication is enabled (Automated)
L1 Auto
Description

This recommendation verifies that API authentication is enabled on the Apache Airflow workflow orchestration platform. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Apache Airflow workflow orchestration platform vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check API authentication
grep -E 'auth_backends|api' $AIRFLOW_HOME/airflow.cfg | head -5
Remediation
# Configure API authentication
# In airflow.cfg [api]:
# auth_backends = airflow.api.auth.backend.session
# Or for token-based:
# auth_backends = airflow.providers.fab.auth_manager.api.auth.backend.token_auth
# Disable default deny_all in production as needed

7 — Maintenance & Secrets Management

▶

7.1 Cleanup & Secrets Backend

▶
7.1.1 Ensure metadata database cleanup is scheduled (Automated)
L1 Auto
Description

This recommendation verifies that metadata database cleanup is scheduled on the Apache Airflow workflow orchestration platform. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Apache Airflow workflow orchestration platform vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check database cleanup
airflow db check
airflow db shell -c "SELECT count(*) FROM dag_run WHERE state='success' AND execution_date < NOW() - INTERVAL '90 days';" 2>/dev/null
Remediation
# Configure metadata database cleanup
airflow db clean --clean-before-timestamp '2024-01-01' --yes
# Schedule regular cleanup via DAG or cron:
# 0 2 * * 0 airflow db clean --clean-before-timestamp "$(date -d '-90 days' +%%Y-%%m-%%d)" --yes
7.1.2 Ensure external secrets backend is configured (Automated)
L2 Auto
Description

This recommendation verifies that external secrets backend is configured on the Apache Airflow workflow orchestration platform. Implementing this control strengthens the overall security configuration and reduces exposure to potential threats.

Rationale

Failure to implement this control may leave the Apache Airflow workflow orchestration platform vulnerable to attack or non-compliant with organizational security policies. This control helps establish a consistent, hardened configuration baseline.

Audit
# Check secret backend configuration
grep 'backend' $AIRFLOW_HOME/airflow.cfg | grep -i secret
Remediation
# Configure secrets backend
# In airflow.cfg [secrets]:
# backend = airflow.providers.hashicorp.secrets.vault.VaultBackend
# backend_kwargs = {"connections_path": "connections", "variables_path": "variables", "url": "https://vault:8200"}
# This avoids storing secrets in the metadata database