Open AlexRuiz7 opened 3 days ago
We decided to add the @timestamp
, and delivery_timestamp
fields at the document "top level" (same level than the agent
, or command
groups), the pertinent modifications were made on both repositories, and now are under testing.
The ECS definitions of the command
index were modified, creating a base.yml
file which stores the delivery_timestamp
field definition, and applying the corresponding modifications on the subset.yml
file.
The event_generator
was updated and the index template was successfully generated
Added timestamp
and deliveryTimestamp
attributes to the command-manager Document
model, the attributes are mapped to the @timestamp
and delivery_timestamp
fields corresponding to each case.
Updated command
index template on both plugins' resources.
Command created with a POST request to the command-manager API
{
"took": 32,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 1,
"relation": "eq"
},
"max_score": 1.0,
"hits": [
{
"_index": ".commands",
"_id": "fZuAdJMBy-t6tcAPACYT",
"_score": 1.0,
"_source": {
"agent": {
"groups": [
"groups000"
]
},
"command": {
"source": "Engine",
"user": "TestUser",
"target": {
"type": "agent",
"id": "TestTarget"
},
"action": {
"name": "restart",
"args": [
"/test/path/fake/args"
],
"version": "v4"
},
"timeout": 30,
"status": "PENDING",
"order_id": "fJuAdJMBy-t6tcAPACYT",
"request_id": "e5uAdJMBy-t6tcAPACYS"
},
"@timestamp": 1732826365971,
"delivery_timestamp": 1732826395971
}
}
]
}
}
Description
In order to schedule the management of the commands by the Command Manager plugin, we need to add a
@timestamp
field to the index data model. This field is part of the ECS.This field will be initialized by the plugin. In other words, the value of the field depicts the exact moment on which the command is indexed. We'll also include a field to store the result of
delivery_timestamp = timestamp + timeout
.Functional requirements
@timestamp
field.Implementation restrictions
Plan
@timestamp
to the index data model (wazuh-indexer/ecs + generator)