Disabling security

You might want to temporarily disable the Security plugin to make testing or internal usage more straightforward. The Security plugin is actually two plugins: one for OpenSearch and one for OpenSearch Dashboards. You can use the OpenSearch plugin independently, but the OpenSearch Dashboards plugin requires a secured OpenSearch cluster.

To disable the OpenSearch Security plugin, add the following line in opensearch.yml:

  1. plugins.security.disabled: true

Removing the OpenSearch plugin

A more permanent option is to remove the Security plugin entirely:

  1. Delete the plugins/opensearch-security folder on all nodes.
  2. Delete all plugins.security.* configuration entries from opensearch.yml.
  3. Uninstall the Security plugin by using the following command:

    1. /usr/share/opensearch/opensearch-plugin remove opensearch-security

To perform these steps on the Docker image, see Working with plugins.

Disabling or removing the plugin exposes the configuration index for the Security plugin. If the index contains sensitive information, be sure to protect it through some other means. If you no longer need the index, delete it.

Removing the OpenSearch Dashboards plugin

If you disable the Security plugin in opensearch.yml (or delete the plugin entirely) and still want to use OpenSearch Dashboards, you must remove the corresponding OpenSearch Dashboards plugin. For more information, see OpenSearch Dashboards remove plugins.

Refer to the following installation types to remove the OpenSearch Dashboards plugin.

Docker

  1. Remove all Security plugin configuration settings from opensearch_dashboards.yml or place the example file in the same folder as the Dockerfile:

    1. ---
    2. server.name: opensearch-dashboards
    3. server.host: "0.0.0.0"
    4. opensearch.hosts: http://localhost:9200
  2. Create a new Dockerfile:

    1. FROM opensearchproject/opensearch-dashboards:2.11.1
    2. RUN /usr/share/opensearch-dashboards/bin/opensearch-dashboards-plugin remove securityDashboards
    3. COPY --chown=opensearch-dashboards:opensearch-dashboards opensearch_dashboards.yml /usr/share/opensearch-dashboards/config/
  3. To build the new Docker image, run the following command:

    1. docker build --tag=opensearch-dashboards-no-security .
  4. In docker-compose.yml, change opensearchproject/opensearch-dashboards:2.11.1 to opensearch-dashboards-no-security.

  5. Change OPENSEARCH_HOSTS or opensearch.hosts to http:// rather than https://.
  6. Enter docker-compose up.

Tarball

  1. Navigate to the /bin directory in your OpenSearch Dashboards installation folder and stop the running OpenSearch Dashboards instance by pressing Ctrl + C.

  2. Run the following command to uninstall the Security plugin:

    1. ./bin/opensearch-dashboards-plugin remove securityDashboards
  3. Remove all Security plugin configuration settings from the opensearch_dashboards.yml file or use the following example file:

    1. ---
    2. server.name: opensearch-dashboards
    3. server.host: "0.0.0.0"
    4. opensearch.hosts: http://localhost:9200
  4. Start OpenSearch Dashboards.

    1. ./bin/opensearch-dashboards

RPM and Debian

  1. Stop the running instance of OpenSearch Dashboards by using the following command:

    1. sudo systemctl stop opensearch-dashboards
  2. Navigate to the OpenSearch Dashboards folder /usr/share/opensearch-dashboards and run the following command to uninstall the Security plugin:

    1. ./bin/opensearch-dashboards-plugin remove securityDashboards
  3. Remove all Security plugin configuration settings from the opensearch_dashboards.yml file or place the example file in the /etc/opensearch_dashboards folder:

    1. ---
    2. server.name: opensearch-dashboards
    3. server.host: "0.0.0.0"
    4. opensearch.hosts: http://localhost:9200
  4. Start OpenSearch Dashboards:

    1. sudo systemctl start opensearch-dashboards