opensearch-docs-cn/_security/configuration/demo-configuration.md

115 lines
4.5 KiB
Markdown
Raw Normal View History

Adds documentation for security demo configuration setup (#6058) * Adds documentation for security demo configuration setup Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Removes hardcoded version numbers Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Updates distributions for different documentations Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Renames placeholder Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Resolves some vale errors Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Resolves some more vale warnings Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Updates sample docker compose wordings Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Improves wordings Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Changes the demo config page title Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Address PR comments Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Renames admin password placeholder and updates another sentence Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Apply suggestions from code review Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Nathan Bower <nbower@amazon.com> Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> --------- Signed-off-by: Darshit Chanpura <dchanp@amazon.com> Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> Co-authored-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com> Co-authored-by: Nathan Bower <nbower@amazon.com>
2024-02-01 13:00:23 -05:00
---
layout: default
title: Setting up a demo configuration
parent: Configuration
nav_order: 4
---
# Setting up a demo configuration
Welcome to the OpenSearch Security plugin demo configuration setup guide. This tool provides a quick and easy way to replicate a production environment for testing purposes. The demo configuration includes the setup of security-related components, such as internal users, roles, role mappings, audit configuration, basic authentication, tenants, and allow lists.
The demo configuration tool performs the following tasks:
1. Configures security settings, which are then loaded into the security index.
2. Generates demo certificates.
3. Adds security-related settings to the `opensearch.yml` file.
## Installing the demo configuration
The demo configuration is automatically called as part of the setup for each supported distribution of OpenSearch. The following are instructions for each distribution.
**Note**: Starting with OpenSearch 2.12, a custom admin password is required in order to install the demo configuration. If none is provided, the cluster will fail to start. Note that this change only affects new clusters. Existing clusters are not affected because they already have `opensearch.yml` configured, so the installation tool will not run.
### Docker
Use the following steps to set up the Security plugin using Docker:
1. Download [docker-compose.yml](https://opensearch.org/downloads.html).
2. In the `docker-compose.yml` file, set `DISABLE_SECURITY_PLUGIN` to `false`.
3. Run the following command:
```bash
$ docker-compose up
```
### Setting up a custom admin password
**Note**: For OpenSearch versions 2.12 and later, you must set the initial admin password before installation. To customize the admin password, you can take the following steps:
1. Download the following sample [docker-compose.yml](https://github.com/opensearch-project/documentation-website/blob/{{site.opensearch_major_minor_version}}/assets/examples/docker-compose.yml) file.
2. Create a `.env` file.
3. Add the variable `OPENSEARCH_INITIAL_ADMIN_PASSWORD` and set the variable with a strong string password.
4. Run `docker-compose up`.
### TAR (Linux)
For TAR distributions on Linux, download the Linux setup files from the OpenSearch [Download & Get Started](https://opensearch.org/downloads.html) page. Then use the following command to run the demo configuration:
```bash
$ ./opensearch-tar-install.sh
```
For OpenSearch 2.12 or later, set a new custom admin password before installation by using the following command:
```bash
$ export OPENSEARCH_INITIAL_ADMIN_PASSWORD=<custom-admin-password>
```
### Windows
For ZIP distributions on Windows, after downloading and extracting the setup files, run the following command:
```powershell
> .\opensearch-windows-install.bat
```
For OpenSearch 2.12 or later, set a new custom admin password before installation by running the following command:
```powershell
> set OPENSEARCH_INITIAL_ADMIN_PASSWORD=<custom-admin-password>
```
### Helm
For Helm charts, the demo configuration is automatically installed during the OpenSearch installation. For OpenSearch 2.12 or later, customize the admin password in `values.yaml` under `extraEnvs`:
```yaml
extraEnvs:
- name: OPENSEARCH_INITIAL_ADMIN_PASSWORD
value: <custom-admin-password>
```
### RPM
For RPM packages, install OpenSearch and set up the demo configuration by running the following command:
```bash
$ sudo yum install opensearch-{{site.opensearch_version}}-linux-x64.rpm
```
For OpenSearch 2.12 or later, set a new custom admin password before installation by using the following command:
```bash
$ sudo env OPENSEARCH_INITIAL_ADMIN_PASSWORD=<custom-admin-password> yum install opensearch-{{site.opensearch_version}}-linux-x64.rpm
```
### DEB
For DEB packages, install OpenSearch and set up the demo configuration by running the following command:
```bash
$ sudo dpkg -i opensearch-{{site.opensearch_version}}-linux-arm64.deb
```
For OpenSearch 2.12 or later, set a new custom admin password before installation by using the following command:
```bash
$ sudo env OPENSEARCH_INITIAL_ADMIN_PASSWORD=<custom-admin-password> dpkg -i opensearch-{{site.opensearch_version}}-linux-arm64.deb
```
### Local distribution
If you are building a local distribution, refer to [DEVELOPER_GUIDE.md](https://github.com/opensearch-project/security/blob/main/DEVELOPER_GUIDE.md) for instructions on building a local binary for the Security plugin.
For OpenSearch 2.12 or later, make sure that you set a strong password before installation.