Skip to content

Commit

Permalink
Add commands index template definition (#413)
Browse files Browse the repository at this point in the history
* Add commands index template definition

* Change oreder_id data type
  • Loading branch information
AlexRuiz7 authored Sep 19, 2024
1 parent 2676a0b commit 8c14782
Show file tree
Hide file tree
Showing 5 changed files with 133 additions and 0 deletions.
79 changes: 79 additions & 0 deletions ecs/command/fields/custom/command.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
- name: command
title: Wazuh commands
short: Wazuh Inc. custom fields.
description: >
This index stores information about the Wazuh's commands. These commands can be sent to agents or Wazuh servers.
type: group
group: 2
fields:
- name: source
type: keyword
level: custom
description: >
Origin of the request.
- name: user
type: keyword
level: custom
description: >
The user that originated the request.
- name: target
type: keyword
level: custom
description: >
Wazuh Server Cluster name to send the command to.
- name: type
type: keyword
level: custom
description: >
The requested action type. One of 'agent_group', 'agent', 'wazuh_server'.
- name: action.type
type: keyword
level: custom
description: >
The actual requested action. One of Agent groups, Agent, Server cluster.
- name: action.args
type: keyword
level: custom
description: >
Array of command arguments, starting with the absolute path to the executable.
- name: action.version
type: keyword
level: custom
description: >
Version of the command's schema.
- name: timeout
type: short
level: custom
description: >
Time window in which the command has to be sent to its target.
- name: status
type: keyword
level: custom
description: >
Status within the Command Manager's context. One of 'pending', 'sent', 'success', 'failure'.
- name: result.code
type: short
level: custom
description: >
Status code returned by the target.
- name: result.message
type: keyword
level: custom
description: >
Result message returned by the target.
- name: result.data
type: keyword
level: custom
description: >
Result data returned by the target.
- name: request_id
type: short
level: custom
description: >
Unique identifier generated by the Command Manager. Auto-incremental.
- name: order_id
type: short
level: custom
description: >
Unique identifier generated by the Command Manager. Auto-incremental within the same Command Request ID.
4 changes: 4 additions & 0 deletions ecs/command/fields/mapping-settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"dynamic": "strict",
"date_detection": false
}
8 changes: 8 additions & 0 deletions ecs/command/fields/subset.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
name: command
fields:
base:
fields:
tags: []
command:
fields: "*"
20 changes: 20 additions & 0 deletions ecs/command/fields/template-settings-legacy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"index_patterns": [
".commands*"
],
"order": 1,
"settings": {
"index": {
"hidden": true,
"number_of_shards": "1",
"number_of_replicas": "0",
"refresh_interval": "5s",
"query.default_field": [
"command.source",
"command.target",
"command.status",
"command.type"
]
}
}
}
22 changes: 22 additions & 0 deletions ecs/command/fields/template-settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"index_patterns": [
".commands*"
],
"priority": 1,
"template": {
"settings": {
"index": {
"hidden": true,
"number_of_shards": "1",
"number_of_replicas": "0",
"refresh_interval": "5s",
"query.default_field": [
"command.source",
"command.target",
"command.status",
"command.type"
]
}
}
}
}

0 comments on commit 8c14782

Please sign in to comment.