
Hi Robert,
What would be the easiest way to not forward (block, drop, etc.) the alerts generated by the manager into the Wazuh app?
My approach is about Logstash and its filters, I’ve quickly tested the next filter and it seems to be working:
filter {
if [agent][id] == "000" {
drop {}
}
}
Add it to your Logstash configuration file (in each Logstash if you have more than one instance) usually located at /etc/logstash/conf.d/01-wazuh.conf and restart it once done:
systemctl restart logstash
I’ve created a xyz-wazuh-alerts-* index. I think I need to create a new kibana user/role and associate it with this new index. Is that correct? Then I might need to use that new kibana user in the kibana.yml file
Since your environment is a bit mixed, my suggestion is to use the elastic user for your specific use case regardless our X-Pack guide. This means you should have this at the kibana.yml file:
elasticsearch.username: "elastic"
elasticsearch.password: "elastic_user_password"
You should not have two elasticsearch.username in the kibana.yml file. You should use the elastic user too when log in the Kibana UI so you are using elastic in both sides (server and UI).
Is there a way to create xyz-wazuh-monitoring for each to keep them separate?
Those indices are created from the Wazuh app and their are not supporting custom index name for now. In any case I’m going to include it in our roadmap, it looks interesting. By the way you
could try to create a custom package, the affected lines are below:
$ cd /usr/share/kibana/plugins/wazuh
$ grep -R "wazuh-monitoring-" -n
server/integration-files/visualizations/overview/overview-general.js:25: '{"index":"wazuh-monitoring-3.x-*","filter":[],"query":{"query":"","language":"lucene"}}'
server/integration-files/monitoring-template.js:14: template: 'wazuh-monitoring-3.x-*',
server/monitoring.js:75: const index_pattern = 'wazuh-monitoring-3.x-*';
server/monitoring.js:76: const index_prefix = 'wazuh-monitoring-3.x-';
server/initialize.js:186: item.title.includes('wazuh-monitoring-*') ||
server/initialize.js:187: item.id.includes('wazuh-monitoring-*')
server/lib/elastic-wrapper.js:749: id: 'index-pattern:wazuh-monitoring-*'
config.yml:90:# Configure wazuh-monitoring-3.x-* indices shards and replicas.
Once modified, just restart Kibana:
systemctl restart kibana
This point is not tested so it might break your app, be careful.
The way you explained it, it sounds like only one kibana could have the monitoring index
A Wazuh app instance could work in three ways regarding the wazuh-monitoring indices like Javier said depending on the config.yml value:
wazuh.monitoring.enabled: true this will show you data in the Agent status visualization and will fetch agents from the Wazuh API then it will ingest data into Elasticsearch.wazuh.monitoring.enabled: worker this will show you data in the Agent status visualization only.wazuh.monitoring.enabled: false this wont show the Agent status visualization neither will ingest data.The problem is to have two true instance plus using a common Wazuh API in both instances, they will fetch the same agents twice, that’s why we implemented the worker option.
I hope all these questions are now clearer.
Best regards,
Jesús
Hi Robert,
Further releases will include a setting to customize this easily, for now, follow these steps to customize wazuh-monitoring indices:
Move to the desired app directory:
$ cd /usr/share/kibana/plugins/wazuh
Look for affected files (this output may be different in your case depending on the installed app):
$ grep -R "wazuh-monitoring-" -n
server/integration-files/visualizations/overview/overview-general.js:25: '{"index":"wazuh-monitoring-3.x-*","filter":[],"query":{"query":"","language":"lucene"}}'
server/integration-files/monitoring-template.js:14: template: 'wazuh-monitoring-3.x-*',
server/monitoring.js:75: const index_pattern = 'wazuh-monitoring-3.x-*';
server/monitoring.js:76: const index_prefix = 'wazuh-monitoring-3.x-';
server/initialize.js:186: item.title.includes('wazuh-monitoring-*') ||
server/initialize.js:187: item.id.includes('wazuh-monitoring-*')
server/lib/elastic-wrapper.js:749: id: 'index-pattern:wazuh-monitoring-*'
config.yml:90:# Configure wazuh-monitoring-3.x-* indices shards and replicas.
Replace all the above occurrences by your desired pattern.
Once modified, just restart Kibana:
systemctl restart kibana
Regards,
Jesús


This is the status of the monitoring indices on the /opt/kibana-company4 instances. (Note. I do not have alerts flowing into the ES cluster yet, have not yet connected the Wazuh API, and I have not loaded an updated template. I just installed the Kibana first in this sequence as I'm waiting for others to complete things related to those tasks.
$ grep -R "wazuh-monitoring-" -n
server/integration-files/visualizations/overview/overview-general.js:22: "searchSourceJSON": "{\"index\":\"xyz-wazuh-monitoring-3.x-*\",\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"}}"
server/integration-files/monitoring-template.js:14: "template": "xyz-wazuh-monitoring-3.x-*",
server/lib/elastic-wrapper.js:712: id: 'index-pattern:xyz-wazuh-monitoring-*'
server/initialize.js:116: if(item.title.includes('xyz-wazuh-monitoring-*') || item.id.includes('xyz-wazuh-monitoring-*')) continue;
server/monitoring.js:53: const index_pattern = "xyz-wazuh-monitoring-3.x-*";
server/monitoring.js:54: const index_prefix = "xyz-wazuh-monitoring-3.x-";
config.yml:90:# Configure xyz-wazuh-monitoring-3.x-* indices shards and replicas.