Hello Emiliano,
Primaily I was following the steps under the blog :
Index backup management · Wazuh · The Open Source Security Platform to create snapshot from Opensearch. However the blog is not so clear about the steps performed on Opensearch, rather favors more towards Elasticsearch basic. So please find below the steps to recreate the issue : These steps works perfect with OpenDistro and Elasticsearch but not with Wazuh-Indexer(Opensearch)
2) Add the Azure storage accout credentials to Opensearch keystore:
- Login to the Terminal on Wazuh-Indexer Server
- Install "repository-azure" plugin and restart wazuh-indexer
- Run the command "/usr/share/wazuh-indexer/bin/opensearch-keystore add azure.client.default.account" to add the Azure storate account name -
- Run the command "/usr/share/wazuh-indexer/bin/opensearch-keystore add azure.client.default.key" and enter the Azure storage account access key
NOTICE THE ERROR in SECOND LINE
3) Login to Wazuh-Dashboard and from the Devtools run the command to register the snapshot repository
PUT _snapshot/wazuh-es-snapshot
{
"type": "azure",
"settings": {
"container": "es-snapshot",
"chunk_size": "500MB",
"compress": true
}
}
This step should register the respository and is working as expected in Opendistro. However with Wazuh-Indexer, it throws the error "Unable to find client with name [default]". This means that Opensearch is unable to find the Azure client credentials in Keystore. I suspect its something related to the error with /usr/share/wazuh-indexer/config" directory missing. I have tested this in multiple Wazuh-indexer instances with the exact same result. Note : I tried with installing wazuh-Indexer with both Step by step installation and initiating the cluster with SecurityAdmin and using the Install script. Both showed the same result.
Logs from wazuh-cluster.log :
[2022-06-15T14:09:52,962][INFO ][o.o.s.c.ConfigurationRepository] [node-1] Will not attempt to create index .opendistro_security and default configs if they are absent. Use securityadmin to initialize cluster
[2022-06-15T14:09:52,976][INFO ][o.o.s.c.ConfigurationRepository] [node-1] Background init thread started. Install default config?: false
at org.opensearch.security.configuration.ConfigurationRepository.getConfigurationsFromIndex(ConfigurationRepository.java:375) [opensearch-security-1.2.4.0.jar:1.2.4.0]
at org.opensearch.security.configuration.ConfigurationRepository.reloadConfiguration0(ConfigurationRepository.java:321) [opensearch-security-1.2.4.0.jar:1.2.4.0]
at org.opensearch.security.configuration.ConfigurationRepository.reloadConfiguration(ConfigurationRepository.java:306) [opensearch-security-1.2.4.0.jar:1.2.4.0]
at org.opensearch.security.configuration.ConfigurationRepository$1.run(ConfigurationRepository.java:166) [opensearch-security-1.2.4.0.jar:1.2.4.0]
[2022-06-15T14:10:01,974][INFO ][o.o.s.c.ConfigurationRepository] [node-1] Hot-reloading of audit configuration is enabled
[2022-06-15T14:10:01,975][INFO ][o.o.s.c.ConfigurationRepository] [node-1] Node 'node-1' initialized
[2022-06-15T14:17:19,001][INFO ][o.o.r.RepositoriesService] [node-1] put repository [wazuh-es-snapshot]
[2022-06-15T14:17:19,237][WARN ][r.suppressed ] [node-1] path: /_snapshot/wazuh-es-snapshot, params: {pretty=true, repository=wazuh-es-snapshot}
org.opensearch.repositories.RepositoryVerificationException: [wazuh-es-snapshot] path is not accessible on master node
at org.opensearch.repositories.blobstore.BlobStoreRepository.startVerification(BlobStoreRepository.java:1549) ~[opensearch-1.2.4.jar:1.2.4]
at org.opensearch.repositories.blobstore.BlobStoreRepository.startVerification(BlobStoreRepository.java:1544) ~[opensearch-1.2.4.jar:1.2.4]
[2022-06-15T14:20:31,219][INFO ][o.o.r.RepositoriesService] [node-1] update repository [wazuh-es-snapshot]
[2022-06-15T14:20:31,289][WARN ][r.suppressed ] [node-1] path: /_snapshot/wazuh-es-snapshot, params: {pretty=true, repository=wazuh-es-snapshot}
org.opensearch.repositories.RepositoryVerificationException: [wazuh-es-snapshot] path is not accessible on master node
at org.opensearch.repositories.blobstore.BlobStoreRepository.startVerification(BlobStoreRepository.java:1549) ~[opensearch-1.2.4.jar:1.2.4]
at org.opensearch.repositories.blobstore.BlobStoreRepository.startVerification(BlobStoreRepository.java:1544) ~[opensearch-1.2.4.jar:1.2.4]