File tree 1 file changed +13
-0
lines changed
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -317,6 +317,19 @@ def webserver(args):
317
317
"""Starts Airflow Webserver"""
318
318
print (settings .HEADER )
319
319
320
+ # Check for old/insecure config, and fail safe (i.e. don't launch) if the config is wildly insecure.
321
+ if conf .get ('webserver' , 'secret_key' ) == 'temporary_key' :
322
+ from rich import print as rich_print
323
+
324
+ rich_print (
325
+ "[red][bold]ERROR:[/bold] The `secret_key` setting under the webserver config has an insecure "
326
+ "value - Airflow has failed safe and refuses to start. Please change this value to a new, "
327
+ "per-environment, randomly generated string, for example using this command `[cyan]openssl rand "
328
+ "-hex 30[/cyan]`" ,
329
+ file = sys .stderr ,
330
+ )
331
+ sys .exit (1 )
332
+
320
333
access_logfile = args .access_logfile or conf .get ('webserver' , 'access_logfile' )
321
334
error_logfile = args .error_logfile or conf .get ('webserver' , 'error_logfile' )
322
335
access_logformat = args .access_logformat or conf .get ('webserver' , 'access_logformat' )
You can’t perform that action at this time.
0 commit comments