@@ -394,9 +394,7 @@ def _parse_config(self, config_file):
394
394
logger .critical (msg )
395
395
raise RuntimeError (msg )
396
396
else :
397
- logger .info (
398
- "Password file is not specified: " "Authentication is not enabled"
399
- )
397
+ self ._handle_configuration_without_authentication ()
400
398
401
399
features = self ._get_features ()
402
400
self .settings [SettingsParameters .ApiVersions ] = {"v1" : {"features" : features }}
@@ -471,6 +469,31 @@ def _parse_pwd_file(self):
471
469
472
470
return succeeded
473
471
472
+ def _handle_configuration_without_authentication (self ):
473
+ std_no_auth_msg = "Password file is not specified: Authentication is not enabled"
474
+
475
+ if self .disable_auth_warning == True :
476
+ logger .info (std_no_auth_msg )
477
+ return
478
+
479
+ confirm_no_auth_msg = "\n WARNING: This TabPy server is not currently configured for username/password authentication. "
480
+
481
+ if self .settings [SettingsParameters .EvaluateEnabled ]:
482
+ confirm_no_auth_msg += ("This means that, because the TABPY_EVALUATE_ENABLE feature is enabled, there is "
483
+ "the potential that unauthenticated individuals may be able to remotely execute code on this machine. " )
484
+
485
+ confirm_no_auth_msg += ("We strongly advise against proceeding without authentication as it poses a significant security risk.\n \n "
486
+ "Do you wish to proceed without authentication? (y/N): " )
487
+
488
+ confirm_no_auth_input = input (confirm_no_auth_msg )
489
+
490
+ if confirm_no_auth_input == 'y' :
491
+ logger .info (std_no_auth_msg )
492
+ else :
493
+ print ("\n Aborting start up. To enable authentication for your TabPy server, see "
494
+ "https://github.com/tableau/TabPy/blob/master/docs/server-config.md#authentication." )
495
+ exit ()
496
+
474
497
def _get_features (self ):
475
498
features = {}
476
499
0 commit comments