Configuration
Wazuh indexer API configuration file
The Wazuh indexer API configuration is in the /etc/wazuh-indexer/opensearch.yml file on each Wazuh indexer node.
For more information on each available setting, see Wazuh indexer API configuration options. The following are the default settings of the /etc/wazuh-indexer/opensearch.yml file in an all-in-one deployment. The installation fills in the network.host, node.name, and distinguished name (DN) values for each node. <NODE_CERTIFICATE_CN> is the common name (CN) of the node certificate, /etc/wazuh-indexer/certs/indexer.pem.
network.host: "127.0.0.1"
node.name: "node-1"
cluster.initial_cluster_manager_nodes:
- "node-1"
#- "node-2"
#- "node-3"
cluster.name: "wazuh-cluster"
#discovery.seed_hosts:
# - "node-1-ip"
# - "node-2-ip"
# - "node-3-ip"
node.max_local_storage_nodes: "3"
path.data: /var/lib/wazuh-indexer
path.logs: /var/log/wazuh-indexer
plugins.security.ssl.http.pemcert_filepath: /etc/wazuh-indexer/certs/indexer.pem
plugins.security.ssl.http.pemkey_filepath: /etc/wazuh-indexer/certs/indexer-key.pem
plugins.security.ssl.http.pemtrustedcas_filepath: /etc/wazuh-indexer/certs/root-ca.pem
plugins.security.ssl.transport.pemcert_filepath: /etc/wazuh-indexer/certs/indexer.pem
plugins.security.ssl.transport.pemkey_filepath: /etc/wazuh-indexer/certs/indexer-key.pem
plugins.security.ssl.transport.pemtrustedcas_filepath: /etc/wazuh-indexer/certs/root-ca.pem
plugins.security.ssl.http.enabled: true
transport.ssl.enforce_hostname_verification: true
transport.ssl.resolve_hostname: false
# Filled in by resolve-credentials.sh with the DN of the admin certificate.
plugins.security.authcz.admin_dn:
- "C=US,L=California,O=Wazuh,OU=Wazuh,CN=admin"
plugins.security.check_snapshot_restore_write_privileges: true
plugins.security.enable_snapshot_restore_privilege: true
# Filled in by resolve-credentials.sh with the DN of this node's own certificate.
plugins.security.nodes_dn:
- "C=US,L=California,O=Wazuh,OU=Wazuh,CN=<NODE_CERTIFICATE_CN>"
plugins.security.restapi.roles_enabled:
- "all_access"
- "security_rest_api_access"
plugins.security.system_indices.enabled: true
plugins.security.system_indices.indices: [".opendistro-alerting-config", ".opendistro-alerting-alert*", ".opendistro-reports-*", ".opensearch-notifications-*", ".replication-metadata-store", ".wazuh-internal-state"]
cluster.default_number_of_replicas: 0
bootstrap.memory_lock: true
# Resilience under heap pressure (small heaps, e.g. 2 GB): shed work — reject (429)
# and cancel runaway searches instead of letting the JVM heap exhaust and crash.
search_backpressure.mode: enforced # actually cancel heavy search tasks (default only logs)
indices.breaker.total.use_real_memory: true # account real heap used, not just reserved bytes
indices.breaker.total.limit: 80% # trip early (default 95%); leaves headroom for Lucene flush/merge
indexing_pressure.memory.limit: 10% # cap in-flight indexing bytes; reject excess bulk
# Use no replicas by default on ISM internal indices
plugins.index_state_management.history.number_of_replicas: 0
# Default max scroll context keep alive
search.max_keep_alive: "4h"
The following table describes the main settings of this file.
Setting |
Description |
|---|---|
|
The address where the Wazuh indexer node listens for HTTP and transport connections. |
|
The name of the Wazuh indexer node. |
|
The nodes that can be elected as cluster manager when the cluster starts for the first time. |
|
The name of the Wazuh indexer cluster. |
|
The certificate, key, and root CA files that encrypt the HTTP (API) and transport (node-to-node) layers. The files are in |
|
Verifies the host name in the certificates of the other nodes on the transport layer. |
|
The distinguished name of the admin certificate, |
|
The distinguished names of the node certificates allowed to join the cluster. |
|
The roles that can use the security REST API, |
|
The default number of replicas for new indexes. |
|
Locks the Wazuh indexer memory to prevent swapping. |
|
Protect the node under heap pressure. The node rejects or cancels heavy requests instead of running out of memory. |
|
The maximum keep-alive time for search contexts, such as scroll requests. |
Warning
When you run a Wazuh indexer cluster, the nodes don't share their /etc/wazuh-indexer/opensearch.yml configuration file. Each node keeps its own Wazuh indexer API configuration. If you change the configuration file on one node, you must update the configuration on each of the other nodes to keep the cluster consistent. Don't overwrite the node-specific values, such as network.host, node.name, and plugins.security.nodes_dn, on each node.
Restart the Wazuh indexer
After you change the configuration file, restart the Wazuh indexer service to apply the changes.
# systemctl restart wazuh-indexer
# service wazuh-indexer restart
Replace restart with start, stop, or status to run the other actions.
Wazuh indexer API configuration options
You can check the value that a node uses for any of these settings with the following request:
# curl -k -u <WAZUH_INDEXER_USERNAME>:<WAZUH_INDEXER_PASSWORD> "https://<WAZUH_INDEXER_IP>:9200/_cluster/settings?include_defaults=true&flat_settings=true&pretty"
network
Sub-fields |
Allowed values |
Default value |
Description |
|---|---|---|---|
|
A list of valid IP addresses or hostnames |
Set during installation. |
IP addresses or hostnames of the Wazuh indexer node where the Wazuh indexer API runs. |
|
IP address |
The value of |
Binds a node to one or more addresses for incoming connections. |
|
IP address |
The value of |
The address that a node publishes to other nodes in a cluster so they can connect to it. |
Note
The address must be the same as the node address set in the config.yml file used during the Wazuh component installation or the certificate generation.
http
Sub-fields |
Allowed values |
Default value |
Description |
|---|---|---|---|
|
Any value between 1 and 65535, or a range |
|
The port where the Wazuh indexer API listens. If you specify a range, the node binds to the first available port in the range. |
|
Any data size value followed by a valid unit, such as |
|
The maximum size of HTTP request bodies, including documents, bulk operations, and queries. |
|
Any time value followed by a valid unit, such as |
|
The maximum time the HTTP client waits to connect with a remote server. The value |
|
Any data size value followed by a valid unit, such as |
|
The maximum size of a chunk in HTTP responses when chunked transfer encoding is used. |
|
|
|
Enables support for compression using |
|
Any integer between 1 and 9 |
|
The compression level for HTTP responses when HTTP compression is enabled. Lower values use less CPU and give faster response times. |
|
Any data size value followed by a valid unit, such as |
|
The maximum length of the initial line of an HTTP request. The initial line contains the HTTP method, URL, and protocol version. |
|
Any supported HTTP implementation |
|
The HTTP implementation or HTTP server module that handles HTTP requests. |
|
Any positive integer |
|
The maximum number of HTTP pipelined events that the server handles for a single connection. |
|
Any supported HTTP implementation |
|
The default HTTP server implementation when |
|
|
|
Specifies whether requests sent to the Wazuh indexer must include a |
|
IP address |
|
The address for HTTP communication on a Wazuh indexer node. |
|
Any value between 1 and 65535 |
|
The port on which the node advertises its HTTP service to external clients. The value |
|
Any time value followed by a valid unit, such as |
|
The maximum time the HTTP server waits to receive a complete client request. The server closes the connection if it doesn't receive the request in time. |
|
IP address |
|
The addresses a Wazuh indexer node binds to for incoming HTTP connections. |
|
|
|
Controls whether the Wazuh indexer sends a |
|
Any positive integer, or |
|
The maximum number of warning headers in an HTTP response. The value |
|
A glob pattern that matches the request URI, such as |
|
The HTTP requests to include in tracing logs. Tracing logs are detailed logs of incoming and outgoing HTTP requests, used mainly for debugging or monitoring. |
|
A glob pattern that matches the request URI, such as |
|
The HTTP requests to exclude from tracing logs, even if they match |
|
Any data size value followed by a valid unit, such as |
|
The maximum total size of the warning headers in an HTTP response. Warning headers carry deprecation warnings, potential issues, and other messages related to the request. The value |
|
|
|
Controls whether HTTP responses include detailed error messages when requests fail. |
|
Any data size value followed by a valid unit, such as |
|
The maximum combined size of the HTTP headers of a request. |
|
IP address |
|
The addresses that a Wazuh indexer node publishes to other nodes for HTTP communication. |
http.cors
Sub-fields |
Allowed values |
Default value |
Description |
|---|---|---|---|
|
|
|
Enables or disables Cross-Origin Resource Sharing (CORS) for HTTP requests. |
|
Any time value, in seconds |
|
How long browsers can cache the results of a CORS preflight request. |
|
Any string that represents a domain |
|
The domains allowed to access the Wazuh indexer. Wildcards are supported. |
|
Any HTTP header |
|
The HTTP headers allowed in the request. |
|
|
|
Controls whether cross-origin requests to the Wazuh indexer can include cookies and authentication information, such as HTTP credentials. |
|
Any HTTP method |
|
The HTTP methods allowed for cross-origin requests, such as |
logger
Sub-fields |
Allowed values |
Default value |
Description |
|---|---|---|---|
|
|
|
The logging verbosity, which controls the kind of log messages the Wazuh indexer records. |
path
Sub-fields |
Allowed values |
Default value |
Description |
|---|---|---|---|
|
Any valid path |
|
The directory where the Wazuh indexer stores its data. |
|
Any valid path |
|
The directory where the Wazuh indexer stores its log files. |
|
Any valid path |
|
The directory where the Wazuh indexer stores shared data files. |
|
Any valid path |
|
The root directory of the Wazuh indexer core files and directories. |
|
Any valid path |
|
The directories where the Wazuh indexer stores repository data for snapshots and restores. |
search
Sub-fields |
Allowed values |
Default value |
Description |
|---|---|---|---|
|
Integer |
|
The maximum number of aggregation buckets allowed in a single search response. |
|
|
|
Controls whether the Wazuh indexer returns partial results when a search request times out or a shard fails. The |
|
Any time value followed by a valid unit, such as |
|
The time after which the Wazuh indexer cancels a search request automatically. The value |
|
Any time value followed by a valid unit, such as |
|
The default maximum time a search waits for results before it times out. Use it with |
|
Any time value followed by a valid unit, such as |
|
The maximum keep-alive time for search contexts, such as scroll requests. |