Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SWARM] wazuh-manager does not seems to repond to wazuh-dashboard #1122

Open
Brettdah opened this issue Nov 20, 2023 · 1 comment
Open

[SWARM] wazuh-manager does not seems to repond to wazuh-dashboard #1122

Brettdah opened this issue Nov 20, 2023 · 1 comment

Comments

@Brettdah
Copy link

Brettdah commented Nov 20, 2023

Hello there,

I'm trying to start wazuh on a swarm cluster but something is blocking me....
on the wazuh interface after login as administrator (the 1st time)
there are a few checks and the first one seems to fail every time even after a few hours of running...
Check wazuh API :

INFO: No current API selected
INFO: Getting API hosts...
INFO: API hosts found: 1
INFO: Checking API host id [1513629884013]...
INFO: Could not connect to API id [1513629884013]: 3099 - ERROR3099 - Wazuh not ready yet
INFO: Removed [navigate] cookie
ERROR: No API available to connect

but when I log into my dashboard container as root

docker container exec -it -u root wazuh-dashboard /bin/bash

and then after having curl installed :

TOKEN=$(curl -u wazuh-wui:MySuperSecretPa$$W0rd -k -X POST "https://wazuh-manager:55000/security/user/authenticate?raw=true")
curl -k -X GET "https://wazuh-manager:55000/?pretty=true" -H  "Authorization: Bearer $TOKEN"
{
   "data": {
      "title": "Wazuh API REST",
      "api_version": "4.6.0",
      "revision": 40603,
      "license_name": "GPL 2.0",
      "license_url": "https://github.com/wazuh/wazuh/blob/v4.6.0/LICENSE",
      "hostname": "<wazuh manager container ID>",
      "timestamp": "2023-11-20T00:03:59Z"
   },
   "error": 0

So on the container it seems to work yet the dashboard can't connect...

Probably related to this issue or this one but they are a bit old now as a few version were released and it seems no progress were made and to me all the piece are there as each service have the adresses of the service(s) they need so why hardcode things ? just use the INDEXER_URL, WAZUH_API_URL from the environnement ;)
May be ask swarm user to duplicate those on all 3 containers ;)

in swarm mode we don't need a name or the restart options but a fullly functionnal healthcheck on the containers so warm know when a container is OK or not... and as I said in 1 of the issues I linked the link option is ignored too... you don't even need to create a network to link all your service togather as it is part of the process to create a default network so your service will communicate together...

@Brettdah
Copy link
Author

I went inside the container and change /usr/share/wazuh-dashboard/data/wazuh/config/wazuh.yml where the API url was https://wazuh.manager instead of wazuh-manager in my case and I had the env var

[...]
  wazuh-dashboard:
    image: wazuh/wazuh-dashboard:4.6.0
    environment:
      - WAZUH_API_URL=https://wazuh-manager
[...]

Now I should be able to test more ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant