-
Notifications
You must be signed in to change notification settings - Fork 5
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
Implement the Rest API on the Indexer #69
Labels
Comments
4 tasks
15 tasks
8 tasks
The API endpoint is already functional, we are polishing some details for the MVP delivery. To test the endpoint with sample data, we have generated an events generator (see wazuh/wazuh-indexer#433). We can see a demo of the endpoint in action below. curl -XPOST "http://127.0.0.1:9200/test/_doc" -H 'Content-Type: application/json' -d'
{
"source": "Users/Services",
"user": "user13",
"target": "WazuhServerCluster5",
"type": "agent_group",
"action": {
"type": "Server cluster",
"args": [
"/path/to/executable/arg8"
],
"version": "v4"
},
"timeout": 100
}' The API replies with the following schema: {"_index":".commands","_id":"<document_id>","result":"created"} If we query the index for result, we get:
{
"took": 37,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 1,
"relation": "eq"
},
"max_score": 1,
"hits": [
{
"_index": "command-manager",
"_id": "1618514298767712625",
"_score": 1,
"_source": {
"source": "Users/Services",
"user": "user53",
"target": "WazuhServerCluster5",
"type": "agent",
"action": {
"type": "Agent groups",
"args": [
"/path/to/executable/arg8"
],
"version": "v5"
},
"timeout": 92,
"status": "PENDING",
"order_id": "1618514298",
"request_id": "767712625"
}
}
]
}
} |
5 tasks
AlexRuiz7
changed the title
Create new endpoint on the Command Manager plugin
Implement the Rest API on the Indexer
Oct 2, 2024
This issue is being transferred. Timeline may not be complete until it finishes.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
We need to create a new HTTP Rest API to the Command Manager plugin, exposing a POST endpoint that receives the command action request from the Management API on the Wazuh Server node, or from the Content Manager plugin (this is yet to be defined). Independently of the source, the Command Manager endpoint must receive this information, fit it into the Command index data model and persist the data on the index.
The endpoint must define the endpoint and its parameters, validate the data and persist it as the Commands index data model requires.
Be aware of any security concerns. On a next iteration, we want to secure the endpoint, so only allowed clients are allowed to use the endpoint.
Tasks
The text was updated successfully, but these errors were encountered: