0
0
Apache Airflowdevops~20 mins

Connection encryption in Apache Airflow - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Connection Encryption Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Understanding Airflow Connection Encryption Purpose

Why is connection encryption important in Apache Airflow?

AIt protects sensitive connection credentials from being exposed in the Airflow metadata database.
BIt speeds up the execution of DAGs by compressing connection data.
CIt allows Airflow to connect to external APIs without authentication.
DIt automatically retries failed tasks using encrypted channels.
Attempts:
2 left
💡 Hint

Think about what sensitive information Airflow stores and why encryption matters.

Configuration
intermediate
1:30remaining
Enabling Connection Encryption in Airflow Configuration

Which configuration setting enables connection encryption in Airflow?

ASet <code>encrypt_connections = True</code> in <code>airflow.cfg</code>.
BAdd <code>connection_encryption = enabled</code> in the DAG file.
CSet <code>fernet_key</code> in <code>airflow.cfg</code> under the <code>core</code> section.
DSet <code>enable_ssl = True</code> in the <code>webserver</code> section.
Attempts:
2 left
💡 Hint

Look for a key related to encryption in the main Airflow config file.

💻 Command Output
advanced
2:00remaining
Output of Airflow Connections List with Encryption Enabled

What is the output of the command airflow connections list when connection encryption is enabled and passwords are set?

Apache Airflow
airflow connections list
AThe passwords are shown as encrypted strings (e.g., <code>gAAAAAB...</code>).
BPasswords are replaced with <code>***</code> and not shown.
CThe command fails with a decryption error.
DThe passwords are shown in plain text.
Attempts:
2 left
💡 Hint

Think about how Airflow stores and displays encrypted passwords.

Troubleshoot
advanced
2:00remaining
Troubleshooting Connection Decryption Failures

You enabled connection encryption by setting a new fernet_key but now Airflow fails to decrypt existing connection passwords. What is the cause?

AThe database connection string is incorrect.
BThe Airflow version does not support encryption.
CThe <code>airflow.cfg</code> file is missing the <code>executor</code> setting.
DThe new <code>fernet_key</code> does not match the key used to encrypt existing passwords.
Attempts:
2 left
💡 Hint

Think about how encryption keys work for decrypting data.

Best Practice
expert
2:30remaining
Best Practice for Managing Airflow Fernet Keys

What is the best practice for managing the fernet_key used for connection encryption in Airflow?

AGenerate a new <code>fernet_key</code> every time Airflow starts to maximize security.
BStore the <code>fernet_key</code> securely outside the codebase and rotate it carefully without losing access to encrypted data.
CHardcode the <code>fernet_key</code> in DAG files for easy access.
DDisable encryption and rely on database user permissions instead.
Attempts:
2 left
💡 Hint

Consider security and data availability when handling encryption keys.