MXS-1220: Allow admin interface to be disabled

Allowing the admin interface to be disabled completely makes it possible
to remove any security concerns that could arise from its use.
This commit is contained in:
Markus Mäkelä
2017-05-11 12:04:36 +03:00
committed by Markus Mäkelä
parent 39da11763b
commit ca7b24f6fa
4 changed files with 26 additions and 10 deletions

View File

@ -54,6 +54,7 @@ using std::string;
const char CN_ADDRESS[] = "address";
const char CN_ADMIN_AUTH[] = "admin_auth";
const char CN_ADMIN_ENABLED[] = "admin_enabled";
const char CN_ADMIN_HOST[] = "admin_host";
const char CN_ADMIN_PASSWORD[] = "admin_password";
const char CN_ADMIN_PORT[] = "admin_port";
@ -1552,6 +1553,10 @@ handle_global_item(const char *name, const char *value)
{
gateway.admin_auth = config_truth_value(value);
}
else if (strcmp(name, CN_ADMIN_ENABLED) == 0)
{
gateway.admin_enabled = config_truth_value(value);
}
else
{
for (i = 0; lognames[i].name; i++)
@ -1774,6 +1779,7 @@ global_defaults()
gateway.skip_permission_checks = false;
gateway.admin_port = DEFAULT_ADMIN_HTTP_PORT;
gateway.admin_auth = false;
gateway.admin_enabled = true;
strcpy(gateway.admin_host, DEFAULT_ADMIN_HOST);
strcpy(gateway.admin_user, INET_DEFAULT_USERNAME);
strcpy(gateway.admin_password, INET_DEFAULT_PASSWORD);