opensearch-docs-cn/_security-plugin/configuration/disable.md

63 lines
2.6 KiB
Markdown
Raw Normal View History

2021-05-28 13:48:19 -04:00
---
layout: default
2021-08-17 15:46:50 -04:00
title: Disable security
2021-05-28 13:48:19 -04:00
parent: Configuration
nav_order: 99
---
# Disable security
You might want to temporarily disable the security plugin to make testing or internal usage more straightforward. To disable the plugin, add the following line in `opensearch.yml`:
```yml
2021-06-08 18:35:12 -04:00
plugins.security.disabled: true
2021-05-28 13:48:19 -04:00
```
2021-06-10 11:18:41 -04:00
A more permanent option is to remove the security plugin entirely:
1. Delete the `plugins/opensearch-security` folder on all nodes.
1. Delete all `plugins.security.*` configuration entries from `opensearch.yml`.
2021-05-28 13:48:19 -04:00
To perform these steps on the Docker image, see [Customize the Docker image]({{site.url}}{{site.baseurl}}/opensearch/install/docker#customize-the-docker-image).
2021-05-28 13:48:19 -04:00
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.
{: .warning }
## Remove OpenSearch Dashboards plugin
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 depends on a secured OpenSearch cluster.
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]({{site.url}}{{site.baseurl}}/dashboards/install/plugins#remove-plugins).
2021-05-28 13:48:19 -04:00
### Docker
1. Create a new `Dockerfile`:
```
FROM opensearchproject/opensearch-dashboards:{{site.opensearch_dashboards_version}}
Update disable.md The line to create the new image by deactivating the security plugin uses "security-dashboards" and this returns the following error: docker build --tag=opensearch-dashboards-no-security . Sending build context to Docker daemon 5.12kB Step 1/3 : FROM opensearchproject/opensearch-dashboards:1.0.0 ---> 6a109c3fbebf Step 2/3 : RUN /usr/share/opensearch-dashboards/bin/opensearch-dashboards-plugin remove security-dashboard ---> Running in 965b66ef7abd Unable to remove plugin because of error: "Plugin [security-dashboard] is not installed" The command '/bin/sh -c /usr/share/opensearch-dashboards/bin/opensearch-dashboards-plugin remove security-dashboard' returned a non-zero code: 74 Instead using the correct plugin name "securityDashboards" the image compiles correctly: docker build --tag=opensearch-dashboards-no-security . Sending build context to Docker daemon 6.144kB Step 1/3 : FROM opensearchproject/opensearch-dashboards:1.0.0 ---> 6a109c3fbebf Step 2/3 : RUN /usr/share/opensearch-dashboards/bin/opensearch-dashboards-plugin remove securityDashboards ---> Using cache ---> bb9a535b8e42 Step 3/3 : COPY --chown=opensearch-dashboards:opensearch-dashboards opensearch_dashboards.yml /usr/share/opensearch-dashboards/config/ ---> e6e76bba8a4f Successfully built e6e76bba8a4f Successfully tagged opensearch-dashboards-no-security:latest Ref: - https://opensearch.org/docs/dashboards/install/plugins/#list-installed-plugins - https://github.com/opensearch-project/documentation-website/blob/main/_dashboards/install/plugins.md
2021-07-13 13:06:13 -04:00
RUN /usr/share/opensearch-dashboards/bin/opensearch-dashboards-plugin remove securityDashboards
2021-05-28 13:48:19 -04:00
COPY --chown=opensearch-dashboards:opensearch-dashboards opensearch_dashboards.yml /usr/share/opensearch-dashboards/config/
```
In this case, `opensearch_dashboards.yml` is a "vanilla" version of the file with no entries for the security plugin. It might look like this:
```yml
---
server.name: opensearch-dashboards
server.host: "0.0.0.0"
2021-05-28 13:48:19 -04:00
opensearch.hosts: http://localhost:9200
```
1. To build the new Docker image, run the following command:
```bash
docker build --tag=opensearch-dashboards-no-security .
```
1. In `docker-compose.yml`, change `opensearchproject/opensearch-dashboards:{{site.opensearch_dashboards_version}}` to `opensearch-dashboards-no-security`.
2021-05-28 13:48:19 -04:00
1. Change `OPENSEARCH_HOSTS` or `opensearch.hosts` to `http://` rather than `https://`.
1. Enter `docker-compose up`.