Error 405 occurred while querying the API

102 views
Skip to first unread message

KPay SOC

unread,
Mar 6, 2024, 10:51:24 PM3/6/24
to Wazuh | Mailing List
Hello, I have searched before writing, but I can't find a solution, sorry if the topic is answered.

I have an instance of Wazuh on a client, version 4.3.8 I would like to start working with the API to make some queries.

I have configured the file /usr/share/wazuh-dashboard/data/wazuh/config/wazuh.yml
hosts:
- default:
url: https://172.21.0.61
port: 55000
username: wazuh-wui
password: wazuh-wui
run_as: false

Also the file /var/ossec/api/configuration/api.yaml with the default configuration from the documentation

When I make a request from the server itself
# curl -u "wazuh":"wazuh" -k -X POST "https://172.21.0.61:55000/security/user/authenticate?raw=true"The answer is: "{"statusCode":404,"error":"Not Found","message":"Not Found"}"



Can anyone give me a clue.

Thanks!

Md. Nazmur Sakib

unread,
Mar 6, 2024, 11:17:08 PM3/6/24
to Wazuh | Mailing List
Hi KPay SOC,

Good Day!
I am looking into your query. Please allow me a few minutes.

Md. Nazmur Sakib

unread,
Mar 6, 2024, 11:51:06 PM3/6/24
to Wazuh | Mailing List

Hi KPay SOC,


I was testing the API request and it worked fine with both wazuh-wui and wazuh users. You do not need to make any changes to any configuration file for this. Check the screenshot for reference.





I would suggest you undo the changes and try again with the correct password of the API users.


Ref:https://documentation.wazuh.com/current/user-manual/api/reference.html#section/Authentication


Let me know the update on the issue.

KPay SOC

unread,
Mar 7, 2024, 12:42:32 AM3/7/24
to Wazuh | Mailing List
20240307134137038.PNG
My connection is OK but still 405

Md. Nazmur Sakib

unread,
Mar 7, 2024, 1:08:05 AM3/7/24
to Wazuh | Mailing List
If the issue was with connection you would get the "Failed to connect to 172.21.0.61 port 55000 after 21061 ms: Connection refused" error.

The 405 error method not allowed happens when a client attempts to use an HTTP method that is not allowed by the server. For example, this issue can occur when a user tries to use a method such as PUT or DELETE on a resource that only allows GET or POST requests. In your case, I believe that because of the changes in the configuration the POST request is rejected by the server.

Can you try to undo the changes you made and try again?

Md. Nazmur Sakib

unread,
Mar 8, 2024, 4:49:14 AM3/8/24
to Wazuh | Mailing List
Let me know the update on the issue.

Reply all
Reply to author
Forward
0 new messages