Skip to content

Commit f46ed7c

Browse files
ashbkaxil
authored andcommitted
Don't let webserver run with dangerous config (#12747)
(cherry picked from commit dab783f)
1 parent d59853a commit f46ed7c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

airflow/bin/cli.py

+11
Original file line numberDiff line numberDiff line change
@@ -1138,6 +1138,17 @@ def webserver(args):
11381138
py2_deprecation_waring()
11391139
print(settings.HEADER)
11401140

1141+
# Check for old/insecure config, and fail safe (i.e. don't launch) if the config is wildly insecure.
1142+
if conf.get('webserver', 'secret_key') == 'temporary_key':
1143+
print(
1144+
"ERROR: The `secret_key` setting under the webserver config has an insecure "
1145+
"value - Airflow has failed safe and refuses to start. Please change this value to a new, "
1146+
"per-environment, randomly generated string, for example using this command `openssl rand "
1147+
"-hex 30`",
1148+
file=sys.stderr,
1149+
)
1150+
sys.exit(1)
1151+
11411152
access_logfile = args.access_logfile or conf.get('webserver', 'access_logfile')
11421153
error_logfile = args.error_logfile or conf.get('webserver', 'error_logfile')
11431154
num_workers = args.workers or conf.get('webserver', 'workers')

0 commit comments

Comments
 (0)