Hi Adriano,
1. When you deploy Wazuh with Elastic stack (Kibana, Elasticsearch and Filebeat), the data is stored in different places:
- Local databases in the Wazuh server/manager hosts. You could use the Wazuh API included in each Wazuh server/manager to query this data. The link you shared,
https://documentation.wazuh.com/current/user-manual/api/reference.html, is related to the Wazuh API.
- Data related to alerts is indexed to Elasticsearch through Filebeat from each Wazuh server/manager. You will need to use the Elasticsearch API.
Depending on the data you need to analyze in your script, you could need to do queries to Wazuh API, Elasticsearch API, or both.
2. Kibana allows to creation of dashboards through the Dashboards application. These dashboards are composed of visualizations that use the data stored in Elasticsearch. It means, that if you want to use these dashboards, the data to represent must be indexed in Elasticsearch. For example, if you pretend to display information that your script generates, then you must index this data if doesn't exist previously to Elasticsearch so the dashboards are able to use that data in the visualizations.
Kibana can be accessible through:
- graphically through the browser. You should use the URL of the machine that is running Kibana.
- programmatically through the API endpoints.
Kibana dashboards are usually created through the interaction of a user with the UI using the Dashboards plugin or importing from files. If you want to create the dashboard from your script, then you could need to interact with the saved objects API of Kibana. I found a related topic that metions this:
https://discuss.elastic.co/t/creating-dashbard-and-visualisation-with-python/270235.
If you used the quick start script and you mentioned to Wazuh dashboard, I guess you deployed the Wazuh stack. This stack is composed of:
- Wazuh server/manager (with Filebeat)
- Wazuh dashboard
- Wazuh indexer
Wazuh dashboard and Wazuh indexer are applications based on OpenSearch Dashboards and OpenSearch distributions, which are forks of Kibana and Elasticsearch 7.10.2.
Depending on your requirements, you could create the dashboards on the Wazuh dashboard instead of Kibana.
If you need to create the dashboards on Kibana and you deployed the Wazuh stack (Wazuh server, Wazuh dashboard and Wazuh indexer), you will need to install a Kibana and Elasticsearch. If you are not interested in the Wazuh stack, then you could be interested in deploying Wazuh with Elastic stack instead
https://documentation.wazuh.com/current/deployment-options/elastic-stack/index.html. But you should know that there will be no Wazuh 4.6.0 plugins for the currently supported Kibana versions (7.16.x and 7.17.x). The Wazuh plugin for Kibana lets to manage and see the data of Wazuh. See the compatibility matrix of the Kibana plugin:
https://github.com/wazuh/wazuh-dashboard-plugins/wiki/Compatibility.