forked from wazuh/wazuh-docker
Update docs to meet new requirements
This commit is contained in:
@@ -1,45 +0,0 @@
|
||||
# Change passwords
|
||||
|
||||
This section describes how to rotate the credentials used by the provided Docker Compose deployments.
|
||||
|
||||
## Scope
|
||||
|
||||
The Compose files include the following password-controlled integrations:
|
||||
|
||||
- **Wazuh Indexer access (Manager and Dashboard clients)**: `INDEXER_USERNAME`, `INDEXER_PASSWORD`
|
||||
- **Wazuh Dashboard login**: `DASHBOARD_USERNAME`, `DASHBOARD_PASSWORD`
|
||||
- **Wazuh API access (Dashboard client)**: `API_USERNAME`, `API_PASSWORD`
|
||||
|
||||
For variable descriptions, see [Environment variables](environment-variables.md).
|
||||
|
||||
## Rotate credentials
|
||||
|
||||
1. Navigate to your deployment directory:
|
||||
|
||||
- `single-node/` (single-node stack)
|
||||
- `multi-node/` (multi-node stack)
|
||||
|
||||
2. Edit the deployment `docker-compose.yml` and update the required values under `environment`:
|
||||
|
||||
- Single-node: update `wazuh.manager` and `wazuh.dashboard`.
|
||||
- Multi-node: update `wazuh.master`, `wazuh.worker`, and `wazuh.dashboard`.
|
||||
|
||||
Ensure `INDEXER_USERNAME` and `INDEXER_PASSWORD` are consistent anywhere they are defined.
|
||||
|
||||
3. Recreate the containers to apply the new values:
|
||||
|
||||
```bash
|
||||
docker compose down
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
4. Validate access:
|
||||
|
||||
- Log in to the Dashboard with the updated credentials.
|
||||
- Confirm the Dashboard can query data (indirectly validating the Indexer and API credentials).
|
||||
|
||||
## Notes
|
||||
|
||||
- The Manager applies `API_USERNAME` / `API_PASSWORD` at startup by creating or updating the API user.
|
||||
- The Dashboard regenerates its OpenSearch Dashboards keystore on startup; changes take effect after the container is recreated.
|
||||
- Rotating Indexer credentials requires updating both the Indexer user configuration and the Compose client variables (`INDEXER_*`).
|
||||
@@ -0,0 +1,77 @@
|
||||
# Persistence configuration
|
||||
|
||||
When customizing your Wazuh Docker deployment, certain files and directories must be persisted to retain your changes across container restarts and recreations. This is critical for maintaining custom configurations, user credentials, and security settings.
|
||||
|
||||
## Wazuh Indexer
|
||||
|
||||
### Internal Users
|
||||
|
||||
The `internal_users.yml` file contains the initial users and passwords for the Wazuh Indexer. This file is not included by default in the repository and must be created manually if you wish to customize internal users or update passwords.
|
||||
|
||||
#### Creating the Configuration File
|
||||
|
||||
1. Create the directory:
|
||||
```bash
|
||||
mkdir -p ./config/wazuh_indexer/
|
||||
```
|
||||
|
||||
2. Create the file: Create `./config/wazuh_indexer/internal_users.yml` with your user definitions. Here is a basic example:
|
||||
```yaml
|
||||
---
|
||||
# This is the internal user database
|
||||
# The hash value is a bcrypt hash and can be generated with /usr/share/wazuh-indexer/plugins/opensearch-security/tools/hash.sh
|
||||
|
||||
_meta:
|
||||
type: "internalusers"
|
||||
config_version: 2
|
||||
|
||||
# Default users
|
||||
|
||||
admin:
|
||||
hash: "$2a$12$VcCDgh2NDk07JGN0rjGbM.Ad41qVR/YFJcgHp0UGns5JDymv..TOG"
|
||||
reserved: true
|
||||
backend_roles:
|
||||
- "admin"
|
||||
description: "Admin user"
|
||||
|
||||
kibanaserver:
|
||||
hash: "$2a$12$4AcgAt3xwOWadA5s5blL6ev39OXDNhmOesEoo33eZtrq2N0YrU3H."
|
||||
reserved: true
|
||||
description: "Kibana server user"
|
||||
```
|
||||
|
||||
> **Important**: This example includes the default `admin` and `kibanaserver` users with their default passwords (hashed). These users are required for the standard `docker-compose.yml` configuration (e.g., `INDEXER_USERNAME=admin` and `DASHBOARD_USERNAME=kibanaserver`) to function correctly. If you change these passwords, you must also update the corresponding environment variables in your `docker-compose.yml`.
|
||||
|
||||
#### Docker Compose Configuration
|
||||
|
||||
To persist the `internal_users.yml` file, add a volume mount to your `docker-compose.yml` for the `wazuh.indexer` service:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
wazuh.indexer:
|
||||
volumes:
|
||||
- ./config/wazuh_indexer/internal_users.yml:/usr/share/wazuh-indexer/opensearch-security/securityconfig/internal_users.yml
|
||||
```
|
||||
|
||||
> **Note**: Ensure the file exists on your host before starting the containers to prevent Docker from creating it as a directory.
|
||||
|
||||
#### Applying Changes
|
||||
|
||||
After modifying `internal_users.yml`, restart the stack to apply the changes:
|
||||
|
||||
```bash
|
||||
docker-compose down
|
||||
```
|
||||
|
||||
```bash
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
## Other Components
|
||||
|
||||
For other components like the Wazuh Manager and Wazuh Dashboard, persistence is typically handled by mounting their respective configuration directories or using Docker volumes for data storage.
|
||||
|
||||
- **Wazuh Manager**: Persist `/var/ossec/data` and `/var/ossec/etc` (or specific files like `ossec.conf`) to retain rules, decoders, and logs.
|
||||
- **Wazuh Dashboard**: Persist `/usr/share/wazuh-dashboard/data` to retain tenants, dashboards, and visualizations.
|
||||
|
||||
Refer to the [Configuration Files](configuration-files.md) section for more details on mapping specific configuration files.
|
||||
Reference in New Issue
Block a user